Skip to content

Commit

Permalink
fix iexpr test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaquier Aurélien Tristan committed Aug 21, 2024
1 parent 5ad7f4d commit 5778cd5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions bluepyopt/tests/test_ephys/test_parameterscalers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,16 @@ def test_parameterscalers_iexpr():
f.write(simple_cell_decor_with_iexpr)
test_decor = arbor.load_component(decor_filename).component
assert test_decor.defaults() == []
assert str(test_decor.paintings()) == \
"""[('(region "soma")', Cm=0.01), """ \
"""('(region "soma")', <arbor.scaled_mechanism<density> """ \
"(mechanism('default::hh', " \
'{"gkbar": 0.0271248, "gnabar": 0.102993}), ' \
assert test_decor.placements() == []
assert len(test_decor.paintings()) == 2
assert test_decor.paintings()[0][0] == '(region "soma")'
assert str(test_decor.paintings()[0][1]) == 'Cm=0.01'
assert test_decor.paintings()[1][0] == '(region "soma")'
scaled_mech_str = "<arbor.scaled_mechanism<density> " \
"(mechanism('default::hh', %s), " \
'{"gkbar": (sub (scalar 0.621094) (mul (log (scalar 3.14159)) ' \
'(exp (div (distance 1 (region "soma")) ' \
'(scalar 0.421875)))))})>)]'
assert test_decor.placements() == []
'(scalar 0.421875)))))})>'
str1 = scaled_mech_str % '{"gkbar": 0.0271248, "gnabar": 0.102993}'
str2 = scaled_mech_str % '{"gnabar": 0.102993, "gkbar": 0.0271248}'
assert str(test_decor.paintings()[1][1]) in [str1, str2]

0 comments on commit 5778cd5

Please sign in to comment.