From 70cc97d30f657dec3f31c9e1131c1e0176448875 Mon Sep 17 00:00:00 2001 From: "abiprakash007@gmail.com" Date: Mon, 26 Sep 2022 10:40:57 +1000 Subject: [PATCH] add ref to examples in fn docstrings --- src/nemseer/downloader.py | 6 +++++- src/nemseer/forecast_type/run_time_generators.py | 4 ++++ src/nemseer/nemseer.py | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/nemseer/downloader.py b/src/nemseer/downloader.py index 4ca9223..842d3fa 100644 --- a/src/nemseer/downloader.py +++ b/src/nemseer/downloader.py @@ -220,6 +220,8 @@ def get_sqlloader_forecast_tables( - Removes numbering from enumerated tables for `P5MIN` - e.g. `CONSTRAINTSOLUTION(x)` are all reduced to `CONSTRAINTSOLUTION` + Examples: + See :ref:`querying table availability ` Args: year: Year month: Month @@ -248,7 +250,9 @@ def get_sqlloader_forecast_tables( def get_sqlloader_years_and_months() -> Dict[int, List[int]]: """Years and months with data on NEMWeb MMSDM Historical Data SQLLoader - + Examples: + See :ref:`querying date ranges \ + ` Returns: Months mapped to each year. Data is available for each of these months. """ diff --git a/src/nemseer/forecast_type/run_time_generators.py b/src/nemseer/forecast_type/run_time_generators.py index 05b29f2..2dd943a 100644 --- a/src/nemseer/forecast_type/run_time_generators.py +++ b/src/nemseer/forecast_type/run_time_generators.py @@ -198,6 +198,10 @@ def generate_runtimes( may not be accurate for all :term:`forecast types`, e.g. :term:`MTPASA` which is not run at a set time. + Examples: + See :ref:`getting valid run times for a set of forecasted time \ + `. + Args: forecasted_start: Forecasts pertaining to times at or after this datetime are retained. diff --git a/src/nemseer/nemseer.py b/src/nemseer/nemseer.py index 18ba486..cbd8550 100644 --- a/src/nemseer/nemseer.py +++ b/src/nemseer/nemseer.py @@ -42,6 +42,9 @@ def download_raw_data( 1. :attr:`run_start` and :attr:`run_end` 2. :attr:`forecasted_start` and :attr:`forecasted_end` + Examples: + See :ref:`downloading raw data examples `. + Arguments: forecast_type: One of :data:`nemseer.forecast_types` tables: Table or tables required. A single table can be supplied as @@ -135,7 +138,7 @@ def compile_data( For each queried table, this function: 1. If required, downloads raw forecast data for the table and converts to the - requested data structure. + requested data structure. 2. Otherwise, compiles table data from either of or both of the caches. 3. Applies user-requested filtering to :term:`run times` and :term:`forecasted times` to any raw data. @@ -144,6 +147,9 @@ def compile_data( If :attr:`data_format` = "df" (default), a :class:`pandas.DataFrame` is returned. Otherwise, if :attr:`data_format` = "xr", a :class:`xarray.Dataset` is returned. + Examples: + See :ref:`compiling data examples `. + Arguments: run_start: Forecast runs at or after this datetime are queried. run_end: Forecast runs before or at this datetime are queried.