diff --git a/docs/images/concept.png b/docs/_static/concept.png similarity index 100% rename from docs/images/concept.png rename to docs/_static/concept.png diff --git a/docs/images/forest_mask_bolivia.png b/docs/_static/forest_mask_bolivia.png similarity index 100% rename from docs/images/forest_mask_bolivia.png rename to docs/_static/forest_mask_bolivia.png diff --git a/docs/images/iqr_results_bolivia.png b/docs/_static/iqr_results_bolivia.png similarity index 100% rename from docs/images/iqr_results_bolivia.png rename to docs/_static/iqr_results_bolivia.png diff --git a/docs/images/logo.png b/docs/_static/logo.png similarity index 100% rename from docs/images/logo.png rename to docs/_static/logo.png diff --git a/docs/api_reference.rst b/docs/api_reference.rst index d1e666a..9bbadea 100644 --- a/docs/api_reference.rst +++ b/docs/api_reference.rst @@ -112,4 +112,5 @@ Module contents :members: :undoc-members: :show-inheritance: + :noindex: diff --git a/docs/classes.rst b/docs/classes.rst index d8cf2ab..430d823 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -20,7 +20,7 @@ disturbances. .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN -.. figure:: images/concept.png +.. figure:: _static/concept.png |copy| Copyright European Union, 2022; Jonas Viehweger diff --git a/docs/conf.py b/docs/conf.py index 581dcec..b8950a6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,7 +58,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ['gallery/README.rst'] # -- Options for HTML output ------------------------------------------------- @@ -71,8 +71,8 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['images'] -html_logo = "images/logo.png" +html_static_path = ['_static'] +html_logo = "_static/logo.png" html_theme_options = { 'logo_only': True, 'display_version': False, diff --git a/docs/gallery/dontplot_bolivia_stac.py b/docs/gallery/dontplot_bolivia_stac.py index 5d54a50..15bb2cf 100644 --- a/docs/gallery/dontplot_bolivia_stac.py +++ b/docs/gallery/dontplot_bolivia_stac.py @@ -27,7 +27,7 @@ - Generate a simple rule-based forest mask - Simulate a near real-time monitoring scenario """ -# sphinx_gallery_thumbnail_path = 'images/iqr_results_bolivia.png' +# sphinx_gallery_thumbnail_path = '_static/iqr_results_bolivia.png' ############################################# # Define the study area @@ -262,7 +262,7 @@ ax.set_yticks([]) ############################################################################### -# .. image:: ../../_static/forest_mask_bolivia.png +# .. image:: ../_static/forest_mask_bolivia.png ############################################################################### # Monitoring simulation @@ -316,7 +316,7 @@ ax.set_yticks([]) ############################################################################### -# .. image:: ../../_static/iqr_results_bolivia.png +# .. image:: ../_static/iqr_results_bolivia.png # # The resulting mask reveals clear signs of agricultural expansion in the # east and south-west of the study area, as well as more subtle traces of diff --git a/nrt/monitor/__init__.py b/nrt/monitor/__init__.py index 8636e01..a48db82 100644 --- a/nrt/monitor/__init__.py +++ b/nrt/monitor/__init__.py @@ -44,12 +44,14 @@ class and must implement the abstract methods ``fit()``, ``monitor()`` mask (numpy.ndarray): A 2D numpy array containing pixels that should be monitored (1) and not (0). The mask may be updated following historing period stability check, and after a call to monitor - following a confirmed break. Values are as follow. - ``{0: 'Not monitored', - 1: 'monitored', - 2: 'Unstable history', - 3: 'Confirmed break - no longer monitored', - 4: 'Not enough observations - not monitored'}`` + following a confirmed break. Values are as follow:: + + {0: 'Not monitored', + 1: 'monitored', + 2: 'Unstable history', + 3: 'Confirmed break - no longer monitored', + 4: 'Not enough observations - not monitored'} + trend (bool): Indicate whether stable period fit is performed with trend or not harmonic_order (int): The harmonic order of the time-series regression @@ -66,7 +68,7 @@ class and must implement the abstract methods ``fit()``, ``monitor()`` when using stable fitting algorithms update_mask (bool): Specifies whether to update the mask and halt further monitoring when values exceed boundary limits during a - `.monitor()` call. A ``True`` value indicates that crossing the + ``.monitor()`` call. A ``True`` value indicates that crossing the boundary limits will trigger a mask update and stop successive observation monitoring. @@ -81,7 +83,7 @@ class and must implement the abstract methods ``fit()``, ``monitor()`` harmonic_order (int): The harmonic order of the time-series regression save_fit_start (bool): If start of the fit should be reported in the model. Only applicable to stable fits (e.g. 'ROC', 'CCDC-stable'). - If true, the data will be saved in the attribute `fit_start` + If true, the data will be saved in the attribute ``fit_start`` x_coords (numpy.ndarray): x coordinates y_coords (numpy.ndarray): y coordinates process (numpy.ndarray): 2D numpy array containing the @@ -95,7 +97,7 @@ class and must implement the abstract methods ``fit()``, ``monitor()`` when using stable fitting algorithms update_mask (bool): Specifies whether to update the mask and halt further monitoring when values exceed boundary limits during a - `.monitor()` call. A ``True`` value (default) indicates that + ``.monitor()`` call. A ``True`` value (default) indicates that crossing the boundary limits will trigger a mask update and stop successive observation monitoring. """ @@ -329,9 +331,9 @@ def _report(self, layers, dtype): the report. Valid options are ``'mask'`` (the main output layer containing confirmed breaks, non-monitored pixels, etc), ``'detection_date'`` (an integer value matching each confirmed break and indicating the date - the break was confirmed in days since epoch), ``'process'`` (the process - value). The process value has a different meaning and interpretation - for each monitoring method. + the break was confirmed in days since epoch), ``'process'`` (the process + value). The process value has a different meaning and interpretation + for each monitoring method. dtype (type): The datatype of the stacked layers. Note that when returning process value for MoSum, CuSum or EWMA the ``dtype`` should be set to a float type to retain values @@ -356,9 +358,9 @@ def report(self, filename, layers=['mask', 'detection_date'], the report. Valid options are ``'mask'`` (the main output layer containing confirmed breaks, non-monitored pixels, etc), ``'detection_date'`` (an integer value matching each confirmed break and indicating the date - the break was confirmed in days since epoch), ``'process'`` (the process - value). The process value has a different meaning and interpretation - for each monitoring method. + the break was confirmed in days since epoch), ``'process'`` (the process + value). The process value has a different meaning and interpretation + for each monitoring method. dtype (type): The datatype of the stacked layers. Note that when returning process value for MoSum, CuSum or EWMA the ``dtype`` should be set to a float type to retain values diff --git a/nrt/utils_efp.py b/nrt/utils_efp.py index 3453474..59e5822 100644 --- a/nrt/utils_efp.py +++ b/nrt/utils_efp.py @@ -81,11 +81,11 @@ def history_roc(X, y, alpha=0.05, crit=0.9478982340418134): crit (float): Critical value corresponding to the chosen alpha. Can be calculated with ``_cusum_rec_test_crit``. Default is the value for alpha=0.05 - Returns: - (int) Index of structural change in y. - 0: y completely stable - >0: y stable after this index + Returns: + int: Index of structural change in y. + ``0`` - y completely stable + ``>0`` - y stable after this index """ # Index, where instability in time-series is detected # 0: time-series completely stable