Skip to content

Commit

Permalink
Require merging mode to be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Jan 17, 2025
1 parent 079c309 commit ef97dc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/pyaro_readers/merging_reader.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import logging
from datetime import datetime, timedelta
from pathlib import Path
from typing import Literal, Any
from collections.abc import Iterable
import importlib.resources
import dataclasses

from tqdm import tqdm
import numpy as np
import cf_units
import polars
from pyaro.timeseries.AutoFilterReaderEngine import (
AutoFilterReader,
AutoFilterEngine,
Expand Down Expand Up @@ -91,7 +83,9 @@ def __len__(self) -> int:


class MergingReader(AutoFilterReader):
def __init__(self, datasets: list[dict[str, Any]], filters=[]):
def __init__(self, datasets: list[dict[str, Any]], mode: Literal["concat"], filters=[]):
if mode != "concat":
raise MergingReaderException("Only merging mode \"concat\" is supported as of now")
self._datasets = []
self._set_filters(filters)
for d in datasets:
Expand Down
1 change: 1 addition & 0 deletions tests/test_merginreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_stuff():
{"readername": "ascii2netcdf", "filename": EBAS_URL},
{"readername": "ascii2netcdf", "filename": EBAS_URL},
],
mode="concat",
filters=[],
) as ts:
ts.variables()
Expand Down

0 comments on commit ef97dc9

Please sign in to comment.