Skip to content
Snippets Groups Projects
user avatar
Sam Yates authored
Validation of simulation results by comparing L-infinity distance and maximum peak displacement in voltage traces taken at mid-points and end-points of sections.

Note that these tests will broadly _fail_ at this point.

Reference data generation and visualization:
* Use voltage traces as validation data from NEURON; refactor generation scripts.
* Generate validation data as a dependency of `validation.exe`.
* Store validation data in a `tsplot`-compatible format.
* Extend `tsplot` to handle multiple time series per file, a non-time 'time' axis (see `-A` option), filtering of time series by meta data queries (see `-s` option).
* Remove pre-generated spike-time validation data files.

Core extensions:
* Add a single-cell `singleton_recipe` recipe wrapper.
* Allow cell descriptions to be cloned (explicitly) for use with this wrapper.
* Add `simple_sampler` which maintains a trace of scalar observables as a vector of (time, value) pairs.
* Allow cell groups to be exposed from `model` (used for post-synaptic event injection in synapse validation test.)

Utility extensions:
* Add `math::signum` function.
* Fix `value_type` determination in `util::transform_iterator` where the underlying iterator dereferences to a reference type.
* Add `util::max_element_by` and `util::max_value` sequence utilities to `rangeutil.hpp`.
* Small bug fixes for `util::optional` (one const correctness case, and proper behaviour for implicit conversion of `nothing_t` to `optional<void>`.)
* Generic `util::first` and `util::second` accessor functional objects for reference access to `std::pair` fields in the absence of generic lambda functions.
* Add `util::path` for path manipulation, corresponding to a subset of C++17 `std::filesystem::path` functionality. Only POSIX path semantics supported at this point.

Validation tests:
* Rework all validation tests as comparisons of voltage trace data against a (presumably converged) reference trace generated by NEURON.
* Add options to `validation.exe` driver for verbose output of test results (`-v`), limiting the compartment number in convergence tests (`-m`) and saving the generated traces to a `tsplot`-compatilble JSONfile (`-o`).
* Gather trace comparison metrics and analysis into `trace_analysis.hpp` and `trace_analysis.cpp`.
* Add super simple command line argument parsing utility `tinyopt.hpp`.
* Make a consistent naming of `ball_and_3stick` model across sources.
* New `ball_and_taper` model.
ee3b83c5
Name Last commit Last update
..
README.md
profstats
tsplot

tsplot

The tsplot script is a wrapper around matplotlib for displaying a collection of time series plots.

Input data

tsplot reads timeseries in JSON format, according to the following conventions.

{
    "units": <units>
    "name":  <name>
    <other key-value metadata>
    "data": {
        "time": [ <time values> ]
        <trace name>: [ <trace values> ]
    }
}

The data object must contain numeric arrays, with at least one with the key time; other members of data correspond to traces sampled at the corresponding time values.

The other members of the top level object are regarded as metadata, with some keys treated specially:

  • units are used to distinguish different axes for plotting, and the labels for those axes. It's value is either a string, where the specified unit is taken as applying to all included traces, or an object representing a mapping of trace names to their corresponding unit string.
  • name is taken as the title of the corresponding plot, if it is unambiguous.
  • label is ignored: the label for a trace is its name in the data object.

Operation

The basic usage is simply:

tsplot data.json ...

which will produce an interactive plot of the timeseries provided by the provided files, with one trace per subplot.

Grouping

Traces can be gathered on to the same subplot by grouping by metadata with the -g or --group option. To collect all traces with the same value of the key 'id' and the same units:

tsplot -g units,id data.json ...

A subplot can comprise data with to two differint units, and will be plotted with two differing vertical axes.

Note that for the purposes of tsplot, the value of the key label is the propertu name of the trace in its json representation.

Restricting data

The -t or --trange option exlcudes any points that have a time range outside that specified. Ranges are given by two numbers separated by a comma, but one or the other can be omitted to indicate that there is no bound on that side. For example:

tsplot -t ,100 data.json ...

will display all points with a time value less than or equal to 100.

Extreme values for data can be automatically excluded and marked on the plot with the -x or --exclude option, taking a parameter N. All values in a timeseries that lie outside the interval [ m - Nr, m + Nr ] are omitted, where m is the median of the finite values in the timeseries, and r is the 90% interquantile gap, that is, the difference between the 5% and 95% quantile of the timeseries data.

Output to file

Use the -o or --output option to save the plot as an image, instead of displaying it interactively.