Skip to content

Commit 01e1348

Browse files
authored
Reorganize Python package (#20)
1 parent 211ac39 commit 01e1348

29 files changed

Lines changed: 1918 additions & 1899 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ instance/
7171

7272
# Sphinx documentation
7373
docs/_build/
74+
docs/generated/
7475

7576
# PyBuilder
7677
target/

docs/_templates/module.rst

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,57 @@
33

44
.. automodule:: {{ fullname }}
55

6-
{% block functions %}
7-
{% if functions %}
8-
.. rubric:: Functions
9-
10-
.. autosummary::
11-
:toctree:
12-
{% for item in functions %}
13-
{{ item }}
14-
{%- endfor %}
15-
{% endif %}
16-
{% endblock %}
17-
18-
{% block classes %}
19-
{% if classes %}
20-
.. rubric:: Classes
21-
22-
.. autosummary::
23-
:toctree:
24-
{% for item in classes %}
25-
{{ item }}
26-
{%- endfor %}
27-
{% endif %}
28-
{% endblock %}
29-
30-
{% block exceptions %}
31-
{% if exceptions %}
32-
.. rubric:: Exceptions
33-
34-
.. autosummary::
35-
:toctree:
36-
{% for item in exceptions %}
37-
{{ item }}
38-
{%- endfor %}
39-
{% endif %}
40-
{% endblock %}
6+
{% if functions or classes or exceptions %}
7+
.. currentmodule:: {{ fullname }}
8+
9+
{% endif %}
10+
{%- block functions %}
11+
{%- if functions %}
12+
.. rubric:: Functions
13+
14+
.. autosummary::
15+
:toctree: .
16+
{% for item in functions %}
17+
{{ item }}
18+
{%- endfor %}
19+
20+
{% endif %}
21+
{%- endblock %}
22+
{%- block classes %}
23+
{%- if classes %}
24+
.. rubric:: Classes
25+
26+
.. autosummary::
27+
:toctree: .
28+
{% for item in classes %}
29+
{{ item }}
30+
{%- endfor %}
31+
32+
{% endif %}
33+
{%- endblock %}
34+
{%- block exceptions %}
35+
{%- if exceptions %}
36+
.. rubric:: Exceptions
37+
38+
.. autosummary::
39+
:toctree: .
40+
{% for item in exceptions %}
41+
{{ item }}
42+
{%- endfor %}
43+
44+
{% endif %}
45+
{%- endblock %}
46+
47+
{%- block modules %}
48+
{%- if modules %}
49+
.. rubric:: Submodules
50+
51+
.. autosummary::
52+
:toctree: .
53+
:template: module.rst
54+
:recursive:
55+
{% for item in modules %}
56+
{{ item }}
57+
{%- endfor %}
58+
{% endif %}
59+
{%- endblock %}

docs/api.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ API
1818
.. autosummary::
1919
:template: module.rst
2020
:toctree: generated/
21+
:recursive:
2122

22-
cifti
23-
fixels
24-
voxels
25-
h5_storage
26-
parser
27-
s3_utils
28-
tiledb_storage
23+
cli
24+
storage
25+
utils

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# add these directories to sys.path here. If the directory is relative to the
4242
# documentation root, use os.path.abspath to make it absolute, like shown here.
4343
sys.path.append(os.path.abspath('sphinxext'))
44-
sys.path.insert(0, os.path.abspath('../modelarrayio'))
44+
sys.path.insert(0, os.path.abspath('../src'))
4545

4646
from github_link import make_linkcode_resolve # noqa: E402
4747

docs/usage.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ confixel
88
********
99

1010
.. argparse::
11-
:ref: modelarrayio.fixels.get_parser
11+
:ref: modelarrayio.cli.fixels_to_h5.get_parser
1212
:prog: confixel
1313
:func: get_parser
1414

@@ -18,7 +18,7 @@ convoxel
1818
********
1919

2020
.. argparse::
21-
:ref: modelarrayio.voxels.get_parser
21+
:ref: modelarrayio.cli.voxels_to_h5.get_parser
2222
:prog: convoxel
2323
:func: get_parser
2424

@@ -28,7 +28,7 @@ concifti
2828
********
2929

3030
.. argparse::
31-
:ref: modelarrayio.cifti.get_parser
31+
:ref: modelarrayio.cli.cifti_to_h5.get_parser
3232
:prog: concifti
3333
:func: get_parser
3434

@@ -38,25 +38,25 @@ fixelstats_write
3838
****************
3939

4040
.. argparse::
41-
:ref: modelarrayio.fixels.get_h5_to_fixels_parser
41+
:ref: modelarrayio.cli.h5_to_fixels.get_parser
4242
:prog: fixelstats_write
43-
:func: get_h5_to_fixels_parser
43+
:func: get_parser
4444

4545
*****************
4646
volumestats_write
4747
*****************
4848

4949
.. argparse::
50-
:ref: modelarrayio.voxels.get_h5_to_volume_parser
50+
:ref: modelarrayio.cli.h5_to_voxels.get_parser
5151
:prog: volumestats_write
52-
:func: get_h5_to_volume_parser
52+
:func: get_parser
5353

5454

5555
****************
5656
ciftistats_write
5757
****************
5858

5959
.. argparse::
60-
:ref: modelarrayio.cifti.get_h5_to_ciftis_parser
60+
:ref: modelarrayio.cli.h5_to_cifti.get_parser
6161
:prog: ciftistats_write
62-
:func: get_h5_to_ciftis_parser
62+
:func: get_parser

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Repository = "https://github.com/PennLINC/ModelArrayIO"
6666
Documentation = "https://modelarrayio.readthedocs.io"
6767

6868
[project.scripts]
69-
confixel = "modelarrayio.fixels:main"
70-
convoxel = "modelarrayio.voxels:main"
71-
concifti = "modelarrayio.cifti:main"
72-
fixelstats_write = "modelarrayio.fixels:h5_to_fixels"
73-
volumestats_write = "modelarrayio.voxels:h5_to_volumes_wrapper"
74-
ciftistats_write = "modelarrayio.cifti:h5_to_ciftis"
69+
confixel = "modelarrayio.cli.fixels_to_h5:main"
70+
convoxel = "modelarrayio.cli.voxels_to_h5:main"
71+
concifti = "modelarrayio.cli.cifti_to_h5:main"
72+
fixelstats_write = "modelarrayio.cli.h5_to_fixels:main"
73+
volumestats_write = "modelarrayio.cli.h5_to_voxels:main"
74+
ciftistats_write = "modelarrayio.cli.h5_to_cifti:main"
7575

7676
#
7777
# Hatch
@@ -103,7 +103,7 @@ exclude = ".*"
103103

104104
[tool.ruff]
105105
line-length = 99
106-
src = ["src/modelarrayio"]
106+
src = ["src"]
107107

108108
[tool.ruff.lint]
109109
extend-select = [

src/modelarrayio/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from . import cifti, fixels, voxels
2-
3-
__all__ = ['cifti', 'fixels', 'voxels']
1+
"""Top-level package for ModelArrayIO."""

0 commit comments

Comments
 (0)