Skip to content

Commit

Permalink
Automated autopep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autopep8 bot committed Feb 26, 2025
1 parent e48fac8 commit 24cc2e3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
5 changes: 2 additions & 3 deletions fedot_ind/core/operation/transformation/basis/eigen_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,15 @@ def mode_func(x):
svd_numbers = list(map(lambda dimension:
[dimension_rank.append(self._transform_one_sample(signal, svd_flag=True))
for signal in data[:, dimension, :]], number_of_dim))

to_comp = []
for dim in number_of_dim:
dim_ranks = []
for sign in data[:, dim, :]:
r = self._transform_one_sample(sign, svd_flag=True)
dim_ranks.append(r.compute())
to_comp.append(dim_ranks)



with threadpool_limits(limits=1, user_api='blas'):
if not one_dim_predict:
list_of_ranks = np.array(to_comp).flatten().tolist()
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/core/models/model_impl/test_nbeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def ts_input_data():
return train_test_data_setup(train_input, validation_blocks=None)

# def test_nbeats_model(ts_input_data):


def nbeats_model(ts_input_data):
IndustrialModels().setup_repository()
train, test = ts_input_data
Expand Down
49 changes: 25 additions & 24 deletions tests/unit/models/test_linear_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from fedot_ind.core.architecture.pipelines.abstract_pipeline import AbstractPipeline
from fedot_ind.core.repository.constanst_repository import VALID_LINEAR_REG_PIPELINE, VALID_LINEAR_CLF_PIPELINE, \
VALID_LINEAR_DETECTION_PIPELINE, VALID_LINEAR_TSF_PIPELINE
from tests.unit.api.fixtures import set_pytest_timeout_in_seconds


class LinearPipelineCase:
Expand All @@ -20,21 +19,21 @@ def __init__(self, pipeline_label, node_list, data_list, task, task_params=None)
def __str__(self) -> str:
return self.pipeline_label


def get_data():
# random train data
import numpy as np
train_features = np.random.rand(100, 8)
train_target = np.zeros(100)
# train_target[50:60] = 1.0

test_features = np.random.rand(50, 8)
test_target = np.zeros(50)
test_target[30:40] = 1.0

return dict(train_data=(train_features, train_target),
test_data=(test_features, test_target)
)

test_data=(test_features, test_target)
)


LINEAR_REG_PIPELINE_CASES = [
Expand All @@ -43,11 +42,11 @@ def get_data():
node_list=node_list,
# data_list=['AppliancesEnergy'],
data_list=[
dict(train_data = (np.random.rand(25, 100), np.random.rand(25)),
test_data = (np.random.rand(25, 100), np.random.rand(25))),
# dict(train_data = (np.random.rand(25, 3, 100), np.random.rand(25)),
# test_data = (np.random.rand(25, 3, 100), np.random.rand(25)))
],
dict(train_data=(np.random.rand(25, 100), np.random.rand(25)),
test_data=(np.random.rand(25, 100), np.random.rand(25))),
# dict(train_data = (np.random.rand(25, 3, 100), np.random.rand(25)),
# test_data = (np.random.rand(25, 3, 100), np.random.rand(25)))
],
task='regression'
) for pipeline_label, node_list in VALID_LINEAR_REG_PIPELINE.items()
]
Expand All @@ -57,15 +56,15 @@ def get_data():
pipeline_label=pipeline_label,
node_list=node_list,
data_list=[
dict(train_data = (np.random.rand(25, 50), np.random.randint(0, 2, 25)),
test_data = (np.random.rand(25, 50), np.random.randint(0, 2, 25))),
# dict(train_data = (np.random.rand(25, 3, 50), np.random.randint(0, 2, 25)),
# test_data = (np.random.rand(25, 3, 50), np.random.randint(0, 2, 25)))
],
dict(train_data=(np.random.rand(25, 50), np.random.randint(0, 2, 25)),
test_data=(np.random.rand(25, 50), np.random.randint(0, 2, 25))),
# dict(train_data = (np.random.rand(25, 3, 50), np.random.randint(0, 2, 25)),
# test_data = (np.random.rand(25, 3, 50), np.random.randint(0, 2, 25)))
],
# data_list=[
# 'Earthquakes',
# 'ERing'
# ],
# 'Earthquakes',
# 'ERing'
# ],
task='classification'
) for pipeline_label, node_list in VALID_LINEAR_CLF_PIPELINE.items()
]
Expand All @@ -75,9 +74,9 @@ def get_data():
pipeline_label=pipeline_label,
node_list=node_list,
# data_list=[dict(benchmark='M4', dataset='D2600', task_params={'forecast_length': 14})],
data_list=[dict(train_data = (np.random.rand(100), np.random.rand(100)),
test_data = (np.random.rand(14), np.random.rand(14)),
task_params = {'forecast_length': 14})],
data_list=[dict(train_data=(np.random.rand(100), np.random.rand(100)),
test_data=(np.random.rand(14), np.random.rand(14)),
task_params={'forecast_length': 14})],
task='ts_forecasting',
task_params=dict(forecast_length=14)
) for pipeline_label, node_list in VALID_LINEAR_TSF_PIPELINE.items()
Expand All @@ -95,9 +94,9 @@ def get_data():
]

# TODO: temporarily workaround skip topological_*
BANNED_LINEAR_PIPELINE_LABELS = ['topological_clf',
'topological_reg',
'composite_reg',
BANNED_LINEAR_PIPELINE_LABELS = ['topological_clf',
'topological_reg',
'composite_reg',
'topological_lgbm',
'composite_clf',
'stat_detector',
Expand All @@ -112,6 +111,8 @@ def get_data():

# @set_pytest_timeout_in_seconds(300)
# @pytest.mark.xfail()


@pytest.mark.parametrize('pipeline_case', LINEAR_PIPELINE_CASES, ids=str)
def test_valid_linear_pipelines(pipeline_case: LinearPipelineCase):
if isinstance(pipeline_case.node_list, list):
Expand Down

0 comments on commit 24cc2e3

Please # to comment.