diff --git a/lib/ncdata/__init__.py b/lib/ncdata/__init__.py index 13114aa..4f1c17b 100644 --- a/lib/ncdata/__init__.py +++ b/lib/ncdata/__init__.py @@ -11,5 +11,6 @@ # N.B. this file excluded from isort, as we want a specific class order for the docs from ._core import NcAttribute, NcData, NcDimension, NcVariable +from ._version import __version__ -__all__ = ["NcAttribute", "NcData", "NcDimension", "NcVariable"] +__all__ = ["NcAttribute", "NcData", "NcDimension", "NcVariable", "__version__"] diff --git a/pyproject.toml b/pyproject.toml index ce372a4..aae8f6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,79 @@ +[build-system] +# Defined by PEP 518 +requires = [ + "setuptools>=64", + "setuptools_scm[toml]>=7.0", + "wheel", +] +# Defined by PEP 517 +build-backend = "setuptools.build_meta" + +[project] +name = "ncdata" +authors = [ + {name = "Patrick Peglar", email = "patrick.peglar@metoffice.gov.uk"}, +] +description = "Abstract NetCDF data objects, providing fast data transfer between analysis packages." +requires-python = ">=3.7" +keywords = [ + "cf-metadata", + "data-analysis", + "netcdf", + "iris", + "xarray", +] +license = {text = "BSD-3-Clause"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", +] +dynamic = [ + "readme", + "version", +] +# Strictly, dask + netcdf are not core dependencies. +# But almost *any* conceivable use will need them. +# For now, this works in place of a dependencies file, so 'dependencies' is NOT dynamic. +dependencies = ["numpy", "dask", "netCDF4"] + + +[project.urls] +Code = "https://github.com/pp-mo/ncdata" +Discussions = "https://github.com/pp-mo/ncdata/discussions" +Documentation = "https://ncdata.readthedocs.io" +Issues = "https://github.com/pp-mo/ncdata/issues" + + +[tool.setuptools] +license-files = ["LICENSE"] + +[tool.setuptools.dynamic] +readme = {file = "README.md", content-type = "text/markdown"} + +[tool.setuptools.packages.find] +include = ["ncdata*"] +where = ["lib"] + +[tool.setuptools_scm] +version_file = "lib/ncdata/_version.py" +local_scheme = "dirty-tag" +version_scheme = "release-branch-semver" + + [tool.black] line-length = 79 target-version = ['py310'] diff --git a/setup.py b/setup.py deleted file mode 100644 index fcc2fa7..0000000 --- a/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -# noqa -from setuptools import find_packages, setup - -setup( - name="ncdata", - version="0.0.1", - url="https://github.com/pp-mo/ncdata.git", - author="pp-mo", - author_email="patrick.peglar@metoffice.gov.uk", - description="NetCDF data interoperability between Iris and Xarray", - packages=find_packages(where="lib"), - package_dir={"": "lib"}, - install_requires=["numpy"], -) diff --git a/tests/integration/test_roundtrips_ixi_xix.py b/tests/integration/test_roundtrips_ixi_xix.py index 16384f0..61d06b0 100644 --- a/tests/integration/test_roundtrips_ixi_xix.py +++ b/tests/integration/test_roundtrips_ixi_xix.py @@ -72,14 +72,11 @@ def test_roundtrip_ixi(standard_testcase, use_irislock, adjust_chunks): + [ # string dimension problem "ds__dtype__string", - # outstanding dims-mismatch problems. "testing__small_theta_colpex", - # coordinate attributes on mesh coordinate variables "testdata____unstructured_grid__data_C4", "testdata____ugrid__21_triangle_example", - # Problem with units on time bounds "label_and_climate__small_FC_167", ] @@ -149,7 +146,7 @@ def test_roundtrip_ixi(standard_testcase, use_irislock, adjust_chunks): if len(iris_coords) != 1: # Coords don't match, which is nasty! # Just skip out + let the test fail - break; + break (iris_coord,) = iris_coords # Detecting differently constructed time units is awkward, # because you can have unit1==unit2, but still str(unit1) != str(unit2) @@ -176,7 +173,9 @@ def test_roundtrip_ixi(standard_testcase, use_irislock, adjust_chunks): if not result: # FOR NOW: compare with experimental ncdata comparison. # I know this is a bit circular, but it is useful for debugging, for now ... - result = compare_nc_datasets(from_iris(iris_cubes), from_iris(iris_xr_cubes)) + result = compare_nc_datasets( + from_iris(iris_cubes), from_iris(iris_xr_cubes) + ) assert result == []