You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When chanobs_filepath is defined in a t-route configuration file, executing Config.with_strict_mode(...) results in a Pydantic validation error.
Expected Behavior
Using with_strict_mode shouldn't raise a file not found validation error on output files.
Details
In NOAA-OWP/ngen our t-route integration tests have started failing due to the Chanobs.nc file not existing. My understanding is that this is an output file, so it shouldn't necessarily exist until after t-route has executed.
Backtracing the error, it starts with strict mode being enabled for config parsing with d443337.
Looking in troute-config, chanobs_filepath has type FilePath
I think a slight semantic change is necessary, i.e. something like InputFilePath and OutputFilePath, where InputFilePath parameters are validated for existence in the same way that FilePath is, and OutputFilePath are validated only for write permissions in the parent directory but not existence.
Though, it's entirely possible I'm misunderstanding something, so please let me know if I am! 🙂
The text was updated successfully, but these errors were encountered:
aaraney
added a commit
to aaraney/t-route
that referenced
this issue
Jul 2, 2024
Current Behavior
When
chanobs_filepath
is defined in a t-route configuration file, executingConfig.with_strict_mode(...)
results in a Pydantic validation error.Expected Behavior
Using
with_strict_mode
shouldn't raise a file not found validation error on output files.Details
In NOAA-OWP/ngen our t-route integration tests have started failing due to the
Chanobs.nc
file not existing. My understanding is that this is an output file, so it shouldn't necessarily exist until after t-route has executed.troute-config
,chanobs_filepath
has typeFilePath
t-route/src/troute-config/troute/config/output_parameters.py
Line 38 in ae6a7b1
and
FilePath
is defined ast-route/src/troute-config/troute/config/types.py
Lines 15 to 32 in ae6a7b1
I think a slight semantic change is necessary, i.e. something like
InputFilePath
andOutputFilePath
, whereInputFilePath
parameters are validated for existence in the same way thatFilePath
is, andOutputFilePath
are validated only for write permissions in the parent directory but not existence.Though, it's entirely possible I'm misunderstanding something, so please let me know if I am! 🙂
The text was updated successfully, but these errors were encountered: