Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support installable package. #35

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ncdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__"]
76 changes: 76 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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']
Expand Down
14 changes: 0 additions & 14 deletions setup.py

This file was deleted.

9 changes: 4 additions & 5 deletions tests/integration/test_roundtrips_ixi_xix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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)
Expand All @@ -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 == []


Expand Down