Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
v1docq committed Oct 16, 2024
1 parent c7d4c16 commit a0e877b
Show file tree
Hide file tree
Showing 6 changed files with 787 additions and 5 deletions.
Empty file added examples/tutorial/__init__.py
Empty file.

Large diffs are not rendered by default.

Empty file.
3 changes: 2 additions & 1 deletion fedot_ind/core/models/base_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ def apply_window_for_stat_feature(self, ts_data: np.array,

else:
ts_slices = list(range(0, subseq_set.shape[1]))
features = list(map(lambda slice: feature_generator(subseq_set[:, slice]).features, ts_slices))
features = list(map(lambda slice: feature_generator(subseq_set[:, slice]), ts_slices))
names = list(map(lambda ts_tup: [x + f'_on_interval: {ts_tup[1] + 1} - {ts_tup[1] + 1 + window_size}'
for x in ts_tup[0].supplementary_data['feature_name']],
zip(features, ts_slices)))
features = [x.features for x in features]

return features, names

Expand Down
1 change: 0 additions & 1 deletion fedot_ind/core/repository/IndustrialDispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def _multithread_eval(self, individuals_to_evaluate):
uid_of_individual=ind.uid,
logs_initializer=log),
individuals_to_evaluate))

return evaluation_results

def _eval_at_least_one(self, individuals):
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/api/main/test_api_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from matplotlib import get_backend, pyplot as plt

from fedot_ind.api.main import FedotIndustrial
from fedot_ind.api.utils.data import SynthTimeSeriesData
from fedot_ind.tools.synthetic.ts_datasets_generator import TimeSeriesDatasetsGenerator


Expand Down Expand Up @@ -109,7 +110,7 @@ def ts_config():

def test_generate_ts(fedot_industrial_classification, ts_config):
industrial = fedot_industrial_classification
ts = industrial.generate_ts(ts_config=ts_config)
ts = SynthTimeSeriesData(ts_config).generate_ts()

assert isinstance(ts, np.ndarray)
assert ts.shape[0] == 1000
Expand All @@ -129,8 +130,7 @@ def test_generate_anomaly_ts(
ts_config,
anomaly_config):
industrial = fedot_industrial_classification
init_synth_ts, mod_synth_ts, synth_inters = industrial.generate_anomaly_ts(
ts_data=ts_config, anomaly_config=anomaly_config)
init_synth_ts, mod_synth_ts, synth_inters = SynthTimeSeriesData(anomaly_config).generate_anomaly_ts(ts_config)
assert len(init_synth_ts) == len(mod_synth_ts)
for anomaly_type in synth_inters:
for interval in synth_inters[anomaly_type]:
Expand Down

0 comments on commit a0e877b

Please sign in to comment.