-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctness checks for parse_access_ncfile (#232)
* - Added some optional test dependencies to pyproject.toml to make runnings tests easier - Added tests to make sure taht we are parsing netCDF files as expected using intake-esm by comparing against a dataset read in directly with xarray (with same additional logic intake-esm uses) - All tests passing when coordinate variable discovery enabled - test_parsed_ncfile_values_0 failing when coordinate discovery disabled * Remove redundant breakpoint * Condensed duplicate tests * * Added tox config to test migration to 2.0.7 * Added dynamic xfail setting - necessary to ensure that we are correctly determining whether tests should pass or fail based on whether we are using latest intake-esm release or ACCESS-NRI modified version with coord variable detection. Uses a pytest_collection_modifyitems function to create xfails for tests which should fail Merge 226 editable install (#228) * Updated the way that the location of the catalog.yaml file is discovered to work in both editable & regular installations * Changed ci.yml to run tests in a default, rathe than editable installation * Updated pyproject.toml & .github/workflows/ci.yl to ensure correct coverage issues running tests using regular installation rather than editable * Added explicit test for metadata_template - must have previously been implicitly run * Changed ox.environ.get('XFAILS', default) from default='' to default=0 to fix integer conversion error if environment variables not specified. * - Final tox.ini set up, with as sensible factoring as possible - Relaxed intake version on pyproject.toml to >0.7 - Updated conftest to emit a warning if coordinate discovery is disabled (ie. wrong intake-esm version) and no environment variable is set to inform pytest this is the case * Removed some unnecessary dependencies from .[test], updated warning call in conftest to use keyword arguments rather than positional, updated comments in test_parse_access_ncfile to be more descriptive * Added python3.9 to tox.ini * Removed python3.9 again (not supported by intake-esm) * Repinned intake to 0.7.0 * Changes xfails explanation to be more terse * Made _get_xfail() docstr clearer * Intake Take2 (#233) * Rebased 153 onto 187 * gelaxed intake version on pyproject.toml to >0.7 (take2) & added tox environments for take2
- Loading branch information
1 parent
f0c9b34
commit 77538ef
Showing
4 changed files
with
234 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
[tox] | ||
env_list = | ||
py{310,311}-main, | ||
py{310,311}-coords, | ||
py{310,311}-take2, | ||
py{310,311}-take2coords | ||
|
||
minversion = 4.23.0 | ||
|
||
[testenv] | ||
description = Run the tests with pytest | ||
package = wheel | ||
wheel_build_env = .pkg | ||
deps = | ||
pytest | ||
.[test] | ||
commands = | ||
pytest \ | ||
-W ignore::UserWarning \ | ||
; Unable to parse $N assets | ||
; Frequency derived from filename does not match frequency determined from file contents | ||
-W ignore::DeprecationWarning \ | ||
; PydanticDeprecatedSince20 Warning | ||
-W ignore::RuntimeWarning \ | ||
; Numpy ABI mismatch warning | ||
{tty:--color=yes} {posargs:tests} | ||
|
||
[testenv:coordsdisabled] | ||
setenv = | ||
XFAILS=1 | ||
; We expect correctness checks to fail here because coordinate discovery isn't | ||
; enabled in the main branch of intake-esm. This toggles on xfail marks in | ||
; conftest.py. | ||
|
||
[testenv:coordsenabled] | ||
setenv = | ||
XFAILS=0 | ||
; We expect correctness checks to pass here because coordinate discovery is | ||
; enabled in the main branch of intake-esm. This disables xfail marks in conftest.py. | ||
|
||
[testenv:base-main] | ||
description = Pin the intake version to 0.7.0, run pytest | ||
deps = | ||
{[testenv]deps} | ||
git+https://github.com/ACCESS-NRI/intake-dataframe-catalog.git@main#egg=intake_dataframe_catalog | ||
intake==0.7.0 | ||
|
||
|
||
[testenv:base-coords] | ||
description = Use the ACCESS-NRI fork of intake-esm, branch issue_660-coords | ||
deps = | ||
{[testenv]deps} | ||
git+https://github.com/ACCESS-NRI/intake-esm.git@issue_660-coords#egg=intake-esm | ||
git+https://github.com/ACCESS-NRI/intake-dataframe-catalog.git@main#egg=intake_dataframe_catalog | ||
intake==0.7.0 | ||
|
||
[testenv:base-take2] | ||
description = Pin the intake version to 0.7.0, run pytest | ||
deps = | ||
{[testenv]deps} | ||
git+https://github.com/ACCESS-NRI/intake-dataframe-catalog.git@take2#egg=intake_dataframe_catalog | ||
intake>=2.0.0 | ||
|
||
|
||
[testenv:base-take2coords] | ||
description = Use the ACCESS-NRI fork of intake-esm, branch issue_660-coords | ||
deps = | ||
{[testenv]deps} | ||
git+https://github.com/ACCESS-NRI/intake-esm.git@take2-coords#egg=intake-esm | ||
git+https://github.com/ACCESS-NRI/intake-dataframe-catalog.git@take2#egg=intake_dataframe_catalog | ||
intake>=2.0.0 | ||
|
||
[testenv:py39-main] | ||
basepython = python3.9 | ||
deps = {[testenv:base-main]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py310-main] | ||
basepython = python3.10 | ||
deps = {[testenv:base-main]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py311-main] | ||
basepython = python3.11 | ||
deps = {[testenv:base-main]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py39-coords] | ||
basepython = python3.9 | ||
deps = {[testenv:base-coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py310-coords] | ||
basepython = python3.10 | ||
deps = {[testenv:base-coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py311-coords] | ||
basepython = python3.11 | ||
deps = {[testenv:base-coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py39-take2] | ||
basepython = python3.9 | ||
deps = {[testenv:base-take2]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py310-take2] | ||
basepython = python3.10 | ||
deps = {[testenv:base-take2]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py311-take2] | ||
basepython = python3.11 | ||
deps = {[testenv:base-take2]deps} | ||
setenv = {[testenv:coordsdisabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py39-take2coords] | ||
basepython = python3.9 | ||
deps = {[testenv:base-take2coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py310-take2coords] | ||
basepython = python3.10 | ||
deps = {[testenv:base-take2coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} | ||
|
||
[testenv:py311-take2coords] | ||
basepython = python3.11 | ||
deps = {[testenv:base-take2coords]deps} | ||
setenv = {[testenv:coordsenabled]setenv} | ||
commands = {[testenv]commands} |