Skip to content

Wei lin chen/crs builder review cleanup - #426

Merged
WLChen1118 merged 30 commits into
trunkfrom
WeiLinChen/crs-builder-review-cleanup
Sep 24, 2026
Merged

WLChen1118 merged 30 commits into
trunkfrom
WeiLinChen/crs-builder-review-cleanup

Conversation

@WLChen1118

@WLChen1118 WLChen1118 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

For instructions on using the property-aware CRS input builder, see the
https://github.com/SCM-NV/PLAMS/blob/WeiLinChen/crs-builder-review-cleanup/doc/source/interfaces/crs.rst

I’m not sure whether class CRSInputBuilder.to_inputs() is the structure we want, but it provides a convenient way to convert the builder state into a typed scm.inputs.CRS model. This also allows users to configure additional CRS options that are not exposed by the property-specific builder.

Keep CRS schema lookup separate from builder workflow logic and avoid loading
CRS JSON files at import time.
Add property-specific input builders for ACTIVITYCOEF, SOLUBILITY, and
BINMIXCOEF with typed properties and explicit compound-role methods.

Keep CRSJob as a thin factory wrapper, derive input-key routing from crs.json,
and centralize mode, required-input, and compound-key validation in the builder
module.
This distinguishes the ADFCRS database from local SQLite databases
managed by pyCRS.COSKFDatabase.
Add runtime normalization and validation for explicit CRS input-builder
properties, including float ranges, scalar floats, intergers and booleans.
Keep unknown COMPOUND keys as errors, but ignore schema-valid keys that do not
affect the selected builder.

For example, ACTIVITYCOEF ignores meltingpoint instead of rejecting it.
Use crs.json input metadata for primitive value validation, and keep
_SINGLE_VALUE_INPUT_KEYS as the builder-level override for float_list inputs
that are semantically single values.
Expose sigma moment input keys on sigma profile builders, refine hover
descriptions for explicit builder properties, and add a separate expert-option
API for technical top-level CRS input keys.
Comment thread src/scm/plams/interfaces/adfsuite/crs.py Outdated
Comment thread src/scm/plams/interfaces/adfsuite/crs.py
…y CRSJob (was not determined automatically by pyright at least) SO--

@robertrueger robertrueger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user interface looks pretty nice. I think the implementation would have been much more straightforward if we had the new new builder classes based on pydantic, as that would do all the validation based on the type-hints automatically. But that alone is probably not a good reason to pull in pydantic as a new dependency of PLAMS ...

@WLChen1118

Copy link
Copy Markdown
Contributor Author

@dormrod In <34a03ba>, I added a minimal JSON fixture so the CRS input builder tests can run without an AMS installation. Does this approach look okay to you?

@WLChen1118
WLChen1118 merged commit 409a50d into trunk Sep 24, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants