Skip to content

handle entry types without a dedicated model, such as calculations in validator - #2451

Merged
ml-evs merged 3 commits into
Materials-Consortia:ml-evs/property-definitionsfrom
rartino:validator-entry-types-without-schema
Nov 2, 2026
Merged

ml-evs merged 3 commits into
Materials-Consortia:ml-evs/property-definitionsfrom
rartino:validator-entry-types-without-schema

Conversation

@rartino

@rartino rartino commented Oct 31, 2026

Copy link
Copy Markdown
Member

Note: to be merged on top of #2442

calculations is in the validator's entry endpoints, but VALIDATOR_CONFIG.entry_schemas only covers the types in ENTRY_INFO_SCHEMAS. So validating any server that serves calculations fails with an internal error, KeyError: 'calculations'.

This PR gives such entry types the schema of EntryResource, which covers the properties shared by all entry types and is all that calculations has in v1.3. It also falls back to ValidatorEntryResponseMany in _test_unknown_provider_property, as _test_multi_entry_endpoint already does. A new test runs the validator against the reference server with an emulated calculations entry type. It fails without this change.

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.92537% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.58%. Comparing base (7db767d) to head (96b7794).

Files with missing lines Patch % Lines
optimade/models/property_definitions.py 95.51% 10 Missing ⚠️
optimade/server/schemas.py 91.04% 6 Missing ⚠️
optimade/validator/validator.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2451      +/-   ##
==========================================
+ Coverage   90.21%   90.58%   +0.36%     
==========================================
  Files          78       79       +1     
  Lines        5039     5364     +325     
==========================================
+ Hits         4546     4859     +313     
- Misses        493      505      +12     
Flag Coverage Δ
project 90.58% <94.92%> (+0.36%) ⬆️
validator 90.58% <94.92%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ml-evs
ml-evs changed the base branch from main to ml-evs/property-definitions November 2, 2026 14:12
@ml-evs
ml-evs merged commit 1db0cd4 into Materials-Consortia:ml-evs/property-definitions Nov 2, 2026
12 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.

2 participants