myokit / myokit

Myokit: A simple interface to cardiac cellular electrophysiology
http://myokit.org
Other
34 stars 5 forks source link

Use binds & labels as aliases in datalog #882

Open MichaelClerx opened 2 years ago

MichaelClerx commented 2 years ago

Would allow you to use a data log in a model agnostic manner

E.g.:

ax.plot(d['time'], d['membrane_potential'])

Depends on

MichaelClerx commented 2 months ago

Should we also allow them as log specifier?

sim.run(log=['time', 'membrane_potential']) ?

MichaelClerx commented 2 months ago

A problem with

ax.plot(d['time'], d['membrane_potential'])

is that it would allow labels to "shadow" log entries without a . (which simulations don't generate, but are perfectly OK from the log's point of view. Might be better to have

ax.plot(d.labelled('time'), d.labelled('membrane_potential'))