Skip to content
Snippets Groups Projects
user avatar
Rob Moss authored
We now use nested data types to explicitly describe the state vector
structure and to avoid using magic numbers to select specific columns.

This makes the following changes the Model base class:

* Remove Model.describe() and Model.state_size();
* Add Model.state_fields();
* Add Model.bounds(); and
* Add Model.can_smooth().

Because subsets of structured arrays cannot necessarily be treated as
normal Numpy arrays, post_regularise() and ParamCovar.add_rows() must
now repack the relevant state vector columns into new arrays and then
use a non-structured view of this new array:

    x = numpy.lib.recfunctions.repack_fields(state_vec[names])
    x = x.view((float, len(names)))

This functionality is now provided by pypfilt.state.repack().

Note that this requires that each field is a scalar float value. It is
unlikely that this restriction can be lifted.
60bc49d0
History
Name Last commit Last update