Skip to content

Commit eee85ed

Browse files
committed
add hidden directive to feature detection
1 parent 453a2d7 commit eee85ed

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

doc/conf.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,33 @@
9292
collapse_navigation = False
9393

9494

95+
def skip_member_check(app, what, name, obj, skip, options):
96+
"""Function to skip members (autodoc-skip-member)
97+
98+
Parameters
99+
----------
100+
app
101+
what
102+
name
103+
obj
104+
skip
105+
options
106+
107+
Returns
108+
-------
109+
110+
"""
111+
if hasattr(obj, "__doc__") and obj.__doc__ and ":hidden:" in obj.__doc__:
112+
return True
113+
114+
return skip
115+
116+
95117
# Include our custom CSS (currently for special table config)
96118
def setup(app):
97119
app.add_css_file("theme_overrides.css")
98120
app.add_css_file("custom.css")
121+
app.connect("autodoc-skip-member", skip_member_check)
99122

100123

101124
# This should include all modules used in tobac. These are dummy imports,
@@ -118,6 +141,14 @@ def setup(app):
118141
"cftime",
119142
]
120143

144+
autodoc_default_options = {
145+
"members": True,
146+
"undoc-members": True,
147+
"show-inheritance": True,
148+
"ignore-module-all": False,
149+
"private-members": False,
150+
}
151+
121152
sys.path.insert(0, os.path.abspath("../"))
122153

123154
pygments_style = "sphinx"

tobac/feature_detection.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
from tobac.utils import decorators
3636

3737
from tobac.utils import periodic_boundaries as pbc_utils
38-
from tobac.utils.general import spectral_filtering
39-
from tobac.utils import get_statistics
38+
import tobac.utils
39+
import tobac.utils.general
4040
import warnings
4141

4242
# from typing_extensions import Literal
@@ -64,7 +64,9 @@ def feature_position(
6464
) -> tuple[float]:
6565
"""Determine feature position with regard to the horizontal
6666
dimensions in pixels from the identified region above
67-
threshold values
67+
threshold values.
68+
69+
:hidden:
6870
6971
Parameters
7072
----------
@@ -152,7 +154,8 @@ def feature_position(
152154
lies exactly between hdim1_max and hdim1_min, the output could be
153155
between hdim1_max and hdim1_max+1. While a value between hdim1_min-1
154156
and hdim1_min would also be valid, we choose to overflow on the max side of things.
155-
157+
Notes
158+
-----
156159
"""
157160

158161
# First, if necessary, run PBC processing.
@@ -260,6 +263,8 @@ def test_overlap(
260263
) -> bool:
261264
"""Test for overlap between two regions
262265
266+
:hidden:
267+
263268
Parameters
264269
----------
265270
region_1 : list
@@ -292,6 +297,8 @@ def remove_parents(
292297
Remove features where its regions surround newly
293298
detected feature regions.
294299
300+
:hidden:
301+
295302
Parameters
296303
----------
297304
features_thresholds : pandas.DataFrame
@@ -406,6 +413,8 @@ def feature_detection_threshold(
406413
) -> tuple[pd.DataFrame, dict]:
407414
"""Find features based on individual threshold value.
408415
416+
:hidden:
417+
409418
Parameters
410419
----------
411420
data_i : np.array
@@ -925,6 +934,8 @@ def feature_detection_multithreshold_timestep(
925934
thresholds. Smoothing the input data with the Gaussian filter makes
926935
output less sensitive to noisiness of input data.
927936
937+
:hidden:
938+
928939
Parameters
929940
----------
930941
@@ -1027,7 +1038,7 @@ def feature_detection_multithreshold_timestep(
10271038

10281039
# spectrally filter the input data, if desired
10291040
if wavelength_filtering is not None:
1030-
track_data = spectral_filtering(
1041+
track_data = tobac.utils.general.spectral_filtering(
10311042
dxy, track_data, wavelength_filtering[0], wavelength_filtering[1]
10321043
)
10331044

@@ -1144,7 +1155,7 @@ def feature_detection_multithreshold_timestep(
11441155
# select which data to use according to statistics_unsmoothed option
11451156
stats_data = data_i.values if statistics_unsmoothed else track_data
11461157

1147-
features_thresholds = get_statistics(
1158+
features_thresholds = tobac.utils.get_statistics(
11481159
features_thresholds,
11491160
labels,
11501161
stats_data,
@@ -1188,6 +1199,7 @@ def feature_detection_multithreshold(
11881199
11891200
The regions are above/below a threshold.
11901201
1202+
11911203
Parameters
11921204
----------
11931205
field_in : iris.cube.Cube or xarray.DataArray
@@ -1490,6 +1502,9 @@ def filter_min_distance(
14901502
If two features are closer than `min_distance`, it keeps the
14911503
larger feature.
14921504
1505+
:hidden:
1506+
1507+
14931508
Parameters
14941509
----------
14951510
features: pandas DataFrame

0 commit comments

Comments
 (0)