From 980b49a65f857b6303f641bdd05732c5ce9adc3d Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:56:53 +0200 Subject: [PATCH] docs: Fix typos --- src/aerovaldb/aerovaldb.py | 64 ++++++++++++++++++++------------------ src/aerovaldb/plugins.py | 20 +++++++----- src/aerovaldb/types.py | 3 ++ 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/src/aerovaldb/aerovaldb.py b/src/aerovaldb/aerovaldb.py index 2527697..b677036 100644 --- a/src/aerovaldb/aerovaldb.py +++ b/src/aerovaldb/aerovaldb.py @@ -133,7 +133,7 @@ async def get_glob_stats( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -193,7 +193,7 @@ async def get_heatmap( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -253,9 +253,9 @@ async def get_contour( :param access_type: How the data is to be retrieved (See AccessType for details) :param cache: Whether to use cache for this read. :param default: Default value that will be returned instead of raising FileNotFoundError - if not data was found (Will be returned as is and not converted to match access_type). + if no data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -311,9 +311,9 @@ async def get_timeseries( :param access_type: How the data is to be retrieved (See AccessType for details) :param cache: Whether to use cache for this read. :param default: Default value that will be returned instead of raising FileNotFoundError - if not data was found (Will be returned as is and not converted to match access_type). + if no data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -391,7 +391,7 @@ async def get_timeseries_weekly( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -443,7 +443,7 @@ async def get_experiments( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -492,7 +492,7 @@ async def get_config( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -531,7 +531,7 @@ async def get_menu( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -569,7 +569,7 @@ async def get_statistics( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -609,7 +609,7 @@ async def get_ranges( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -647,7 +647,7 @@ async def get_regions( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -685,7 +685,7 @@ async def get_models_style( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -737,7 +737,7 @@ async def get_map( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -824,7 +824,7 @@ async def get_scatter( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -888,7 +888,7 @@ async def get_profiles( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -948,7 +948,7 @@ async def get_heatmap_timeseries( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -1010,7 +1010,7 @@ async def get_forecast( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -1068,7 +1068,7 @@ async def get_gridded_map( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -1120,7 +1120,7 @@ async def get_report( :param default: Default value that will be returned instead of raising FileNotFoundError if not data was found (Will be returned as is and not converted to match access_type). - :returns The fetched data. + :returns : The fetched data. """ raise NotImplementedError @@ -1158,9 +1158,11 @@ async def get_by_uri( Note: ----- - URI is intended to be consistent between implementations. Using get_by_uri() + URI is intended to be consistent between implementations but not between + versions of aerovaldb. Using :meth:`aerovaldb.AerovalDB.get_by_uri` to fetch an identifier which can then be written to another connector using - its respective put_by_uri() method. + its respective :meth:`aerovaldb.AerovalDB.put_by_uri` method is a supported + use case. """ raise NotImplementedError @@ -1174,9 +1176,11 @@ async def put_by_uri(self, obj, uri: str): Note: ----- - URI is intended to be consistent between implementations. Using get_by_uri() + URI is intended to be consistent between implementations but not between + versions of aerovaldb. Using :meth:`aerovaldb.AerovalDB.get_by_uri` to fetch an identifier which can then be written to another connector using - its respective put_by_uri() method. + its respective :meth:`aerovaldb.AerovalDB.put_by_uri` method is a supported + use case. """ raise NotImplementedError @@ -1185,7 +1189,7 @@ def lock(self): between instances of aerovaldb. Intended to be used as a context manager. - See also: https://aerovaldb.readthedocs.io/en/latest/locking.html + See also: `Locking `_ """ raise NotImplementedError @@ -1217,12 +1221,10 @@ def _normalize_access_type( @async_and_sync async def list_all(self, access_type: str | AccessType = AccessType.URI): - """Iterator to list over the URI of each object - stored in the current aerovaldb connection, returning - the URI of each. + """Returns a list of identifiers for each object stored in the database - :param access_type : What to return (This is implementation specific, but in general - each implementation should support URI). + :param access_type : What to return (This is implementation specific, but + in general each implementation should support URI, some may support FILE_PATH). :raises : UnsupportedOperation For non-supported acces types. """ diff --git a/src/aerovaldb/plugins.py b/src/aerovaldb/plugins.py index e1ca368..9aeeebe 100644 --- a/src/aerovaldb/plugins.py +++ b/src/aerovaldb/plugins.py @@ -49,14 +49,18 @@ def open(resource, /, use_async: bool = False) -> AerovalDB: """open an AerovalDB directly, sending args and kwargs directly to the `AervoalDB()` function - :param resource: the resource-name for the database. The resource can be - - 'entrypoint:path', with path being the location where the database should be generated - (eg. 'json_files:.') - - 'path', with path containing either an aerovaldb.cfg (Not yet implemented) configuration - or path being a json_files dabasase (for example, '.' is equivalent to 'json_files:.') - :param use_async : If true, aiofile will be used to read files, otherwise files will be read - synchronously. - :return: an implementation-object of AerovalDB openend to a location + :param resource: the resource-identifier for the database. The resource can be + - 'entrypoint:path', with entrypoint being the type of database connection + (eg. 'json_files' or 'sqlitedb') being the location where the database is + located (eg. 'json_files:.') + - 'path', a path to a json_files folder or sqlite file. + - ':memory:' an sqlite in-memory database. Contents are not persistently + stored! + + :param use_async : If true, aiofile will be used to read files, otherwise + files will be read synchronously (Currently only used by json_files). + :return : an implementation-object of AerovalDB openend and initialized to a + location. """ if resource == ":memory:": # Special case for sqlite in memory database. diff --git a/src/aerovaldb/types.py b/src/aerovaldb/types.py index 3147bb7..62264a5 100644 --- a/src/aerovaldb/types.py +++ b/src/aerovaldb/types.py @@ -6,9 +6,12 @@ class AccessType(Enum): and returned. JSON_STR: Result will be returned as an unparsed json string. + FILE_PATH: Result will be returned as the file path to the file containing the data. + OBJ: The json will be parsed and returned as a python object. + URI: A string which is a unique identifier of this asset between implementations of Aerovaldb. Can be used with `get_by_uuid()` and `put_by_uuid()` to read or write respectively.