hydromodpy.core.config_kit.introspect#

Introspection helpers for HydroModPy Pydantic config fields.

Central location for logic that reads Annotated[...] metadata off pydantic.fields.FieldInfo - profile visibility, conditional display, and any future metadata tags.

Kept separate from hydromodpy.core.toml_io.generator and hydromodpy.core.toml_io.io so TOML, Streamlit, and JSON Schema paths can share the same source of truth.

Module attributes

DEFAULT_FIELD_PROFILE

Fields without an explicit Profile tag default to Profile.USER so they always appear in generated templates.

Functions

collect_profile_violations(model_cls, ...[, ...])

Return (path, level) for every payload key whose Profile exceeds threshold.

extract_profile(field_info)

Return the Profile declared on field_info.

iter_fields_by_profile(model_cls, threshold)

Yield (name, field_info, level) for fields visible at threshold.

read_profile_from_schema(field_schema)

Return the Profile declared via x-hmp-profile on a JSON schema node.

resolve_profile(profile)

Coerce a profile name ("user"/"dev"/"expert") or enum to Profile.