Skip to content

Streamline parameter validation - #614

Merged
teunbrand merged 14 commits into
mainfrom
param-validation
Nov 19, 2026
Merged

teunbrand merged 14 commits into
mainfrom
param-validation

Conversation

@teunbrand

Copy link
Copy Markdown
Collaborator

This PR aims to fix #586.

Briefly, core validation/resolution logic is implemented as ParameterDefinition methods.
Helper wraps this to loop over ParameterDefinition and Parameters list and checks for extra (unknown) parameters.

Comment thread src/params.rs
/// Validate `properties` against `definitions` and resolve each parameter
/// to its effective value: the user's value if present, otherwise the
/// definition's default. Returns a new map with defaults filled.
pub fn resolve_parameters(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the main function to understand

Comment thread src/plot/facet/resolve.rs

// Handle ncol/nrow for wrap facets
if facet.is_wrap() {
let has_ncol = facet.properties.contains_key("ncol");

@teunbrand teunbrand Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This had a bug where FACET foo SETTING ncol => null skips compute_default_ncol() and we had an unresolved setting. Fixed with these changes.

@teunbrand
teunbrand changed the base branch from table-feature to main November 16, 2026 10:52
@teunbrand

teunbrand commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Added a few ParameterValue helpers as well (From impls, construction macro for tests, is_* helper)

@teunbrand
teunbrand requested a review from thomasp85 November 17, 2026 12:54

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@teunbrand
teunbrand merged commit c85a718 into main Nov 19, 2026
22 of 23 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.

Consolidate parameter validation

2 participants