opinf.utils
#
Miscellaneous utility functions.
Timing Code#
Model reduction is all about speeding up computational tasks. The following class defines a context manager for timing blocks of code and logging errors.
Context manager for timing a block of code and reporting the timing. |
Load/Save HDF5 Utilities#
Many opinf
classes have save()
methods that export the object to an HDF5 file and a load()
class method for importing an object from an HDF5 file.
The following functions facilitate that data transfer.
Get a handle to an open HDF5 file to read from. |
|
Get a handle to an open HDF5 file to write to. |
Helper Routines#
The following functions perform miscellaneous tasks within the rest of the code base.
Wrapper for methods that require an attribute to be initialized. |
|
Wrapper for methods that require an attribute to be initialized. |
|
Canonical string representation for objects with a |
Regularization Selection#
These helper routines support automatic regularization selection.
Minimize a function by first checking a collection of candidates, then following up with a derivative-free optimization routine. |
|
Test case for regularization selection with fully discrete models. |
|
Test case for regularization selection with time-continuous models. |
Documentation#
The following function initializes the Matplotlib defaults used in the documentation notebooks.
Set matplotlib and pandas configuration defaults for the documentation notebooks. |