generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the declaration of event detection, #130
- Loading branch information
1 parent
b735d54
commit b648481
Showing
16 changed files
with
469 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
wres-config/src/wres/config/yaml/components/CovariatePurpose.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package wres.config.yaml.components; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* The purpose or application of a covariate dataset within an evaluation. | ||
* @author James Brown | ||
*/ | ||
public enum CovariatePurpose | ||
{ | ||
/** Use the covariate dataset to filter the pairs. */ | ||
@JsonProperty( "filter" ) FILTER, | ||
/** Use the covariate dataset to detect events for evaluation. */ | ||
@JsonProperty( "detect" ) DETECT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
wres-config/src/wres/config/yaml/components/EventDetection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package wres.config.yaml.components; | ||
|
||
import java.util.Objects; | ||
import java.util.Set; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import io.soabase.recordbuilder.core.RecordBuilder; | ||
|
||
import wres.config.yaml.deserializers.EventDetectionDeserializer; | ||
|
||
/** | ||
* Used for the detection of discrete events within time-series. | ||
* @param datasets the datasets to use for event detection | ||
*/ | ||
@RecordBuilder | ||
@JsonDeserialize( using = EventDetectionDeserializer.class ) | ||
public record EventDetection( @JsonProperty( "dataset" ) Set<EventDetectionDataset> datasets ) | ||
{ | ||
/** | ||
* Creates an instance. | ||
* @param datasets the datasets to use for event detection | ||
*/ | ||
public EventDetection | ||
{ | ||
Objects.requireNonNull( datasets, "The event detection dataset cannot be null." ); | ||
|
||
if ( datasets.isEmpty() ) | ||
{ | ||
throw new IllegalArgumentException( "Declare at least one dataset for event detection." ); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
wres-config/src/wres/config/yaml/components/EventDetectionDataset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package wres.config.yaml.components; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* The context of a dataset to use for event detection. | ||
* @author James Brown | ||
*/ | ||
public enum EventDetectionDataset | ||
{ | ||
/** Observed dataset. */ | ||
@JsonProperty( "observed" ) OBSERVED, | ||
/** Predicted dataset. */ | ||
@JsonProperty( "predicted" ) PREDICTED, | ||
/** Baseline dataset. */ | ||
@JsonProperty( "baseline" ) BASELINE, | ||
/** Covariates dataset. */ | ||
@JsonProperty( "covariates" ) COVARIATES | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.