ImperialCollegeLondon / safedata_validator

Python tools to validate and publish datasets using the safedata metadata format.
https://safedata-validator.readthedocs.io/
MIT License
2 stars 4 forks source link

Feature/ncbi taxa tree #17

Closed jacobcook1995 closed 2 years ago

jacobcook1995 commented 2 years ago

The taxa tree builder for NCBI is basically functional. There's still some loose ends to tie up so there will be further commits to this pull request. The taxonomic coverage text is designed to be backwards compatible, so that when a dataset with only GBIF taxon is provided the same text is provided as on the old pre NCBI version.

jacobcook1995 commented 2 years ago

I fixed about 20 mypy errors by changing https://github.com/ImperialCollegeLondon/safedata_validator/blob/629fccb99bda005f92fd037f25f42909322bf4db/safedata_validator/zenodo.py#L611 to https://github.com/ImperialCollegeLondon/safedata_validator/blob/507cc595976bc19c59892a1aff7759d37c345d49/safedata_validator/zenodo.py#L612 Current is now accessed by https://github.com/ImperialCollegeLondon/safedata_validator/blob/507cc595976bc19c59892a1aff7759d37c345d49/safedata_validator/zenodo.py#L617 rather than https://github.com/ImperialCollegeLondon/safedata_validator/blob/629fccb99bda005f92fd037f25f42909322bf4db/safedata_validator/zenodo.py#L616

So it's slightly less elegant but mypy now knows that current is a dict rather than a list of dicts. We could do away with "current" and "next" entirely, but I thought that would harm code comprehension. Anyway let me know what you think