Repository navigation
Validation fixes, ReSpecTh time shifts and speciation export - #145
Merged
kyleniemeyer merged 13 commits intoNov 13, 2026
Merged
kyleniemeyer merged 13 commits into
kyleniemeyer merged 13 commits into
Conversation
… values are accepted
convert_to_ReSpecTh now writes a ChemKED speciation measurement as the ReSpecTh speciation type its apparatus and swept axis call for: jet stirred reactor, burner stabilized flame speciation, concentration time profile (shock tube or flow reactor against time), or outlet concentration measurement. It is the inverse of get_speciation_datapoints: each datapoint becomes a dataGroup with the independent variables, one column per concentration profile, conditions of that datapoint alone, auxiliary profiles and per-row uncertainties as columns. Shared conditions, the initial composition and uncertainties that describe a whole profile or quantity become common properties; an uncertainty the datapoints do not share is a column with one repeated value. The reference is written as ReSpecTh 2 details, so reading it back needs no DOI look-up. All 576 speciation files of ChemKED-database round-trip through ReSpecTh to an equal dict. get_value_metadata now keeps the bound of a common uncertainty, which was read as symmetric so a lower bound overwrote the upper one. No file in the local ReSpecTh corpus has a one-sided common uncertainty.
The speciation reader dropped the timeshift element, and of a varying uncertainty column it kept only the values: their name, kind, sourcetype and method were lost, and the values were scaled by the profile's unit factor rather than their own, so an evaluated standard deviation in mole fraction on a ppm profile came out 1e6 too small. - timeshift is read into the time-shift of every speciation datapoint, and "half increase" is an allowed time-shift type, as ReSpecTh uses it. - A profile's uncertainty mapping says what the last value of each row is with the fields of one kind given without a value, such as evaluated-standard-deviation-type, -sourcetype and -method. A plain absolute uncertainty needs none, and stays the default meaning. The validator accepts such fields only when the rows end with a value, and requires the -type. - An absolute uncertainty about a profile is converted from its own units to the profile's kind; a relative one is not rescaled. - convert_to_ReSpecTh writes the row column as the profile describes it, so it stays the inverse of the reader.
A common uncertainty about a concentration profile was scaled to its own kind, not the profile's, so an evaluated standard deviation in mole fraction stayed a mole fraction on a mole percent profile, and on a mol/cm3 profile. It is now converted with uncertainty_factor, like a dataGroup column. An uncertainty that cannot be stated in the profile's units, such as a mole fraction about a concentration, which would need the density of the mixture, is dropped with a warning, in a column as well as common. It is not given to the inlet amount of the species instead.
Member
|
@LekiaAnonim are the changes proposed here necessary for the validation checks in pr-omethe-us/ChemKED-database#46 to pass? |
Contributor
Author
Yes, especially for converted ReSpecTh files |
The ruff-format pre-commit hook rejects any commit touching these files as they stand. Layout only, with no change in behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An uncertainty is a span, but Pint converts a quantity in an offset unit as a point on the scale. So an uncertainty of 10 degC about a temperature in kelvin was loaded as 283.15 K, a temperature in degC with an uncertainty of 10 K failed to load because the uncertainty became -263.15 degC, and a negative uncertainty such as -5 degC passed the sign check in validation as 268.15 K. The larger of two asymmetric bounds was also chosen by comparing them as temperatures. The new _as_difference restates a quantity in an offset unit in Pint's delta unit, which converts as a span. Validation checks the sign of an absolute uncertainty or evaluated standard deviation as a span, and DataPoint converts absolute uncertainties, the bounds it compares, and absolute evaluated standard deviations the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pint 0.26 is the first release that reads a value written as a string in an offset unit, such as "25 degC"; earlier releases take it for 25 multiplied by degC and raise OffsetUnitCalculusError. The loader parses values in that string form, so with Pint 0.24 (the last release for Python 3.10) or 0.25 (the last for Python 3.11) a file with a temperature in degC or degF failed to load, and the new tests of uncertainties in those units failed on the Python 3.10 and 3.11 CI jobs. Pint 0.26 itself requires Python 3.12, so Python 3.10 and 3.11 are dropped: requires-python, the classifiers, the CI matrix and the ruff target move to 3.12, and pint is required at >=0.26 so an older Pint already installed on Python 3.12 or later is upgraded rather than kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kyleniemeyer
added a commit
that referenced
this pull request
Nov 13, 2026
The normalize_doi, normalize_value, and value_with_units imports added in #145 were out of order, which ruff reports as I001. The ruff-format pre-commit hook also rejects any commit touching the file until it is formatted. Layout only, with no change in behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kyleniemeyer
added a commit
that referenced
this pull request
Nov 16, 2026
PR #145 added the made-up DOI 10.1021/mock.escaped to CROSSREF_RESPONSES for the HTML-unescaping tests. The live API contract tests check every DOI in CROSSREF_RESPONSES against the real CrossRef API, which returns 404 for it, so the weekly run has failed since #145 was merged. Move it to a new CROSSREF_SYNTHETIC_RESPONSES, which the mock serves alongside CROSSREF_RESPONSES but the contract tests do not check, as CROSSREF_INVALID_DOIS already keeps the DOIs that should look invalid. CONTRIBUTING.md says where a made-up record goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kyleniemeyer
added a commit
that referenced
this pull request
Nov 16, 2026
The default test run and the CI checks on pull requests both skip the live API contract tests, so a problem they would catch, such as the made-up DOI #145 added to the mock data, surfaces only in the weekly run after it is merged. Ask contributors to run pytest -m live_api before submitting any pull request, whatever it changes, since the tests are there to catch errors no one expected. Say so in the pull request checklist and the live API section of CONTRIBUTING.md, and in the same section of the development docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Ten commits on top of
main(0223292). They come from the ReSpecTh conversion work for ChemKED-database and are what its files need to pass validation.Validation:
Energy & Fuels).https://doi.org/...).ReSpecTh conversion:
Tests
New and changed tests are in
tests/test_chemked.py,tests/test_converters.py,tests/test_validation.pyandtests/test_respecth_fixtures.py.Why now
The ChemKED-database pull-request check will install PyKED from
mainof this repository. The PyPI release 0.5.0 (1db5495) acceptschemked-versiononly up to0.5.0a0and only ignition delay files. With these commits onmain, the check validates the ChemKED 0.5.0 files of ChemKED-database, including the speciation files with time shifts.