Refactor the handling of polynomial coefficients.
Polynomial coefficients are now stored as an array of numpy.float64
as expected by Numba.
Prior to assignment the coefficients are validated such that they have the correct type and dimensionality (one or two), do not contain invalid values (inf, nan), have the correct length as expected by the active monomials.
Additionally:
- The property
nr_active_monomials
has been renamed tonum_active_monomials
. - A new verification function
verify_poly_coeffs()
is added to the codebase for specifically handling the verification/validation of polynomial coefficients before storing them as an instance property. - The test suite has been updated accordingly following this change.
- The docstrings of the relevant properties have been updated.
The behavior of raising an exception when accessing None
coefficients (non-initialized polynomials) are kept to simplify cause of error when the coefficients are required but not available.
This MR should resolve Issue #162 (closed).