Feat: Handle thalamus protocols #140
21 tests run, 9 passed, 0 skipped, 12 failed.
Annotations
Check failure on line 418 in tests/test_access_point.py
github-actions / JUnit Test Report
test_access_point.test_get_morphologies
AssertionError: assert {'name': 'sim... 'simple.asc'} == {'name': 'sim...a/simple.asc'}
Omitting 1 identical items, use -vv to show
Differing items:
{'path': 'simple.asc'} != {'path': '/home/runner/work/emodel-generalisation/emodel-generalisation/tests/data/simple.asc'}
Use -v to get more diff
Raw output
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f03196773d0>
def test_get_morphologies(access_point):
""" """
> assert access_point.get_morphologies(EMODEL) == {
"name": "simple",
"path": str(DATA / "simple.asc"),
}
E AssertionError: assert {'name': 'sim... 'simple.asc'} == {'name': 'sim...a/simple.asc'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'path': 'simple.asc'} != {'path': '/home/runner/work/emodel-generalisation/emodel-generalisation/tests/data/simple.asc'}
E Use -v to get more diff
tests/test_access_point.py:418: AssertionError
Check failure on line 428 in tests/test_access_point.py
github-actions / JUnit Test Report
test_access_point.test_get_configuration
AssertionError: assert {'distributio...ne, ...}, ...} == {'distributio...ne, ...}, ...}
Omitting 4 identical items, use -vv to show
Differing items:
{'morphology': {'format': 'asc', 'name': 'simple', 'path': 'simple.asc', 'secarray_names': None, ...}} != {'morphology': {'format': 'asc', 'name': 'simple', 'path': '/home/runner/work/emodel-generalisation/emodel-generalisation/tests/data/simple.asc', 'secarray_names': None, ...}}
Use -v to get more diff
Raw output
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f03193b7ca0>
def test_get_configuration(access_point):
""" """
config = access_point.get_configuration(EMODEL).as_dict()
> assert config == {
"mechanisms": [
{"name": "pas", "stochastic": False, "location": "all", "version": None},
{"name": "Ih", "stochastic": False, "location": "somadend", "version": None},
{"name": "SKv3_1", "stochastic": False, "location": "somatic", "version": None},
{"name": "K_Pst", "stochastic": False, "location": "somatic", "version": None},
{"name": "NaTg", "stochastic": False, "location": "somatic", "version": None},
{"name": "SKv3_1", "stochastic": False, "location": "axonal", "version": None},
{"name": "K_Pst", "stochastic": False, "location": "axonal", "version": None},
{"name": "NaTg", "stochastic": False, "location": "axonal", "version": None},
],
"distributions": [
{"name": "uniform", "function": None, "soma_ref_location": 0.5},
{
"name": "exp",
"function": "(-0.8696 + 2.087*math.exp(({distance})*0.0031))*{value}",
"soma_ref_location": 0.5,
},
],
"parameters": [
{"name": "v_init", "value": -80, "location": "global"},
{"name": "celsius", "value": 34, "location": "global"},
{"name": "cm", "value": 0.02, "location": "myelinated"},
{"name": "g_pas", "value": [0, 1e-05], "location": "all", "mechanism": "pas"},
{
"name": "gIhbar_Ih",
"value": [8e-05, 0.00015],
"location": "somadend",
"distribution": "exp",
"mechanism": "Ih",
},
{"name": "cm", "value": 1.0, "location": "somatic"},
{"name": "ena", "value": 50, "location": "somatic"},
{"name": "ek", "value": -90, "location": "somatic"},
{"name": "e_pas", "value": -90, "location": "somatic", "mechanism": "pas"},
{
"name": "gSKv3_1bar_SKv3_1",
"value": [0, 0.2],
"location": "somatic",
"mechanism": "SKv3_1",
},
{
"name": "gK_Pstbar_K_Pst",
"value": [0, 1.0],
"location": "somatic",
"mechanism": "K_Pst",
},
{
"name": "gNaTgbar_NaTg",
"value": [0, 0.01],
"location": "somatic",
"mechanism": "NaTg",
},
{"name": "vshiftm_NaTg", "value": 13, "location": "somatic", "mechanism": "NaTg"},
{"name": "vshifth_NaTg", "value": 15, "location": "somatic", "mechanism": "NaTg"},
{"name": "cm", "value": 1.0, "location": "axonal"},
{"name": "ena", "value": 50, "location": "axonal"},
{"name": "ek", "value": -90, "location": "axonal"},
{"name": "e_pas", "value": -90, "location": "axonal", "mechanism": "pas"},
{
"name": "gSKv3_1bar_SKv3_1",
"value": [1.0, 2.0],
"location": "axonal",
"mechanism": "SKv3_1",
},
{
"name": "gK_Pstbar_K_Pst",
"value": [0, 2.0],
"location": "axonal",
"mechanism": "K_Pst",
},
{
"name": "gNaTgbar_NaTg",
"value": [0.45, 0.9],
"location": "axonal",
"mechanism": "NaTg",
},
{"name": "slopem_NaTg", "value": 9, "location": "axonal", "mechanism": "NaTg"},
{"name": "vshifth_NaTg", "value": 10, "location": "axonal", "mechanism": "NaTg"},
],
"morphology": {
"name": "simple",
"format": "asc",
"path": str(DATA / "simple.asc"),
"seclist_names": None,
"secarray_names": None,
"section_index": None,
},
"morph_modifiers": None,
}
E AssertionError: assert {'distributio...ne, ...}, ...} == {'distributio...ne, ...}, ...}
E Omitting 4 identical items, use -vv to show
E Differing items:
E {'morphology': {'format': 'asc', 'name': 'simple', 'path': 'simple.asc', 'secarray_names': None, ...}} != {'morphology': {'format': 'asc', 'name': 'simple', 'path': '/home/runner/work/emodel-generalisation/emodel-generalisation/tests/data/simple.asc', 'secarray_names': None, ...}}
E Use -v to get more diff
tests/test_access_point.py:428: AssertionError
Check failure on line 98 in .tox/py310/lib/python3.10/site-packages/dask/tests/test_cli.py
github-actions / JUnit Test Report
test_cli.test_evaluate
AssertionError:
Not equal to tolerance rtol=0.1, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 6.677037
Max relative difference: 0.1149653
x: array(51.401677)
y: array(58.078714)
Raw output
cli_runner = <click.testing.CliRunner object at 0x7f03193fd1b0>
tmpdir = local('/home/runner/work/emodel-generalisation/emodel-generalisation/.tox/py310/tmp/test_evaluate0')
def test_evaluate(cli_runner, tmpdir):
"""Tetst cli evaluate."""
# fmt: off
response = cli_runner.invoke(
tested.cli,
[
"-v", "evaluate",
"--input-path", str(DATA / "sonata_v6.h5"),
"--output-path", str(tmpdir / "evaluation_df.csv"),
"--morphology-path", str(DATA / "morphologies"),
"--config-path", str(DATA / "config"),
"--final-path", str(DATA / "final.json"),
"--parallel-lib", None,
"--evaluate-all",
],
)
# fmt: on
assert response.exit_code == 0
df = pd.read_csv(tmpdir / "evaluation_df.csv")
# df.drop(columns=["path"]).to_csv(DATA / "evaluation_df.csv", index=None)
expected_df = pd.read_csv(DATA / "evaluation_df.csv")
for f, f_exp in zip(
json.loads(df.loc[0, "features"]).values(),
json.loads(expected_df.loc[0, "features"]).values(),
):
> npt.assert_allclose(f, f_exp, rtol=1e-1)
tests/test_cli.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f03193e8c10>, array(51.40167664), array(58.07871364))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.1, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=0.1, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 6.677037
E Max relative difference: 0.1149653
E x: array(51.401677)
E y: array(58.078714)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 134 in .tox/py310/lib/python3.10/site-packages/dask/tests/test_cli.py
github-actions / JUnit Test Report
test_cli.test_adapt
AssertionError: assert 1 == 0
+ where 1 = <Result RawDataError('File: simple.asc does not exist.')>.exit_code
Raw output
cli_runner = <click.testing.CliRunner object at 0x7f03181c6140>
tmpdir = local('/home/runner/work/emodel-generalisation/emodel-generalisation/.tox/py310/tmp/test_adapt0')
def test_adapt(cli_runner, tmpdir):
"""Test cli adapt."""
# fmt: off
response = cli_runner.invoke(
tested.cli,
[
"-v", "adapt",
"--input-node-path", str(DATA / "sonata_v6.h5"),
"--output-node-path", str(tmpdir / "sonata_v6_adapted.h5"),
"--morphology-path", str(DATA / "morphologies"),
"--config-path", str(DATA / "config"),
"--final-path", str(DATA / "final.json"),
"--local-dir", str(tmpdir / 'local'),
"--output-hoc-path", str(tmpdir / "hoc"),
"--parallel-lib", None,
"--min-scale", 0.9,
"--max-scale", 1.1,
],
)
# fmt: on
> assert response.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result RawDataError('File: simple.asc does not exist.')>.exit_code
tests/test_cli.py:134: AssertionError
Check failure on line 50 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_feature_evaluation
AssertionError:
Not equal to tolerance rtol=0.1, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 2.24247613
Max relative difference: 0.48757817
x: array(2.356737)
y: array(4.599214)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f03118b4370>
def test_feature_evaluation(morphs_combos_df, access_point):
""" """
df = evaluation.feature_evaluation(morphs_combos_df, access_point)
expected_scores = {
"IDRest_150.soma.v.mean_frequency": 2.3567374199026414,
"IDRest_150.soma.v.AP_amplitude": 0.624398677191681,
"IDRest_200.soma.v.mean_frequency": 2.2226560510494124,
"IDRest_200.soma.v.AP_amplitude": 0.5340149936839824,
"IDRest_280.soma.v.mean_frequency": 2.5353330326086994,
"IDRest_280.soma.v.AP_amplitude": 0.4711507560288358,
"RMPProtocol.soma.v.voltage_base": 0.33131119446020707,
"RMPProtocol.soma.v.Spikecount": 0.0,
"SearchHoldingCurrent.soma.v.bpo_holding_current": 0.18281250000000002,
"SearchHoldingCurrent.soma.v.voltage_base": 0.043970045446585004,
"RinProtocol.soma.v.ohmic_input_resistance_vb_ssse": 0.17312024013731503,
"SearchThresholdCurrent.soma.v.bpo_threshold_current": 0.10935385147499851,
}
scores = json.loads(df.loc[0, "scores"])
for feature, score in expected_scores.items():
> assert_allclose(score, scores[feature], rtol=1e-1)
tests/test_evaluation.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f03118039a0>, array(2.35673742), array(4.59921355))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.1, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=0.1, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 2.24247613
E Max relative difference: 0.48757817
E x: array(2.356737)
E y: array(4.599214)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 75 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_rin_no_soma
AssertionError:
Not equal to tolerance rtol=0.001, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 534.91689123
Max relative difference: 0.72545287
x: array(1272.272704)
y: array(737.355813)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f031198afe0>
def test_evaluate_rin_no_soma(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_rin_no_soma(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rin_no_soma"], 737.355812849696, rtol=1e-3)
tests/test_evaluation.py:75:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f03118037f0>, array(1272.27270408), array(737.35581285))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.001, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=0.001, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 534.91689123
E Max relative difference: 0.72545287
E x: array(1272.272704)
E y: array(737.355813)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 81 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_soma_rin
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 726.49556602
Max relative difference: 0.85613033
x: array(1575.076138)
y: array(848.580572)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f0324a71cf0>
def test_evaluate_soma_rin(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_soma_rin(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rin_soma"], 848.5805718798488, rtol=1e-5)
tests/test_evaluation.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f0311802f80>, array(1575.0761379), array(848.58057188))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=1e-05, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 726.49556602
E Max relative difference: 0.85613033
E x: array(1575.076138)
E y: array(848.580572)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 87 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_ais_rin
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 39485.31321175
Max relative difference: 0.29988315
x: array(171154.308601)
y: array(131668.995389)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f032481d930>
def test_evaluate_ais_rin(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_ais_rin(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rin_ais"], 131668.9953893715, rtol=1e-5)
tests/test_evaluation.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f0324b1f640>, array(171154.30860112), array(131668.99538937))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=1e-05, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 39485.31321175
E Max relative difference: 0.29988315
E x: array(171154.308601)
E y: array(131668.995389)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 93 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_somadend_rin
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 296.36527917
Max relative difference: 0.54970299
x: array(835.502383)
y: array(539.137104)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f0324609600>
def test_evaluate_somadend_rin(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_somadend_rin(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rin_no_ais"], 539.1371042337126, rtol=1e-5)
tests/test_evaluation.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f0324b1f880>, array(835.50238341), array(539.13710423))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=1e-05, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 296.36527917
E Max relative difference: 0.54970299
E x: array(835.502383)
E y: array(539.137104)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 99 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_rho
AssertionError:
Not equal to tolerance rtol=0.001, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 0.08715924
Max relative difference: 0.07573514
x: array(1.238002)
y: array(1.150843)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f0311bb4040>
def test_evaluate_rho(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_rho(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rho"], 1.150842747082164, rtol=1e-3)
tests/test_evaluation.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f03118689d0>, array(1.23800199), array(1.15084275))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.001, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=0.001, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 0.08715924
E Max relative difference: 0.07573514
E x: array(1.238002)
E y: array(1.150843)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 105 in tests/test_evaluation.py
github-actions / JUnit Test Report
test_evaluation.test_evaluate_rho_axon
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 39.36975441
Max relative difference: 0.16120496
x: array(204.851969)
y: array(244.221724)
Raw output
morphs_combos_df = name path emodel
0 simple /home/runner/work/emodel-generalisation/emodel... generic_model
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f0311aff490>
def test_evaluate_rho_axon(morphs_combos_df, access_point):
""" """
df = evaluation.evaluate_rho_axon(morphs_combos_df, access_point)
> assert_allclose(df.loc[0, "rho_axon"], 244.2217237122562, rtol=1e-5)
tests/test_evaluation.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_allclose.<locals>.compare at 0x7f0311868430>, array(204.85196931), array(244.22172371))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=0', 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Not equal to tolerance rtol=1e-05, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 39.36975441
E Max relative difference: 0.16120496
E x: array(204.851969)
E y: array(244.221724)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError
Check failure on line 51 in tests/test_mcmc.py
github-actions / JUnit Test Report
test_mcmc
AssertionError:
Arrays are not almost equal to 0 decimals
(shapes (12,), (11,) mismatch)
x: array([18., 18., 17., 18., 16., 16., 14., 15., 15., 22., 22., 21.])
y: array([21., 22., 21., 14., 18., 25., 20., 20., 26., 20., 20.])
Raw output
access_point = <emodel_generalisation.model.access_point.AccessPoint object at 0x7f0324526350>
simple_morph = '/home/runner/work/emodel-generalisation/emodel-generalisation/tests/data/simple.asc'
tmpdir = local('/home/runner/work/emodel-generalisation/emodel-generalisation/.tox/py310/tmp/test_mcmc0')
def test_mcmc(access_point, simple_morph, tmpdir):
""" """
access_point.morph_path = simple_morph
mcmc.run_several_chains(
proposal_params={"std": 0.1},
temperature=0.5,
n_chains=4,
n_steps=3,
results_df_path=tmpdir / "chains",
run_df_path=tmpdir / "run_df.csv",
access_point=access_point,
random_initial_parameters=True,
)
df = mcmc.load_chains(str(tmpdir / "run_df.csv"))
# df.to_csv(DATA / "mcmc_df.csv")
expected_df = pd.read_csv(DATA / "mcmc_df.csv", header=[0, 1])
for col in ["features", "parameters", "scores", "normalized_parameters"]:
for feat in df[col].columns:
> assert_almost_equal(
df[col][feat].to_numpy(), expected_df[col][feat].to_numpy(), decimal=0
)
tests/test_mcmc.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: in inner
return func(*args, **kwds)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f0311803520>, array([17.89770772, 17.80974398, 17.07562796...14.1571443 , 18.03637335,
24.51856771, 19.59558761, 19.69874505, 25.91071033, 20.10319641,
19.59227794]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E (shapes (12,), (11,) mismatch)
E x: array([18., 18., 17., 18., 16., 16., 14., 15., 15., 22., 22., 21.])
E y: array([21., 22., 21., 14., 18., 25., 20., 20., 26., 20., 20.])
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError