validator_advanced¶
validator_advanced ¶
Advanced / cross-field AERMOD validation.
The base Validator in validator.py catches per-field range violations
(e.g. negative stack height). The checks here look for combinations
that commonly cause AERMOD to crash cryptically or produce silently
wrong results:
- Stack-parameter consistency (zero exit velocity with non-ambient temp, implausibly small diameter given emission rate, etc.).
- Receptor-grid/domain sanity (extent, density).
- DFAULT vs. non-default model-option consistency.
- A point source with an emission rate of 0.
- Met date range vs. ControlPathway date range.
- ANNUAL averages vs. the period the surface file covers
(:func:
check_annual_met_coverage, which reads the file and so is not part ofValidator.validate()).
As of v1.3.0 these checks are integrated into Validator.validate()
by default — findings land in the returned ValidationResult.errors
list with the appropriate severity. Call the standalone
advanced_validate(project) only when you need the cross-field
findings in isolation (e.g. for custom reporting).
surface_file_path ¶
The surface file met names, resolved as AERMOD would open it.
AERMOD opens a relative path from its working directory, so a
relative surface_file is joined to base_dir when one is given.
AERMOD does not expand ~, so neither does this: ~/met.sfc is a
relative path to a folder named ~. None when no surface file is set.
check_annual_met_coverage ¶
check_annual_met_coverage(project: Any, *, base_dir: Union[str, Path, None] = None, period: Optional[SurfaceFilePeriod] = None) -> List[ValidationError]
Warn when ANNUAL is requested with less than a year of met data.
AERMOD processes every hour and then stops with fatal error E480
("Less than 1yr for MULTYEAR, MAXDCONT or ANNUAL Ave") when the data
hold no complete year (:attr:~pyaermod.aermet.SurfaceFilePeriod.complete_years,
checked against AERMOD v26135). A STARTEND window limits the data to
the hours inside it.
Unlike :func:advanced_validate this reads the surface file, so
Validator.validate() does not call it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
AERMODProject
|
|
required |
base_dir
|
str or Path
|
The directory AERMOD will run in, against which a relative
|
None
|
period
|
SurfaceFilePeriod
|
The file's period, if already read (the GUI caches it); read with
:func: |
None
|
Returns:
| Type | Description |
|---|---|
list of ValidationError
|
One warning when the data hold no complete year; empty when ANNUAL is not requested or the surface file is unset or cannot be read (other checks report those). |
advanced_validate ¶
Run all advanced / cross-field checks and return findings.
Findings include both 'warning' and 'error' severities; merge into
a base ValidationResult via result.errors.extend(...).