Skip to content

Validator skipping conditional validations due to _is_physics_explicitly_configured #1190

@dayantur

Description

@dayantur

Currently, conditional validations in config.py are disabled due to the following function in config.py:

def _is_physics_explicitly_configured(self) -> bool:
    """
    Heuristic to determine if physics parameters were explicitly set by the user
    rather than using all default values.

    For now, we'll be conservative and assume that if no model section was
    provided by the user, then conditional validation should not apply.

    Returns True if physics appears to be explicitly configured.
    """
    # For now, disable conditional validation entirely for configs that
    # don't explicitly set the problematic physics methods
    # This is a conservative approach that avoids breaking existing tests

    # The real solution would be to track whether fields were explicitly set
    # vs using defaults, but that requires more complex Pydantic handling

    # For now, return False to disable conditional validation unless
    # explicitly enabled during testing
    return False

Since this function always returns False, conditional validation is effectively disabled. This implementation was probably meant as a temporary workaround and was never properly replaced. As a result, conditional validators are never triggered, and relevant YAML configurations from users are not validated as intended.

To address this, we need to properly implement _is_physics_explicitly_configured so that it can correctly determine whether physics-related settings have been explicitly set by the user. This will ensure that conditional validation is enabled when necessary.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions