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

Issue48 #49

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions wres-config/src/wres/config/yaml/DeclarationValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4023,11 +4023,13 @@ private static List<EvaluationStatusEvent> evaluationTimeScaleIsValid( TimeScale
{
EvaluationStatusEvent event
= EvaluationStatusEvent.newBuilder()
.setStatusLevel( StatusLevel.ERROR )
.setEventMessage( "The evaluation 'time_scale' is prescriptive and "
+ "cannot be instantaneous. Please remove the "
+ "evaluation 'time_scale' or increase it and try "
+ AGAIN )
.setStatusLevel( StatusLevel.WARN )
.setEventMessage( "The evaluation 'time_scale' is instantaneous. If the "
+ "datasets all contain instantaneous values, this "
+ "declaration is redundant and should be removed. "
+ "Otherwise, the declaration is invalid because "
+ "the smallest possible 'time_scale' is "
+ "instantaneous and downscaling is not supported." )
.build();
events.add( event );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ void testEvaluateDatasetTimeScaleIsValidResultsinError()
}

@Test
void testEvaluationTimeScaleIsConsistentWithDatasetTimeScalesResultsInErrors()
void testEvaluationTimeScaleIsConsistentWithDatasetTimeScalesResultsInWarningsAndErrors()
{
TimeScale timeScaleInnerSource = TimeScale.newBuilder()
.setPeriod( Duration.newBuilder()
Expand Down Expand Up @@ -754,8 +754,9 @@ void testEvaluationTimeScaleIsConsistentWithDatasetTimeScalesResultsInErrors()

List<EvaluationStatusEvent> events = DeclarationValidator.validate( declaration );

assertAll( () -> assertTrue( DeclarationValidatorTest.contains( events, "cannot be instantaneous",
StatusLevel.ERROR ) ),
assertAll( () -> assertTrue( DeclarationValidatorTest.contains( events, "The evaluation 'time_scale' "
+ "is instantaneous",
StatusLevel.WARN ) ),
() -> assertTrue( DeclarationValidatorTest.contains( events, "is smaller than the "
+ "evaluation 'time_scale'",
StatusLevel.ERROR ) ),
Expand Down
Loading