Skip to content

Documenting all existing rules #1258

@dayantur

Description

@dayantur

Currently, there is no central, user-accessible documentation for all validator rules outside of the codebase itself. The new rule registry implemented in #1246 (and potential AI template workflow for rule creation in #1248) makes it even more important to document rules systematically. Attempting to collect rules manually (e.g., PR #851) isn't scalable, so an automated approach is needed.

Proposed Documentation Strategy:

  • Fundamental Constraints and Ranges (Class 1 rules - C1; can only be validations):
    Document these via the range_values / range_description fields in the JSON schema.
    These constraints should automatically appear in the documentation for each parameter.
  • All Other Rules (Class 2 rules - C2; can be either adjustments or validations or warnings);
    Collect and document other rules in a dedicated .rst doc file. Use docstrings from each rule function, ensuring they follow a consistent, Numpy-style format and correctly describe the rule. Organise the documentation using rule IDs and categories/scripts in Add a draft rules registry to the validator with two test rules #1246.

Proposed Implementation Steps:

(The first two steps can be carried out in parallel.)

A. Extract all parameter ranges and field constraints from existing Pydantic fields and include them in parameter descriptions.
B. Review and update all rule docstrings to follow the Numpy docstring standard and ensure accuracy.
C. Create a rulebook.rst file and automatically collect/aggregate all rules into this documentation file.

@MatthewPaskin @sunt05 let me know your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-featureNew functionality2-doc:devDeveloper documentation2-doc:userUser guides, tutorials3-P1High priority4-readyReady for work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions