Skip to content

Commit

Permalink
Fix for generator exit part two
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnel committed Nov 10, 2019
1 parent 6fc9c30 commit 4486c8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class ThreeComponentSequential:
})

time = np.asarray(np.arange(-10, 50, 1.0))
spectral = np.arange(600, 750, 5.0)
spectral = np.arange(600, 750, 25.0)
axis = {"time": time, "spectral": spectral}


Expand Down Expand Up @@ -509,7 +509,7 @@ def test_kinetic_model(suite, nnls):
print(model.validate(initial))
assert model.valid(initial)

# print(model.markdown(wanted))
print(model.markdown(wanted))

dataset = sim_model.simulate('dataset1', wanted, suite.axis)

Expand Down Expand Up @@ -541,8 +541,8 @@ def test_kinetic_model(suite, nnls):

if __name__ == "__main__":
for nnls in [True, False]:
# test_kinetic_model(OneComponentOneChannel, nnls)
# test_kinetic_model(OneComponentOneChannelGaussianIrf, nnls)
# test_kinetic_model(ThreeComponentParallel, nnls)
# test_kinetic_model(ThreeComponentSequential, nnls)
test_kinetic_model(OneComponentOneChannel, nnls)
test_kinetic_model(OneComponentOneChannelGaussianIrf, nnls)
test_kinetic_model(ThreeComponentParallel, nnls)
test_kinetic_model(ThreeComponentSequential, nnls)
test_kinetic_model(IrfDispersion, nnls)
6 changes: 4 additions & 2 deletions glotaran/model/model_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ def format_parameter(param):

if isinstance(value, Parameter):
a += format_parameter(value)
elif isinstance(value, list) and all(isinstance(v, Parameter) for v in value):
a += f"[{', '.join([format_parameter(v) for v in value])}]"
elif isinstance(value, list):
status = [isinstance(v, Parameter) for v in value]
if all(status):
a += f"[{', '.join([format_parameter(v) for v in value])}]"
elif isinstance(value, dict):
a += "\n"
for k, v in value.items():
Expand Down

0 comments on commit 4486c8e

Please sign in to comment.