Skip to content

Commit

Permalink
Rename to include Concat
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Jan 23, 2025
1 parent f99bad0 commit c94d8a8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pyaro_readers/merging_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MergingReaderException(Exception):
pass


class MergingReaderData(Data):
class MergingReaderConcatData(Data):
def __init__(self, data: list[Data], variable: str) -> None:
if len(data) == 0:
raise MergingReaderException("Requires at least one dataset")
Expand All @@ -40,7 +40,7 @@ def keys(self):
raise NotImplementedError

def slice(self, index):
return MergingReaderData([d[index] for d in self._data], self._variable)
return MergingReaderConcatData([d[index] for d in self._data], self._variable)

@property
def values(self) -> np.ndarray:
Expand Down Expand Up @@ -90,6 +90,7 @@ def __init__(
raise MergingReaderException(
'Only merging mode "concat" is supported as of now'
)
self._mode = mode
self._datasets = []
self._set_filters(filters)
for d in datasets:
Expand All @@ -99,7 +100,9 @@ def __init__(
)

def _unfiltered_data(self, varname: str) -> Data:
return MergingReaderData([d.data(varname) for d in self._datasets], varname)
return MergingReaderConcatData(
[d.data(varname) for d in self._datasets], varname
)

def _unfiltered_stations(self) -> list[str]:
stations = []
Expand Down

0 comments on commit c94d8a8

Please sign in to comment.