diff --git a/.codecov.yml b/.codecov.yml index 0d76b9f5ada..c3c24e637d1 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,3 @@ -codecov: - notify: - require_ci_to_pass: no - coverage: status: patch: diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000000..af5e6896b29 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,10 @@ +[paths] +source = + src/ + /*/site-packages + +[run] +source = tests +source_pkgs = metpy +omit = + src/metpy/io/_nexrad_msgs/parse_spec.py diff --git a/.github/workflows/tests-conda.yml b/.github/workflows/tests-conda.yml index b83e80ebe6a..3d55e1638c2 100644 --- a/.github/workflows/tests-conda.yml +++ b/.github/workflows/tests-conda.yml @@ -85,9 +85,13 @@ jobs: python -m pip install --no-deps . - name: Run tests + # By running coverage in "parallel" mode and "combining", we can clean up the path names run: | export TEST_DATA_DIR=$GITHUB_WORKSPACE/staticdata - python -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning --cov=metpy --cov=tests --cov-report=xml + python -m coverage run -p -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning tests/ + python -m coverage combine + python -m coverage report + python -m coverage xml - name: Run doctests # Windows produces some slightly different types that causes doctests to fail @@ -105,3 +109,5 @@ jobs: - name: Upload coverage uses: codecov/codecov-action@v1 + with: + name: conda-${{ matrix.python-version }}-${{ runner.os }} diff --git a/.github/workflows/tests-pypi.yml b/.github/workflows/tests-pypi.yml index 7c73dc06079..567a420e56c 100644 --- a/.github/workflows/tests-pypi.yml +++ b/.github/workflows/tests-pypi.yml @@ -107,7 +107,10 @@ jobs: run: | export TEST_DATA_DIR=$GITHUB_WORKSPACE/staticdata export NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1 - python -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning --cov=metpy --cov=tests --cov-report=xml + python -m coverage run -p -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning tests/ + python -m coverage combine + python -m coverage report + python -m coverage xml - name: Run doctests if: ${{ matrix.dep-versions == 'Current.txt' && matrix.no-extras != 'No Extras' }} @@ -124,3 +127,5 @@ jobs: - name: Upload coverage uses: codecov/codecov-action@v1 + with: + name: pypi-${{ matrix.python-version }}-${{ matrix.dep-versions }}-${{ matrix.no-extras }}-${{ runner.os }} diff --git a/.travis.yml b/.travis.yml index 0b4f2173d07..09842197af3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,10 @@ script: false; fi; else - python -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning --cov=metpy --cov=tests; + python -m coverage run -p -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning tests/; + python -m coverage combine; + python -m coverage report; + python -m coverage xml; fi after_script: diff --git a/ci/test_requirements.txt b/ci/test_requirements.txt index b0f2715f8dc..74e43b0a005 100644 --- a/ci/test_requirements.txt +++ b/ci/test_requirements.txt @@ -1,4 +1,4 @@ pytest==6.1.0 -pytest-cov==2.10.1 pytest-mpl==0.11 netCDF4==1.5.4 +coverage==5.3 diff --git a/setup.cfg b/setup.cfg index 8ebfa9a41f0..ecdec2cf20d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -96,9 +96,6 @@ norecursedirs = build docs .idea doctest_optionflags = NORMALIZE_WHITESPACE mpl-results-path = test_output -[coverage:run] -omit = src/metpy/io/_nexrad_msgs/parse_spec.py,src/metpy/io/metar_parser.py - [doc8] ignore-path = docs/build,docs/api/generated,docs/_templates,docs/tutorials,docs/examples file-encoding = utf8 diff --git a/src/metpy/io/gini.py b/src/metpy/io/gini.py index eb099a2ba88..58b500499b2 100644 --- a/src/metpy/io/gini.py +++ b/src/metpy/io/gini.py @@ -14,10 +14,7 @@ import numpy as np from xarray import Variable from xarray.backends.common import AbstractDataStore -try: - from xarray.core.utils import FrozenDict -except ImportError: - from xarray.core.utils import FrozenOrderedDict as FrozenDict +from xarray.core.utils import FrozenDict from ._tools import Bits, IOBuffer, NamedStruct, open_as_needed, zlib_decompress_all_frames from ..package_tools import Exporter @@ -405,11 +402,3 @@ def get_attrs(self): """ return FrozenDict(satellite=self.prod_desc.creating_entity, sector=self.prod_desc.sector_id) - - def get_dimensions(self): - """Get the file's dimensions. - - This is used by `xarray.open_dataset`. - - """ - return FrozenDict(x=self.prod_desc.nx, y=self.prod_desc.ny)