-
Notifications
You must be signed in to change notification settings - Fork 122
Description
- The docstring for
search_data
includes undocumented parametercloud_hosted
in its example. downloadable
parameter is not documented.- I think there are others, but I don't have time to be exhaustive at the moment :)
Currently, kwargs
are passed from search_data
to a DataGranules
object's parameters
method, which also accepts kwargs
. The possible keys are fixed by the methods on DataGranules
, and populated dynamically by matching keys to method names.
earthaccess/earthaccess/api.py
Lines 116 to 119 in ff0c59a
if earthaccess.__auth__.authenticated: | |
query = DataGranules(earthaccess.__auth__).parameters(**kwargs) | |
else: | |
query = DataGranules().parameters(**kwargs) |
The same technique is used for both data & dataset search functions.
However, the interface is untyped and the documentation is generated from a hand-maintained docstring. I feel we should move towards fully typing the interface and generating the docs from the annotations. Python's type system feels like a toy at times like this. How do we ensure that a DataGranules
method exists for each parameter on the search_data
interface? Maybe we should instead collect the parameter methods in a dict? Just thinking out loud.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status