Skip to content

Commit

Permalink
Filter by feature when retrieving time-series datasets in memory, #408.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-brown committed Feb 11, 2025
1 parent 888f5d4 commit 97e63ab
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions wres-datamodel/src/wres/datamodel/time/TimeSeriesStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public Stream<TimeSeries<Double>> getSingleValuedSeries( DatasetOrientation orie
.stream()
.filter( next -> features.contains( next.getMetadata()
.getFeature() )
&& Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) );
&& ( Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) ) );
}

/**
Expand Down Expand Up @@ -144,10 +144,10 @@ public Stream<TimeSeries<Double>> getSingleValuedSeries( TimeWindowOuter timeWin
.stream()
.filter( next -> features.contains( next.getMetadata()
.getFeature() )
&& Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) )
&& ( Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) ) )
.map( next -> TimeSeriesSlicer.filter( next, timeWindow ) );
}

Expand Down Expand Up @@ -179,10 +179,10 @@ public Stream<TimeSeries<Ensemble>> getEnsembleSeries( TimeWindowOuter timeWindo
.stream()
.filter( next -> features.contains( next.getMetadata()
.getFeature() )
&& Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) )
&& ( Objects.isNull( variableName )
|| Objects.equals( next.getMetadata()
.getVariableName(),
variableName ) ) )
.map( next -> TimeSeriesSlicer.filter( next,
timeWindow ) );
}
Expand Down Expand Up @@ -453,4 +453,4 @@ private long getEventCount()
.sum();
}

}
}

0 comments on commit 97e63ab

Please sign in to comment.