Skip to content
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

Making Filter-docs nicer #70

Merged
merged 11 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ pyaro.timeseries - User API
pyaro.timeseries.filters - Filters
^^^^^^^^^^^^

.. automodule:: pyaro.timeseries.Filter
:members: FilterFactory, FilterCollection
:undoc-members:
:imported-members:
:show-inheritance:

.. image:: pics/Filter.svg
:alt: Filter UML diagram

.. automodule:: pyaro.timeseries.Filter
:members: FilterFactory, FilterCollections, Filter, StationFilter, VariableNameFilter, CountryFilter, BoundingBoxFilter, DuplicateFilter, FlagFilter, TimeBoundsFilter, TimeResolutionFilter, TimeVariableStationFilter, AltitudeFilter, RelativeAltitudeFilter, ValleyFloorRelativeAltitudeFilter
:members: StationFilter, VariableNameFilter, CountryFilter, BoundingBoxFilter, DuplicateFilter, FlagFilter, TimeBoundsFilter, TimeResolutionFilter, TimeVariableStationFilter, AltitudeFilter, RelativeAltitudeFilter, ValleyFloorRelativeAltitudeFilter
:undoc-members:
:imported-members:
:show-inheritance:


pyaro.timeseries - Dev API
Expand All @@ -55,9 +62,10 @@ pyaro.timeseries - Dev API
:private-members:

.. automodule:: pyaro.timeseries.Filter
:members: DataIndexFilter
:members: Filter, DataIndexFilter
:undoc-members:
:imported-members:
:show-inheritance:


csvreader for timeseries
Expand Down
Binary file added docs/pics/Filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/pics/Filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 41 additions & 8 deletions docs/puml/Filter.puml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface timeseries.Filter {
}

class timeseries.VariableNameFilter {
+ __init__(reader_to_new, include, exclude): VariableNameChangingFilter
+ __init__(reader_to_new, include, exclude)
+ name(): "variables"
+ init_kwargs(): dict
+ filter_variables(variables): [str]
Expand All @@ -48,31 +48,31 @@ abstract class timeseries.StationReductionFilter {
}

class timeseries.StationFilter {
+ __init__(include=[station], exclude=[station]): StationFilter
+ __init__(include=[station], exclude=[station])
+ name(): "stations"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
has_station(station): bool
}

class timeseries.CountryFilter {
+ __init__(include=[country], exclude=[country]): CountryFilter
+ __init__(include=[country], exclude=[country])
+ name(): "countries"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
has_country(iso2_str): bool
}

class timeseries.BoundingBoxFilter {
+ __init__(include=[country], exclude=[country]): BoundingBoxFilter
+ __init__(include=[country], exclude=[country])
+ name(): "bounding_boxes"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
has_location(lat, lon): bool
}

class timeseries.TimeBoundsFilter {
+ __init__(start_include=[flag], start_exclude=[flag],\n start_end_include, startend_exclude,\n end_include, end_exclude): TimeBoundsFilter
+ __init__(start_include=[flag], start_exclude=[flag],\n start_end_include, startend_exclude,\n end_include, end_exclude)
+ name(): "time_bounds"
+ init_kwargs(): dict
+ filter_data_idx(data, stations, variables): Data
Expand All @@ -81,37 +81,70 @@ class timeseries.TimeBoundsFilter {
contains(start_dt_array, end_dt_array): bool-array
}

class timeseries.TimeVariableStationFilter {
+ __init__(exclude_from_csvfile="",\nexclude=[(start, end, variable, station)])
+ name(): "time_variable_station"
+ init_kwargs(): dict
+ filter_data_idx(data, stations, variables): Data
}

class timeseries.TimeResolutionFilter {
+ __init__(resolutions=[resolution_string]): TimeResolutionFilter
+ __init__(resolutions=[resolution_string])
+ name(): "time_resolutions"
+ init_kwargs(): dict
+ filter_data_idx(data, stations, variables): Data
}

class timeseries.DuplicateFilter {
+ __init__(duplicate_keys=["stations", "start_times", "end_times"]): DuplicateFilter
+ __init__(duplicate_keys=["stations",\n"start_times", "end_times"])
+ name(): "duplicates"
+ init_kwargs(): dict
+ filter_data_idx(data, stations, variables): Data
}

class timeseries.FlagFilter {
+ __init__(include=[flag], exclude=[flag]): FlagFilter
+ __init__(include=[flag], exclude=[flag])
+ name(): "flags"
+ init_kwargs(): dict
+ filter_data_idx(data, stations, variables): Data
usable_flags(): set(flags)
}

class timeseries.AltitudeFilter {
+ __init__(min_altitude, max_altitude)
+ name(): "altitude"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
}

class timeseries.RelativeAltitudeFilter {
+ __init__(topo_file, topo_var, rdiff)
+ name(): "relaltitude"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
}

class timeseries.ValleyFloorRelativeAltitudeFilter {
+ __init__(topo_file, radius,topo_var, lower, upper)
+ name(): "valleyfloor_relaltitude"
+ init_kwargs(): dict
+ filter_stations(stations): dict[str, Station]
}



timeseries.Filter <|.. timeseries.VariableNameFilter
timeseries.Filter <|.. timeseries.DataIndexFilter
timeseries.DataIndexFilter <|.. timeseries.StationReductionFilter
timeseries.StationReductionFilter <|.. timeseries.StationFilter
timeseries.StationReductionFilter <|.. timeseries.CountryFilter
timeseries.StationReductionFilter <|.. timeseries.BoundingBoxFilter
timeseries.StationReductionFilter <|.. timeseries.AltitudeFilter
timeseries.StationReductionFilter <|.. timeseries.RelativeAltitudeFilter
timeseries.StationReductionFilter <|.. timeseries.ValleyFloorRelativeAltitudeFilter
timeseries.DataIndexFilter <|.. timeseries.TimeBoundsFilter
timeseries.DataIndexFilter <|.. timeseries.TimeResolutionFilter
timeseries.DataIndexFilter <|.. timeseries.TimeVariableStationFilter
timeseries.DataIndexFilter <|.. timeseries.DuplicateFilter
timeseries.DataIndexFilter <|.. timeseries.FlagFilter

Expand Down
2 changes: 1 addition & 1 deletion src/pyaro/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def list_timeseries_engines() -> dict[str, TimeseriesEngine]:

Notes
-----
This function lives in the backends namespace (``engs=pyaro.list_timeseries_enginess()``).
This function lives in the backends namespace (``engs=pyaro.list_timeseries_engines()``).
More information about each reader is available via the TimeseriesEngine obj.url() and
obj.description()

Expand Down
4 changes: 2 additions & 2 deletions src/pyaro/timeseries/Filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ def __init__(
self._UNITS_METER = None

@property
def UNITS_METER(self):
def UNITS_METER(self): #: :meta hide-value:
heikoklein marked this conversation as resolved.
Show resolved Hide resolved
"""internal representation of units, don't use

:return: m-unit in internal representation
Expand All @@ -1020,7 +1020,7 @@ def UNITS_METER(self):
return self._UNITS_METER

@property
def topography(self):
def topography(self): #: :meta hide-value:
heikoklein marked this conversation as resolved.
Show resolved Hide resolved
"""Internal property, don't use.

:raises ModuleNotFoundError: _description_
Expand Down