Skip to content

Commit a96ded5

Browse files
authored
Housekeeping (#255)
* fixes to pyproject.toml * also schemas * check also 3.14 * update test_schema * pin pandas to >= 2.0, < 3.0 * remove pydantic.v1 stuff * avoid warning in sac.py * outer join in picolog
1 parent a123aa7 commit a96ded5

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

.github/workflows/pull-request-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
pyver: ['3.10', '3.11', '3.12', '3.13']
9+
pyver: ['3.10', '3.11', '3.12', '3.13', '3.14']
1010
os: ['ubuntu-latest']
1111
include:
1212
- pyver: '3.11'
@@ -19,7 +19,7 @@ jobs:
1919
needs: [build]
2020
strategy:
2121
matrix:
22-
pyver: ['3.10', '3.11', '3.12', '3.13']
22+
pyver: ['3.10', '3.11', '3.12', '3.13', '3.14']
2323
os: ['ubuntu-latest']
2424
include:
2525
- pyver: '3.11'

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ maintainers = [
1616
]
1717
description = "yet another datagram"
1818
readme = "README.md"
19+
license = "GPL-3.0-or-later"
1920
classifiers = [
2021
"Development Status :: 5 - Production/Stable",
21-
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
2222
"Programming Language :: Python :: 3.10",
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
2525
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
2627
"Operating System :: OS Independent",
2728
]
2829
requires-python = ">= 3.10"
@@ -37,11 +38,11 @@ dependencies = [
3738
"python-dateutil",
3839
"openpyxl >= 3.0.0",
3940
"olefile >= 0.47",
40-
"h5netcdf >= 1.0",
41-
"pandas >= 2.0",
41+
"h5netcdf[h5py] >= 1.8.0",
42+
"pandas >= 2.0, < 3.0",
4243
"babel >= 2.15",
4344
"xarray >= 2024.10.0",
44-
"dgbowl-schemas >= 123",
45+
"dgbowl-schemas >= 125",
4546
]
4647

4748
[project.optional-dependencies]

src/yadg/dgutils/schemautils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from dgbowl_schemas.yadg import to_dataschema
55
from dgbowl_schemas.yadg.dataschema import DataSchema
66
from pydantic import BaseModel
7-
from pydantic.v1 import BaseModel as BaseModel_v1
87
from yadg import dgutils
98

109
__latest_dataschema__ = "6.0"
@@ -106,7 +105,7 @@ def schema_3to4(oldschema: list) -> dict:
106105
return newschema
107106

108107

109-
def update_schema(object: list | dict | BaseModel | BaseModel_v1) -> DataSchema:
108+
def update_schema(object: list | dict | BaseModel) -> DataSchema:
110109
"""
111110
The ``yadg update`` worker function.
112111
@@ -137,7 +136,7 @@ def update_schema(object: list | dict | BaseModel | BaseModel_v1) -> DataSchema:
137136
elif isinstance(object, dict):
138137
logger.info("Updating dict-style DataSchema")
139138
newobj = to_dataschema(**object)
140-
elif isinstance(object, (BaseModel, BaseModel_v1)):
139+
elif isinstance(object, BaseModel):
141140
logger.info("Updating an existing DataSchema object")
142141
newobj = object
143142
else:

src/yadg/extractors/picolog/tc08.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def extract_from_path(
141141
},
142142
coords={"uts": (["uts"], xvals)},
143143
)
144-
ds = xr.merge((ds, newds))
144+
ds = xr.merge((ds, newds), join="outer")
145145
for var in ds.variables:
146146
if f"{var}_std_err" in ds.variables:
147147
ds[var].attrs["ancillary_variables"] = f"{var}_std_err"

src/yadg/extractors/quadstar/sac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,10 @@ def extract_from_path(
272272
else:
273273
try:
274274
traces[f"{ti}"] = xr.concat(
275-
[traces[f"{ti}"], ds], dim="uts", combine_attrs="identical"
275+
[traces[f"{ti}"], ds],
276+
data_vars="all",
277+
dim="uts",
278+
combine_attrs="identical",
276279
)
277280
except xr.MergeError:
278281
raise RuntimeError(

tests/test_schema.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import yadg.core
55
from dgbowl_schemas.yadg import to_dataschema, DataSchema_4_0, DataSchema_4_1
66
from pydantic import ValidationError
7-
from pydantic.v1 import ValidationError as ValidationError_v1
87
from .utils import datagram_from_file
98

109
ts0 = {
@@ -195,29 +194,29 @@ def test_datagram_from_schema_file(inp_fn, ts, datadir):
195194
@pytest.mark.parametrize(
196195
"inp_dict, expr",
197196
[
198-
(fts0, r"Discriminator 'parser' is missing in value"),
199-
(fts1, r"No match for discriminator 'parser' and value 'dumm'"),
197+
(fts0, r"Unable to extract tag using discriminator 'parser'"),
198+
(fts1, r"Input tag 'dumm' found using 'parser'"),
200199
(fts2, r"Both 'files' and 'folders'"),
201200
(fts3, r"Neither 'files' nor 'folders'"),
202-
(fts4, r"steps -> 0 -> Dummy -> key\n extra fields not permitted"),
201+
(fts4, r"Extra inputs are not permitted"),
203202
],
204203
)
205204
def test_schema_validator_4_0(inp_dict, expr, datadir):
206205
os.chdir(datadir)
207-
with pytest.raises((ValidationError, ValidationError_v1), match=expr):
206+
with pytest.raises(ValidationError, match=expr):
208207
assert DataSchema_4_0(**inp_dict)
209208

210209

211210
@pytest.mark.parametrize(
212211
"inp_dict, expr",
213212
[
214-
(fts5, r"metadata -> provenance\n value is not a valid dict"),
215-
(fts6, r"metadata -> version\n unexpected value"),
216-
(fts7, r"steps -> 0 -> Dummy -> input\n field required"),
217-
(fts8, r"Discriminator 'parser' is missing in value"),
213+
(fts5, r"Input should be a valid dictionary or instance of Provenance"),
214+
(fts6, r"Input should be '4.1', '4.1.0', '4.1.1', '4.1.2' or '4.1.3'"),
215+
(fts7, r"Field required"),
216+
(fts8, r"Unable to extract tag using discriminator 'parser'"),
218217
],
219218
)
220219
def test_schema_validator_4_1(inp_dict, expr, datadir):
221220
os.chdir(datadir)
222-
with pytest.raises((ValidationError, ValidationError_v1), match=expr):
221+
with pytest.raises(ValidationError, match=expr):
223222
assert DataSchema_4_1(**inp_dict)

0 commit comments

Comments
 (0)