Skip to content

Commit

Permalink
Fix plotting documentation
Browse files Browse the repository at this point in the history
Issue with matplotlib installation that prevented the plotting page to
be loaded. This was due to a `poetry` installation command.

Also added intersphinx mappings for plotting functionality and made some
text changes to docstrings.
  • Loading branch information
kaitj committed Oct 28, 2023
1 parent 341e532 commit 3b0965c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Directories
__pycache__/
_build/

# Testing
.hypothesis
.ruff_cache
.pytest_cache
.pytest_cache
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ formats: [pdf]
build:
os: ubuntu-20.04
tools:
python: '3.10'
python: "3.10"
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- plotting
2 changes: 1 addition & 1 deletion afids_utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def mean_distances(
template_afid_set: AfidSet,
component: str = "distance",
) -> list[float]:
"""Calculate the average distance for a given spatial component betweeen
"""Calculate the average distance for a given spatial component between
a collection of ``AfidSet`` objects and a common / template ``AfidSet``.
Parameters
Expand Down
7 changes: 3 additions & 4 deletions afids_utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def plot_ortho(
nii_img: nib.nifti1.Nifti1Image,
opacity: float = 1,
) -> StatMapView:
"""Generate interactive, html ortho view of the slices. Uses ``nilearn``
to generate the figures.
"""Generate interactive, html ortho view of the slices. Uses
``nilearn.plotting`` to generate the figures.
The generated view can either be opened interactively or saved as a figure
per ``nilearn`` functionality:
per ``nilearn.plotting`` functionality:
* Interactive view - ``view.open_in_browser()``
* Save - ``view.save_as_html(file_name.html)``
Expand All @@ -108,7 +108,6 @@ def plot_ortho(
opacity:
Opacity value [0 - transparent, 1 - opaque] of overlaid AFIDs
(default: 0.8)
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/api/transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
```{eval-rst}
.. automodule:: afids_utils.transforms
:members:
```
```
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"nibabel": ("https://nipy.org/nibabel", None),
"nilearn": ("https://nilearn.github.io/stable/plotting", None),
"numpy": ("https://numpy.org/doc/1.24", None),
"plotly": ("https://plotly.com/python", None),
}


Expand Down

0 comments on commit 3b0965c

Please sign in to comment.