Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge in CF 1.8 implementation (#892)
* add bio_taxa CDL example * Adds handling for taxon names and identifiers Adds support for CF 1.8 Section 6.1.2: Taxon Names and Identifiers Fetches LSID for appropriate "biological_taxon_lsid" from http://www.lsid.info after some basic validation. If the LSID refers to a WoRMS or ITIS database entry, validates against those databases, otherwise skips validation for other data sources. * Adds tests for well-formed WoRMS data Adds unit tests for well-formed WoRMS data by mocking the HTTP response. Updates test requirements file due to mocked requests. * Handle unset standard_name, fix standard_name search Properly handle no standard name when attempting to look for taxonomy related variables. Changes "biological_taxon_identifier" to "biological_taxon_lsid" for purposes of excluding coordinate variables for taxonomy. The former term was not a valid CF standard name. * Add skip condition, tests for nodata/fillvalue LSID variable * Add passing example for ITIS.gov TSN data sources * Remove unused import, comments, and fix typos * Add tests for ITIS failure case from non-matching taxon name vs TSN reference * Remove pyworms dependency and refactor WoRMS calls * Remove bad import * Fix test netCDF file name/references * Revert "Fix test netCDF file name/references" This reverts commit 8ff9e92. * Add taxonomy_example.cdl to test data * Fix message append, message return, remove unused LSID class * Tests for invalid and malformed LSIDs * Fix status code handling, error message formatting * Add warnings import * test on py3k * fix typo * Add .coveragerc, coverage files added to .gitignore * Add coverage/codecov GitHub Action workflow * Add codecov to test requirements * pytest-cov to requirements * Set continue-on-error to true to pass along coverage to codecov * Update README to include codecov badge * re-enable flake8 * Apply black code formatting * Remove extraneous code * Undefined variable/function fixes * Use continue to avoid fall through if taxa not found * Remove dead variables and code sections * Fix util date test to use previously unused variable for testing * Add test for climatology invalid bounds size * Add simple test for IOOS 1.2 point featureType * Add Dataset import for type hint in cf/util.py * Fix tests for CF 1.8 * (Re?) add shapely to requirements * Fix various accident reverts to CF 1.8 tests * Add setitem/getitem methods to MockVariable * Fix messages/tests for polygon geometry * Unpin NetCDF version in GitHub Actions default test CI steps * Restore ncgen -4 call * Add pyrightconfig.json to .gitignore * Use ncgen -4 in resources.py for CDL generation in unit tests * Refactor to split CF version checks into separate modules Refactors CF checker classes to reside in separate modules for test coverage and organization purposes. Updates other modules such as tests to use these new module paths. `cf.py` is now used for importing the various versions of the checkers, whereas the versioned modules are not imported directly. Also created a new module `cf_base` to avoid circular import issues in `cf.py`. * Add CF 1.8 to supported standards in README.md table * Add CF 1.8 checker to setup.py * Fix unbound exception variables, index var Co-authored-by: Ben Hall <ben.hall@rpsgroup.com> Co-authored-by: Filipe Fernandes <ocefpaf@gmail.com>
- Loading branch information