-
Notifications
You must be signed in to change notification settings - Fork 6
Configuring the documentation for Sphinx and ReadTheDocs #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joe-from-mtl
wants to merge
40
commits into
main
Choose a base branch
from
sphinx-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 39 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
9de015a
Create conf.py for sphinx
joe-from-mtl 0fe1f70
Create requirements for sphinx
joe-from-mtl 31dea93
Update .readthedocs.yaml to use sphinx specific requirements
joe-from-mtl f678d1a
Renamed the sphinx requirements file
joe-from-mtl 0534209
Adding a base documentation file for Sphinx
joe-from-mtl 94cb3e7
Adding a script documentation as an example
joe-from-mtl 5ea798c
Adding the linum requirements to build the doc
joe-from-mtl 2d8c59f
Sphing was complaining that there were no versions for this package
joe-from-mtl b32bb53
Latest python version is causing a problem with some dependencies
joe-from-mtl 3800e5c
Scripts were not appearing in the compiled doc
joe-from-mtl 91b0565
Adding the script name
joe-from-mtl 26d2701
Adding the linumpy automodule documentation
joe-from-mtl 77f37e8
Adding the linumpy automodule documentation
joe-from-mtl 28c6ebd
Using autosummary for the API documentation
joe-from-mtl c376dec
Including linumpy
joe-from-mtl cf72a1a
Trying autosummary
joe-from-mtl be01d2c
Supporting numpy style documentation
joe-from-mtl 119b9e7
Napoleon settings
joe-from-mtl 08299d1
Autodoc and autosummary with templates
joe-from-mtl 7e7fdef
Error with autosummary formating
joe-from-mtl 7c90595
Generating an API documentation, and adding script docs
joe-from-mtl 51273ba
Missing dependency
joe-from-mtl 7da8c0a
Formatting docstring
joe-from-mtl 419ff65
Formatting docstring
joe-from-mtl 4c7cec6
Removing the pip install option for now
joe-from-mtl be46990
Adding a usage example and removing the shell scripts
joe-from-mtl 430ff79
Formatting the docstring according to numpy style
joe-from-mtl 09a9985
Formatting the docstring according to numpy style
joe-from-mtl 415d790
Merge remote-tracking branch 'origin/sphinx-config' into sphinx-config
joe-from-mtl 41a464a
Removing old scripts and renaming a few to make things clearer (issue…
joe-from-mtl 6e5f947
Adapting the script name for issue #30
joe-from-mtl 7054921
Adapting the documentation based on the removed and renamed scripts (…
joe-from-mtl a806bd8
Adapting the documentation to use numpy style
joe-from-mtl 46f6a38
Formatting
joe-from-mtl 053f0ee
Formatting according to PEP8
joe-from-mtl 8451f1c
Adding a convention for the axis order
joe-from-mtl 92026ec
Formatting for PEP8
joe-from-mtl 4087527
Formatting for PEP8
joe-from-mtl 22338b5
Adding a script that was removed by error from the 3D pipeline
joe-from-mtl 6edeb53
Update docs/CONTRIBUTING.md to use .ome.zarr
joe-from-mtl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Minimal makefile for Sphinx documentation | ||
| # | ||
|
|
||
| # You can set these variables from the command line, and also | ||
| # from the environment for the first two. | ||
| SPHINXOPTS ?= | ||
| SPHINXBUILD ?= sphinx-build | ||
| SOURCEDIR = . | ||
| BUILDDIR = _build | ||
|
|
||
| # Put it first so that "make" without argument is like "make help". | ||
| help: | ||
| @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
|
||
| .PHONY: help Makefile | ||
|
|
||
| # Catch-all target: route all unknown targets to Sphinx using the new | ||
| # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
| %: Makefile | ||
| @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Configuration file for the Sphinx documentation builder. | ||
| # | ||
| # For the full list of built-in configuration values, see the documentation: | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
|
||
| import os | ||
| import sys | ||
|
|
||
| sys.path.insert(0, os.path.abspath("../")) | ||
| sys.path.insert(1, os.path.abspath("../scripts")) | ||
|
|
||
| # -- Project information ----------------------------------------------------- | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
|
||
| project = 'linumpy' | ||
| copyright = '2024, LINUM' | ||
| author = 'LINUM' | ||
|
|
||
| # -- General configuration --------------------------------------------------- | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
|
||
| extensions = [ | ||
| 'autoapi.extension', | ||
| "sphinx.ext.viewcode", | ||
| "sphinx.ext.napoleon", | ||
| 'sphinx.ext.autodoc', | ||
| 'sphinx.ext.autosummary', | ||
| 'autoapi.extension', | ||
| 'sphinxarg.ext', | ||
| ] | ||
|
|
||
| autoapi_dirs = ['../linumpy'] | ||
| autoapi_root = "api" | ||
| autodoc_typehints = 'description' | ||
| autoapi_ignore = ['*dev*'] | ||
| templates_path = ['_templates'] | ||
| exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
|
||
| # -- Options for HTML output ------------------------------------------------- | ||
| # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
|
||
| html_theme = 'furo' | ||
| pygments_style = 'sphinx' | ||
|
|
||
| # Napoleon settings | ||
| napoleon_google_docstring = True | ||
| napoleon_numpy_docstring = True | ||
| napoleon_include_init_with_doc = False | ||
| napoleon_include_private_with_doc = False | ||
| napoleon_include_special_with_doc = True | ||
| napoleon_use_admonition_for_examples = False | ||
| napoleon_use_admonition_for_notes = False | ||
| napoleon_use_admonition_for_references = False | ||
| napoleon_use_ivar = False | ||
| napoleon_use_param = True | ||
| napoleon_use_rtype = True | ||
| napoleon_preprocess_types = False | ||
| napoleon_type_aliases = None | ||
| napoleon_attr_annotations = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| Welcome to the LINUMPY documentation! | ||
| ===================================== | ||
|
|
||
| LINUMPY is a collection of tools to work with serial blockface histology data. These tools are developed by the `LINUM <https://linum-lab.ca>`_ lab at Université du Québec à Montréal (`UQAM <https://uqam.ca/>`_, Canada). | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
|
|
||
| scripts | ||
| usage | ||
|
|
||
| Indices and tables | ||
| ================== | ||
|
|
||
| * :ref:`genindex` | ||
| * :ref:`modindex` | ||
| * :ref:`search` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| sphinx | ||
| sphinx-autoapi | ||
| sphinx-argparse | ||
| furo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,198 @@ | ||
| Scripts | ||
| ======= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
|
|
||
| The following scripts are available in the `scripts` directory: | ||
|
|
||
| linum_aip | ||
| --------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_aip.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_aip.py | ||
|
|
||
| linum_compensate_attenuation | ||
| ---------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_compensate_attenuation.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_compensate_attenuation.py | ||
|
|
||
| linum_compensate_for_psf | ||
| ------------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_compensate_for_psf.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_compensate_for_psf.py | ||
|
|
||
| linum_compensate_illumination_2d | ||
| -------------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_compensate_illumination_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_compensate_illumination_2d.py | ||
|
|
||
| linum_compute_attenuation | ||
| ------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_compute_attenuation.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_compute_attenuation.py | ||
|
|
||
| linum_compute_attenuationBiasField | ||
| ---------------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_compute_attenuationBiasField.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_compute_attenuationBiasField.py | ||
|
|
||
| linum_convert_bin_to_nii | ||
| ------------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_convert_bin_to_nii.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_convert_bin_to_nii.py | ||
|
|
||
| linum_convert_nifti_to_zarr | ||
| --------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_convert_nifti_to_zarr.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_convert_nifti_to_zarr.py | ||
|
|
||
| linum_convert_omezarr_to_nifti | ||
| ------------------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_convert_omezarr_to_nifti.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_convert_omezarr_to_nifti.py | ||
|
|
||
| linum_convert_zarr_to_omezarr | ||
| ----------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_convert_zarr_to_omezarr.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_convert_zarr_to_omezarr.py | ||
|
|
||
| linum_create_all_mosaicgrids_2d | ||
| ------------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_create_all_mosaicgrids_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_create_all_mosaicgrids_2d.py | ||
|
|
||
| linum_create_mosaic_grid_2d | ||
| --------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_create_mosaic_grid_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_create_mosaic_grid_2d.py | ||
|
|
||
| linum_create_mosaic_grid_3d | ||
| --------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_create_mosaic_grid_3d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_create_mosaic_grid_3d.py | ||
|
|
||
| linum_crop_tiles_2d | ||
| ------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_crop_tiles_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_crop_tiles_2d.py | ||
|
|
||
| linum_detect_focal_curvature | ||
| ---------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_detect_focal_curvature.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_detect_focal_curvature.py | ||
|
|
||
| linum_download_allen | ||
| -------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_download_allen.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_download_allen.py | ||
|
|
||
| linum_estimate_illumination_2d | ||
| ------------------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_estimate_illumination_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_estimate_illumination_2d.py | ||
|
|
||
| linum_estimate_transform_2d | ||
| --------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_estimate_transform_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_estimate_transform_2d.py | ||
|
|
||
| linum_estimate_xyShift_fromMetadata | ||
| ----------------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_estimate_xyShift_fromMetadata.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_estimate_xyShift_fromMetadata.py | ||
|
|
||
| linum_fix_lateral_illumination_3d | ||
| ----------------------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_fix_lateral_illumination_3d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_fix_lateral_illumination_3d.py | ||
|
|
||
| linum_reorient_to_ras | ||
| --------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_reorient_to_ras.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_reorient_to_ras.py | ||
|
|
||
| linum_resample_nifti | ||
| -------------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_resample_nifti.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_resample_nifti.py | ||
|
|
||
| linum_stack_slices | ||
| ------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_stack_slices.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_stack_slices.py | ||
|
|
||
| linum_stitch_2d | ||
| --------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_stitch_2d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_stitch_2d.py | ||
|
|
||
| linum_stitch_3d | ||
| --------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_stitch_3d.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_stitch_3d.py | ||
|
|
||
| linum_view_omezarr | ||
| ------------------ | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_view_omezarr.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_view_omezarr.py | ||
|
|
||
| linum_view_zarr | ||
| --------------- | ||
| .. argparse:: | ||
| :filename: ../scripts/linum_view_zarr.py | ||
| :func: _build_arg_parser | ||
| :prog: linum_view_zarr.py | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| Usage | ||
| ===== | ||
|
|
||
| The Nextflow workflows in the `workflow` directory can be used to perform reconstruction of the serial OCT data. | ||
|
|
||
| Cluster Reconstruction | ||
| ---------------------- | ||
| To submit a reconstruction on a DigitalAlliance cluster (e.g. Béluga or Narval), you need to prepare a bash script describing the job parameters. | ||
| Here's an example of such a script for a 2.5D reconstruction. | ||
|
|
||
| .. note:: | ||
|
|
||
| For this example, the nextflow pipeline file, nextflow configuration file and the Singularity image containing a compiled version of linumpy are in the same directory as the reconstruction directory. **See the workflow documentation to know how to adapt this example for your specific pipeline** | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| #!/bin/sh | ||
| #SBATCH --nodes=1 | ||
| #SBATCH --cpus-per-task=40 | ||
| #SBATCH --mem=92G | ||
| #SBATCH --time=1:00:00 | ||
| #SBATCH --mail-type=ALL | ||
| #SBATCH --mail-user=<YOUR_EMAIL_ADDRESS> | ||
| #SBATCH --account=<DIG_ALLIANCE_PROJECT_ID> | ||
|
|
||
| module load nextflow | ||
| module load apptainer | ||
|
|
||
| # Parameters | ||
| DIRECTORY=<FULL_PATH_TO_THE_RAW_DATA> | ||
| WORKFLOW_FILE=$DIRECTORY/workflow_reconstruction_2.5d.nf | ||
| CONFIG_FILE=$DIRECTORY/reconstruction_2.5d_beluga.config | ||
| SINGULARITY=$DIRECTORY/linumpy.sif | ||
|
|
||
| nextflow run $WORKFLOW_FILE -c $CONFIG_FILE -with-singularity $SINGULARITY \ | ||
| --directory $DIRECTORY -resume | ||
|
|
||
|
|
||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also mention somewhere than the zarr chunk size is often chosen to match the raw tile size. This is important for the processing pipeline.