Skip to content

Commit 730140e

Browse files
committed
Remove unused irregular flag and clean up redundant imports
1 parent 16a2593 commit 730140e

3 files changed

Lines changed: 1 addition & 26 deletions

File tree

experanto/experiment.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ def __init__(
6666
modality_config: dict = DEFAULT_MODALITY_CONFIG,
6767
cache_data: bool = False,
6868
) -> None:
69-
"""
70-
root_folder: path to the data folder
71-
modality_config: dict for configuring interpolators
72-
cache_data: if True, loads and keeps all trial data in memory
73-
"""
7469
self.root_folder = Path(root_folder)
7570
self.devices = dict()
7671
self.start_time = np.inf
@@ -112,16 +107,6 @@ def _load_devices(self) -> None:
112107
cache_data=self.cache_data,
113108
**{str(k): v for k, v in dict(interp_conf).items()},
114109
)
115-
# Default back to original logic
116-
warnings.warn(
117-
"Falling back to original Interpolator creation logic.",
118-
UserWarning,
119-
)
120-
dev = Interpolator.create(
121-
d,
122-
cache_data=self.cache_data,
123-
**interp_conf, # type: ignore[arg-type]
124-
)
125110

126111
self.devices[d.name] = dev
127112
if dev.start_time is not None:

tests/create_experiment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import copy
22
import shutil
33
from contextlib import contextmanager
4-
from pathlib import Path
54

65
from .create_sequence_data import _generate_sequence_data
76

tests/create_sequence_data.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ def _generate_sequence_data(
1717
t_end=10.0,
1818
sampling_rate=10.0,
1919
contain_nans=False,
20-
irregular=False,
2120
):
2221
"""Generates synthetic sequence data folders for testing interpolator logic."""
23-
from pathlib import Path
2422

2523
sequence_root = Path(sequence_root)
2624
sequence_root.mkdir(parents=True, exist_ok=True)
@@ -40,14 +38,7 @@ def _generate_sequence_data(
4038
duration = meta["end_time"] - meta["start_time"]
4139
n_samples = int(round(duration * meta["sampling_rate"])) + 1
4240

43-
if not irregular:
44-
timestamps = np.linspace(meta["start_time"], meta["end_time"], n_samples)
45-
else:
46-
steps = np.random.uniform(0.5, 1.5, size=n_samples - 1) / sampling_rate
47-
timestamps = np.zeros(n_samples)
48-
timestamps[0] = meta["start_time"]
49-
timestamps[1:] = meta["start_time"] + np.cumsum(steps)
50-
meta["end_time"] = float(timestamps[-1])
41+
timestamps = np.linspace(meta["start_time"], meta["end_time"], n_samples)
5142

5243
data = np.random.rand(len(timestamps), n_signals)
5344

0 commit comments

Comments
 (0)