Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure forcing path when file_pattern configured. #678

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

robertbartel
Copy link
Contributor

TL;DR

This change enforces requiring a path whenever file_pattern is present in forcing params in a realization config.

Explanation

The addition of NullForcingProvider included support for the absence of a path value from forcing in a realization config.

        "forcing": {
            "provider": "NullForcingProvider"
        }

Those changes did not fully account for user errors involving omitting the path in other situations, in particular when a file_pattern is configured; e.g., doing this

        "forcing": {
           "file_pattern": "/dmod/datasets/forcing/regridded/regrid_01/csv/{{id}}.csv",
           "provider":  "CsvPerFeature"
        }

instead of this

        "forcing": {
           "file_pattern": "{{id}}.csv",
           "path": "/dmod/datasets/forcing/regridded/regrid_01/csv/",
           "provider":  "CsvPerFeature"
        }

Now an error will be thrown explaining that path needs to be set to the parent directory.

Ensure configured forcing params include a 'path' value whenever a
'file_pattern' is present.
@robertbartel robertbartel added the bug Something isn't working label Nov 17, 2023
@robertbartel robertbartel merged commit acdab4e into NOAA-OWP:master Nov 17, 2023
17 of 19 checks passed
@robertbartel robertbartel deleted the fix_empty_path branch November 17, 2023 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants