-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve validation error #320
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ www = "#expand user_www#zppy_test_complete_run_www" | |
[climo] | ||
active = True | ||
walltime = "00:30:00" | ||
years = "1850:1854:2", "1850:1854:4", | ||
years = "1850:1854:2", "1850:1854:4" | ||
|
||
[[ atm_monthly_180x360_aave ]] | ||
frequency = "monthly" | ||
|
@@ -25,9 +25,9 @@ years = "1850:1854:2", "1850:1854:4", | |
vars = "PRECT" | ||
|
||
[ts] | ||
active = True | ||
active = 4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Causes |
||
walltime = "00:30:00" | ||
years = "1850:1854:2", | ||
years = "1850:1854:2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
|
||
[[ atm_monthly_180x360_aave ]] | ||
frequency = "monthly" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import argparse | ||
import errno | ||
import os | ||
import pprint | ||
from typing import List | ||
|
||
from configobj import ConfigObj | ||
|
@@ -167,8 +168,12 @@ def _validate_config(config): | |
validator = Validator() | ||
|
||
result = config.validate(validator) | ||
print(type(result)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if result is not True: | ||
print("Validation results={}".format(result)) | ||
printer = pprint.PrettyPrinter(depth=3) | ||
print("Validation results:") | ||
printer.pprint(result) | ||
# print("Validation results={}".format(result)) | ||
raise ValueError( | ||
"Configuration file validation failed. Parameters listed as false in the validation results have invalid values." | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Launches the following:
Both the
"1850:1854:2"
(2-year increment) jobs and the"1850:1854:4"
(4-year increment) jobs are launched successfully. Does this mean the trailing comma is no longer a requirement ofstring_list
parameters?