LinkedEarth / pylipd

Development repository for Python LiPD utilities
https://pylipd.readthedocs.io/en/latest/
Apache License 2.0
2 stars 0 forks source link

Grouping all the `get_all_` functions into one call with a field. #39

Closed khider closed 1 year ago

khider commented 1 year ago

@CommonClimate suggested grouping the get_all functions into one wrapper with a field parameter.

Example: D.get_all(field='datasetName') or D.get_all(field='archiveType')

We should have a curated list of possible fields (name as they appear below):

We could keep the functions that we have already written get_all_datasetnames and make them private to reuse in the wrapper. Or since these are two lines of functions, have them in the wrapper (might be easier to do so in a dictionary and match the field with its query).

@varunratnakar what do you think?

Also should this also be the case for the filter functions series.filter(field='')?

khider commented 1 year ago

Since there won't be that many and the queries will be somewhat unique, let's keep them as separate. Makes it easier than trying to figure out which fields need to be queried from. Keeping this issue open to keep tack of progress.

khider commented 1 year ago

Done in https://github.com/LinkedEarth/pylipd/commit/09ff08e7d879584886f1f030ff13e49f281e250b