Skip to content

Commit

Permalink
Expose config_from_matlab function, remove redundant Configuration.fr…
Browse files Browse the repository at this point in the history
…om_matlab_options
  • Loading branch information
dekuenstle committed Sep 20, 2024
1 parent 037eefa commit dbedfb7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This is the class and function reference of psignifit.

psignifit
pool_blocks
config_from_matlab
Configuration
Result

Expand Down
1 change: 1 addition & 0 deletions psignifit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
from ._pooling import pool_blocks
from ._configuration import Configuration
from ._result import Result
from ._matlab import config_from_matlab
5 changes: 0 additions & 5 deletions psignifit/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ class Configuration:
def __post_init__(self):
self.check_attributes()

@classmethod
def from_matlab_options(cls, option_dict: Dict[str, Any], **kwargs):
python_configs = config_from_matlab(option_dict, **kwargs)
return cls(**python_configs)

@classmethod
def from_dict(cls, config_dict: Dict[str, Any]):
config_dict = config_dict.copy()
Expand Down
4 changes: 1 addition & 3 deletions psignifit/tests/test_matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def yield_test_data(cases=yield_test_cases()):


def compare_with_matlab(data, options, results):
config = psignifit.Configuration.from_matlab_options(options, raise_matlab_only=False)
config = psignifit.config_from_matlab(options, raise_matlab_only=False)
pyresults = psignifit.psignifit(data, conf=config)
# Testing for similarity:
# allclose(actual, desired) = abs(actual - desired) <= atol + rtol * abs(desired)
Expand Down Expand Up @@ -73,5 +73,3 @@ def test_all_matlab_cases(data, options, results):
@pytest.mark.parametrize('data,options,results', yield_test_data(test_case_subset), ids=test_case_subset)
def test_few_matlab_cases(data, options, results):
compare_with_matlab(data, options, results)


0 comments on commit dbedfb7

Please sign in to comment.