-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locale
: Fix metadata-sensitive tests. (#189)
* Specify locale in metadata tests. * Hardcode locale to yadg tests too. * Fix more metadata. * bump schemas to >= 120 * comma for ruff
- Loading branch information
1 parent
097b578
commit 10b361b
Showing
7 changed files
with
62 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
import os | ||
import json | ||
import yadg.dgutils | ||
import yadg.core | ||
import datatree | ||
from .utils import compare_datatrees | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"input", | ||
[ | ||
"test_locale_passthrough.json", | ||
], | ||
) | ||
def test_process_locale_passthrough(input, datadir): | ||
os.chdir(datadir) | ||
|
||
with open(f"{input}") as infile: | ||
obj = json.load(infile) | ||
|
||
schema = yadg.dgutils.update_schema(obj) | ||
ret = yadg.core.process_schema(schema) | ||
# ret.to_netcdf(f"{input}.nc", engine="h5netcdf") | ||
ref = datatree.open_datatree(f"{input}.nc", engine="h5netcdf") | ||
compare_datatrees(ret, ref, thislevel=True, descend=True) |
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,5 @@ | ||
timestamp; elapsed time; T_f; T_fs; T_fo; T_c; T_cs; T_co; N2; O2; alkane; CO/CO2; saturator; pressure; flow low; flow high; cavity flush; heater flow; T_cal | ||
; ; degC; degC; %; degC; degC; %; ml/min; ml/min; ml/min; ml/min; ml/min; mbar; ml/min; ml/min; ml/min; l/min; degC | ||
2019-12-03-09-01-24; 0h 0m59s;20.9;23.9;8.0;18;18;-6;27.17;1.25;0.00;0.00;0.00;1300.0;0.629;1.00;15;11;20.1 | ||
2019-12-03-09-02-24; 0h 1m59s;25.6;28.9;15.1;18;18;-3;27.17;1.25;0.00;0.00;0.00;1299.7;0.630;1.00;15;11;19.9 | ||
2019-12-03-09-03-25; 0h 3m 0s;32.0;34.0;17.1;18;18;-11;27.17;1.25;0.00;0.00;0.00;1300.3;0.630;1.00;15;11;20.2 |
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,27 @@ | ||
{ | ||
"version": "5.1", | ||
"metadata": { | ||
"provenance": {"type": "manual"} | ||
}, | ||
"step_defaults": { | ||
"timezone": "Europe/Berlin", | ||
"locale": "en_US" | ||
}, | ||
"steps": [ | ||
{ | ||
"tag": "stepdefaults", | ||
"input": {"files": ["measurement.csv"]}, | ||
"extractor": { | ||
"filetype": "example" | ||
} | ||
}, | ||
{ | ||
"tag": "locale-de_DE", | ||
"input": {"files": ["measurement.csv"]}, | ||
"extractor": { | ||
"filetype": "example", | ||
"locale": "de_DE" | ||
} | ||
} | ||
] | ||
} |
Binary file not shown.
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