- Added
- [581](https://github.com/myokit/myokit/pull/581) Myokit's expression system now includes a `PartialDerivative` and an `InitialValue` class. Both are for use in sensitivity calculations and may not appear in models.
- [581](https://github.com/myokit/myokit/pull/581) Expressions now have a method `diff(lhs)` that returns the (partial) derivative of an expression with respect to the given `LhsExpression`.
- [581](https://github.com/myokit/myokit/pull/581) Expressions now have methods `is_derivative`, `is_name`, and `is_number`.
- [581](https://github.com/myokit/myokit/pull/581) Added a method `Number.value()`.
- [581](https://github.com/myokit/myokit/pull/581) The method `Expression.depends_on` now has an argument `deep` that can be set to `True` to perform a recursive dependency check.
- [595](https://github.com/myokit/myokit/pull/595) A class `myokit.CModel` was added that can generate multi-purpose C code for use in simulations. This is mainly for internal use.
- [682](https://github.com/myokit/myokit/pull/682) OpenCL code now recognises error code -1001.
- [683](https://github.com/myokit/myokit/pull/683) Now testing OpenCL code in CI.
- [704](https://github.com/myokit/myokit/pull/704) Added first example notebook to the github repository.
- [728](https://github.com/myokit/myokit/pull/728) Added a context manager `myokit.tools.capture` that can redirect and capture output from Python `stdout` and `stderr` via a Python-only method or file-descriptor redirection and should be thread-safe.
- [735](https://github.com/myokit/myokit/pull/735) The new module `myokit.float` contains several functions related to floating point numbers that were previously in the main `myokit` namespace or not part of the public API.
- [735](https://github.com/myokit/myokit/pull/735) The new module `myokit.tools` contains several stand-alone tools that are used by Myokit and were previously in the main `myokit` namespace or not part of the public API.
- [735](https://github.com/myokit/myokit/pull/735) The method `pid_hash`, which is used by compiled code to generate (hopefully) unique ids is now part of the public API.
- [744](https://github.com/myokit/myokit/pull/744) Added a method `myokit.OpenCL.available` to check if OpenCL is supported and at least one OpenCL device is detected.
- [754](https://github.com/myokit/myokit/pull/754) Added a method `myokit.OpenCL.current_info(x)` that returns information about the currently selected platform and device; support of OpenCL extensions can then be checked with `OpenCLPlatformInfo.has_extension`.
- [754](https://github.com/myokit/myokit/pull/754) Improved error message when an `OpenCLSimulation` with double precision is run on a device that does not support it.
- [763](https://github.com/myokit/myokit/pull/763) Added a method `OpenCLSimulation.set_conductance_field` to apply heterogeneous conductance on a rectangular grid.
- [769](https://github.com/myokit/myokit/pull/769) Rebecca-Rumney Added a method `myokit.Model.import_component` to import a component from one model to another.
- [769](https://github.com/myokit/myokit/pull/769) Rebecca-Rumney Added an exception type `VariableMappingError` to be raised when there is an error in a variable mapping.
- [776](https://github.com/myokit/myokit/pull/776) Added a method `OpenCLSimulation.monodomain_conductance` to replace the deprecated method `calculate_conductance`.
- [780](https://github.com/myokit/myokit/pull/780) Alt-up and alt-down can now be used in the text editor to move selected lines up or down.
- [782](https://github.com/myokit/myokit/pull/782) The IDE can now import CellML files on opening, e.g. by typing `myokit ide example.cellml`.
- [786](https://github.com/myokit/myokit/pull/786) Added a method `myokit.Variable.clamp()` to fix any variable to a constant value.
- [786](https://github.com/myokit/myokit/pull/786) Added a method `myokit.Variable.remove_child_variables()` to remove all child (nested) variables from a given variable.
- [788](https://github.com/myokit/myokit/pull/788) The IDE will now suggest filenames for model exports.
- [792](https://github.com/myokit/myokit/pull/792) DavAug SBML import now handles equations that explicitly use time.
- Changed
- [581](https://github.com/myokit/myokit/pull/581) Powers are now rendered without spaces in mmt code, e.g. `x^2` instead of `x ^ 2`.
- [595](https://github.com/myokit/myokit/pull/595) The `Simulation` class now uses CVODES instead of CVODE as backend, which may require changes to your installation.
- [595](https://github.com/myokit/myokit/pull/595) The `Simulation` can now calculate sensitivities of variables with respect to parameters and/or initial conditions (see docs for details).
- [595](https://github.com/myokit/myokit/pull/595) The `Simulation` class no longer has `apd_var` as a constructor argument. Instead, you can pass an argument `apd_variable` to its `run()` method.
- [595](https://github.com/myokit/myokit/pull/595) The `Simulation` class no longer suppresses CVODES warnings but passes them on to the `warnings` module.
- [595](https://github.com/myokit/myokit/pull/595) Fix to `Simulation` for Sundials 4.1.0.
- [687](https://github.com/myokit/myokit/pull/687) `Variable.set_rhs(None)` now removes an RHS, instead of setting it to `Number(0)`.
- [687](https://github.com/myokit/myokit/pull/687) Calling `SimulationOpenCL.set_conductance` will now override any conductances previously set with `set_connections`.
- [687](https://github.com/myokit/myokit/pull/687) `SimulationOpenCL.set_connections` no longer accepts `None` as a valid argument.
- [687](https://github.com/myokit/myokit/pull/687) The `SimulationOpenCL` methods `set_conductance`, `conductance`, `set_connections`, `neighbours`, `set_paced_cells`, `set_paced_cell_list`, and `is_paced`, will now raise a `RuntimeError` if diffusion was disabled at construction.
- [687](https://github.com/myokit/myokit/pull/687) The method `SimulationOpenCL.remove_field` now raises a `KeyError` if no field is set for the given variable.
- [689](https://github.com/myokit/myokit/pull/689) In Python 2, an `ImportError` is now raised if `myokit.ini` contains the sequence " ;" in any of its value (as this cannot be processed by Python 2's `ConfigParser`).
- [728](https://github.com/myokit/myokit/pull/728) The `LegacySimulation` class no longer suppresses CVODE warnings but passes them on to the `warnings` module (backported from new `Simulation` class).
- [789](https://github.com/myokit/myokit/pull/789) The method `myokit.DataLog.save_csv()` now stores the keys using natural sort order (time is still the first field, if present).
- Deprecated
- [595](https://github.com/myokit/myokit/pull/595) The classes `myokit.PSimulation` and `myokit.ICSimulation` have been deprecated in favor of the new `Simulation` class.
- [735](https://github.com/myokit/myokit/pull/735) The class `myokit.Benchmarker` is deprecated in favor of `myokit.tools.Benchmarker`.
- [735](https://github.com/myokit/myokit/pull/735) The method `myokit.format_float_dict` is deprecated and will be removed in future versions.
- [735](https://github.com/myokit/myokit/pull/735) The method `myokit.format_path` is deprecated in favor of `myokit.tools.format_path`.
- [735](https://github.com/myokit/myokit/pull/735) The method `myokit.strfloat` is deprecated in favor of `myokit.float.str`.
- [758](https://github.com/myokit/myokit/pull/758) The class `myokit.FiberTissueSimulation` is deprecated and will be removed in future versions.
- [776](https://github.com/myokit/myokit/pull/776) The method `OpenCLSimulation.calculate_conductance` is deprecated in favor of the new method `calculate_conductance`, which takes slightly different parameters.
- [787](https://github.com/myokit/myokit/pull/787) The method `myokit.Model.eval_state_derivatives` is deprecated in favor of `myokit.Model.evaluate_derivatives`.
- Removed
- [683](https://github.com/myokit/myokit/pull/683) No longer testing on Python 2.7.6 on linux (still testing latest 2.7). No longer testing any Python 2.7 on Windows.
- [728](https://github.com/myokit/myokit/pull/728) The classes `myokit.PyCapture` and `myokit.SubCapture` have been replaced by a single context manager `myokit.tools.capture`.
- [730](https://github.com/myokit/myokit/pull/730) Removed the method `myokit.pack_snapshot`.
- [737](https://github.com/myokit/myokit/pull/737) The method `Model.merge_interdependent_components` was removed. This method was deprecated since 2018-05-30.
- [737](https://github.com/myokit/myokit/pull/737) The method `Model.show_line` was removed. This method was deprecated since 2018-05-30.
- [737](https://github.com/myokit/myokit/pull/737) The method `Protocol.guess_duration` was removed. This method was deprecated since 2016-02-06.
- Fixed
- [684](https://github.com/myokit/myokit/pull/684) DavAug Fixed OpenCL loading issue on MacOS (with special thanks to Martin Aguilar).
- [686](https://github.com/myokit/myokit/pull/686) Fixed a (windows only) bug in `myokit.tools.format_path()`.
- [687](https://github.com/myokit/myokit/pull/687) `Simulation1d` now logs pacing as a global variable, and can log diffusion currents.
- [689](https://github.com/myokit/myokit/pull/689) Path lists read from `myokit.ini` are now filtered for empty entries and closing semicolons.
- [744](https://github.com/myokit/myokit/pull/744) Fixed a bug in `OpenCLSimulation.find_nan()`, that occurred for very small simulations (e.g. 2 cells).
- [744](https://github.com/myokit/myokit/pull/744) Fixed a bug in `OpenCLSimulation` that made it impossible to use `set_connections()` with double precision.
- [744](https://github.com/myokit/myokit/pull/744) Fixed a bug in `OpenCLSimulation` that made it impossible to use `set_connections()` on Python 2.
- [754](https://github.com/myokit/myokit/pull/754) Improved error message when an `OpenCLSimulation` with double precision is run on a device that does not support it.
- [766](https://github.com/myokit/myokit/pull/766) Improved error message when an empty MathML `<cn>` element is encountered.