LinkedEarth / pylipd

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

`filter_by_archive_type` doesn't take the exact value #46

Closed khider closed 1 year ago

khider commented 1 year ago

To reproduce:

from pylipd.utils.dataset import load_dir
 lipd = load_dir()
 Lfiltered = lipd.filter_by_archive_type('marine_sediment')
 Lfiltered.get_all_dataset_names()

Returns no entry but

from pylipd.utils.dataset import load_dir
 lipd = load_dir()
 Lfiltered = lipd.filter_by_archive_type('marine')
 Lfiltered.get_all_dataset_names()

Returns 2.

'marine_sediment' is valid according to

lipd.get_all_archiveTypes()
varunratnakar commented 1 year ago

Issue was with doing a "sanitizeId" on the archiveType as well which was convering "marine sediment" to "marine_sediment".

varunratnakar commented 1 year ago

Fixed in https://github.com/LinkedEarth/pylipd/commit/4ee21e017d393e06abcf1c86158a778293fb46a9