All notable changes to the Minterpy project is documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Domain support in
OrdinaryRegression:fit()andpredict()now expect input points in the user-defined domain - Documentation for the
Domainclass, its API reference, theoretical background, and examples - Domain support in interpolation module:
interpolate(),Interpolator, andInterpolantnow acceptboundsparameter to specify custom rectangular domains directly without manually creatingDomainobjects; the underlying interpolating polynomials are constructed with domain awareness interpolate_values()method inInterpolatorclass to interpolate pre-computed function values at unisolvent nodes, enabling reuse of function evaluations- Domain-aware polynomial differentiation:
diff()andpartial_diff()now automatically apply chain rule scaling factors when differentiating polynomials over user-defined domains - Domain-aware polynomial integration:
integrate_over()now automatically applies Jacobian scaling factors when integrating polynomials over user-defined domains - Domain-aware polynomial evaluation:
__call__()now accepts query points in the (user) domain with automatic transformation to the internal domain (currently[-1, 1]^m) eval_on_internal()method for direct polynomial evaluation in the internal domain, bypassing coordinate transformationDomainclass for handling transformation between user-defined rectangular domains and internal (reference) domains- Support for coordinate transformations via
map_to_internal()andmap_from_internal() - Automatic scaling factor computation for differentiation and integration
- Domain validation via
contains()method - Factory methods:
uniform()andidentity() - The property
is_identityindicates if the user-defined domain is identical to the internal domain
- Support for coordinate transformations via
- Domain support integrated into
Gridclassdomainparameter in Grid constructor (defaults to normalized domain in[-1, 1]^m)- Grid operations (
*,|) now validate domain consistency
- Domain property access in all polynomial classes via
poly.domainobtained from the correspondingGridinstance - Internal domain infrastructure in
Domainclass withinternal_boundsproperty
- Revised "change of basis" tutorial to emphasize the difference between Minterpy polynomials and the underlying basis polynomials
- Revised "polynomial regression" tutorial to demonstrate user-defined domain support
- (Breaking)
OrdinaryRegressionconstructor parameter ordering:origin_polyis now the last parameter, afterdomain - Relevant tutorials have been updated to reflect the new domain support
- Refactored
Interpolatorclass to use modernattrs.definesyntax instead of legacyattr.ibdecorators - Interpolation tests now cover both default (internal reference) and custom domain cases
- Zero-order differentiation now returns a copy of the polynomial (identity operation)
- Centralized polynomial differentiation tests into a dedicated test module
(
test_polynomial_differentiation.py); relevant tests from basis-specific test modules have been removed - Refactored
partial_diff()as syntactic sugar fordiff(), removing duplicate_partial_diff()static methods from the polynomial class hierarchy - Centralized polynomial integration tests into a dedicated test module
(
test_polynomial_integration.py); relevant tests from dedicated test modules (with respect to each basis) have been removed. - Grid generating points validation now uses
Domainclass for bound checking - Refactored polynomial arithmetic into modular components
- Optimized
MultiIndexSetequality check with identity short-circuit - Improved Newton polynomial monomial-based multiplication logic
- Strict bounds validation in polynomial integration: integration outside domain bounds is now allowed (extrapolation) but should be used with care
internal_domainanduser_domainproperties from polynomial abstract classcheck_domain_fit()verification function (replaced byDomain.contains())- the module
minterpy.utils.polynomials.interface
Version 0.3.1 - 2025-04-30
This minor release incorporates feedback from the review process of the Minterpy submission to the Journal of Open Source Software (JOSS). There are no changes to the package's functionality.
- Included the source code and manuscript for the JOSS paper in the repository.
- Revised and updated several documentation components, including
README.md,CONTRIBUTING.md, and the Getting Started guides.
- Support for the Chebyshev polynomials of the first kind as a polynomial basis
via
ChebyshevPolynomial. Differentiation and integration of polynomials in this basis are not yet supported. - Faster differentiation of polynomials in the Newton basis due to a Numba
implementation; the methods
diff()andpartial_diff()now support a keyword argumentbackendto select the numerical routine for differentiation. Supported values are:"numpy"(NumPy-based implementation used by default in v0.2.0-alpha),"numba"(Numba-based implementation, now the default),"numba-par"(CPU parallelization in the Numba-based implementation; may accelerate computation for larger problems). - Exact equality check via the
==operator has been implemented for instances of theGridclass. Two instances ofGridare equal (in values) if and only if both the underlying multi-index sets and generating points are equal. Note that as the generating points are of floating types, the equality check via==is exact without any tolerance specifications. - Exact equality check via the
==operator has been implemented for all instances of concrete polynomial classes. Two polynomials are equal in values if and only if the concrete class is the same, the multi-index sets are equal, the grids are equal, and the coefficient values are all equal. As coefficients are of floating type, the comparison is carried out exactly without any tolerance specifications. - Polynomial-(real)scalar multiplication is now supported for polynomial instances of all concrete classes. The implementation includes left-side and right-side multiplication
- All polynomial instances now has the method
has_matching_domain()method to check if a given instance has matching internal and user domains with another instance. The two polynomials do not have to be on the same basis. - Polynomial-polynomial multiplication in the Newton basis is now supported.
The implementation includes the left-side multiplication via
__mul__(). Multiplication with a constant polynomial returns a consistent result with multiplication with a scalar. - Polynomial-polynomial addition/subtraction as well as polynomial-(real)scalar
addition/subtraction are now supported for polynomials in the Newton basis.
The implementation includes the left-sided addition via
__add__()and subtraction via__sub__()(for both Newton polynomial and real scalar number) as well as right-sided addition via__radd__()and subtraction via__rsub__()(for real scalar numbers). - Static abstract method
_scalar_add()is now included in theMultivariatePolynomialSingleABCas a placeholder for the concrete implementation of scalar addition for polynomials. - Instances of
MultiIndexSetmay now be multiplied with each other; the result is an instance ofMultiIndexSetwhose exponents are the cross-product-and-sum of the two operands exponents. - A method
expand_dim()is introduced to instances of theGridclass to encapsulate the procedure of expanding the dimension of aGridinstance. - Add two new factory methods for the
Gridclass:from_degree()to create aGridinstance with a complete multi-index set andfrom_points()to create an instance with a given array of generating points. - Instances of
Gridhas nowhas_generating_functionproperty that returnsTrueif a generating function is defined on the grid andFalseotherwise. - Instances of
MultiIndexSethas nowmax_exponentandmax_exponentsproperties. The former is the maximum exponent across all dimensions in the multi-index set, while the latter is the maximum exponents per dimension. - An instance of
Gridis now a callable; when it is called with a callable or a function, the function will be evaluated on the unisolvent nodes of the grid and the corresponding function values are returned. - Instances of
Gridmay now be multiplied with each other via the*operator; this operation returns a new instance ofGridwhose multi-index set is the product of the multi-index sets of the operands. Procedures are implemented such that only instances that are compatible (w.r.t generating function or points) with each other can be multiplied. - Instances of
Gridmay now be unionized with each other via the|operator; this operation returns a new instance ofGridwhose multi-index set is the union of the multi-index sets of the operands. Procedures are implemented such that only instances that are compatible (w.r.t generating function or points) with each other can be unionized. - The method
make_downward_closed()is now available for instances of theGridclass. Calling the method results in a new instance ofGridwhose underlying multi-index set is downward-closed. - A new factory method
from_grid()is available for all concrete polynomial classes. Calling the method with an instance ofGridcreates a polynomial with the given grid and with the multi-index of the given grid. - All concrete polynomial classes now inherit
__len__()from the abstract base class. Callinglen()on a polynomial instance returns the number of coefficient sets the instance has. - Polynomial-polynomial multiplication is now supported for polynomials in the canonical basis.
- Instances of all polynomial bases may now be exponentiated by a non-negative
scalar whole number. Exponentiation by zero returns a constant polynomial
whose constant term is
1. Because the underlying implementation relies on the polynomial-polynomial multiplication, polynomials in the Lagrange basis may only be exponentiated with either0or1. - A new public method
is_compatible()is introduced in theGridclass to verify compatibility between two grid instances based on their generating functions and points. - Instances of all polynomial bases may now be divided by a real scalar number.
Both the
/(true division) and//(floor division) operators are supported. - Overhauled the "Getting Started" section in the documentation to include a quickstart guide for Minterpy and six in-depth tutorials. The tutorials cater to both beginner and advanced levels, starting from scratch and gradually introducing sophisticated Minterpy features.
- Added support for exponentiation of polynomials, which extents the support for arithmetic manipulations of polynomials.
- Added polynomial bases transformations to the Interpolant class.
- Major update to the contributors guide section of the documentation.
- Added
sphinx_designas new dependency for the documentation. - Added support for polynomial-scalar division.
- Negating a polynomial with a non-default Grid instance returns a polynomial with the default grid.
- The utility modules that were scattered across the codebase are now
collected inside the sub-package
minterpy.utils. The residing functions are supposed to deal with low-level computational details that support higher-level constructs of Minterpy such as polynomials, multi-index set, grid, etc. Vice versa, higher-level constructs should avoid directly deal with low-level array manipulations without interfacing functions. This reorganization has no effect on the overall code functionality. - The property
generating_valueshas been removed from theGridclass. Furthermore,generating_valuesdoes not appear in the default constructor ofGridand therefore is no longer required to construct an instance of the class. - Multi-index set is now a read-only property of
Gridinstances instead of an instance attribute. generating_function`` is now stored as a read-only property of aGrid` instances and also a factor in determining instances equality in value.generating_functionis now stored as a read-only property of aGridinstances and also a factor in determining instances equality in value.- The default constructor of the
Gridclass now accepts as optional argumentsgenerating_function(instead ofgenerating_valueswhich is deprecated) andgenerating_pointsboth are defaulted toNone. Ifgenerating_functionis not specified, then the default of Leja-ordered Chebyshev-Lobatto generating function is selected. This preserves the previous behavior of calling the constructor without any optional arguments. - The factory method
from_generator()of theGridclass has been renamed tofrom_function()to avoid confusion with the Python's term. - The generating points provided or created by a generating function for
an instance of the
Gridclass must now have unique values per column, otherwise an exception is raised. - The method
add_points()of theGridclass has been renamed toadd_exponents()to conform with a method of the same name of theMultiIndexSetclass that handle the process of adding exponents to the underlying multi-index set of aGridinstance. - Polynomial coefficients will now be stored as an array of
numpy.float64as expected by Numba. Conversion will always be attempted. - Polynomial-polynomial addition and multiplication of polynomials in the Chebyshev basis are now supported.
- Support for scalar addition and subtraction are moved to the abstract polynomial base class, which allows distinct implementations for the different polynomial bases.
- Polynomial-polynomial addition/subtraction of Newton polynomials with a common grid add the coefficients of their matching multi-index set elements instead of using base transformations.
- Revision and reorganization of the fundamentals section of the documentation.
- Reorganization of the API reference section of the documentation.
- Refactoring of the multiplication of all polynomial instances with a constant scalar polynomial, to avoid the usage of standard polynomial-polynomial multiplication and its related issues.
- Refactoring of the multiplication of all polynomial instances with a constant scalar polynomial, to avoid the usage of standard polynomial-polynomial multiplication and its related issues.
- The method
apply_func()of theGridclass previously not implemented (calling it raises an exception) is now removed completely in favor of__call__(). - General polynomial-polynomial addition/subtraction and multiplication for polynomials in the Lagrange basis is now removed to avoid unnecessary coupling with the Newton polynomial class and the corresponding transformation class.
This is the next alpha release of minterpy, which adds several
new functionalities and enhances code quality and performance.
- partial derivatives for canonical and Newton polynomials
- support of arbitrary positive
lp_degree - ordinary regression based on multivariate polynomials as the first extra feature
- bug fixes
- adding API documentation
- improvement of user documentations
- clean-up: deletion of code/comments, which are no longer used
- introduction of a corporate design including logo and banner to docs, repository, README etc.
This code is still marked as experimental and there is no assurance, that neither everything works as expected, nor if further releases will break the current API.
This is the initial alpha release of minterpy.
It contains general structures to perform the polynomial interpolation task
in multiple dimensions:
- Multivariate polynomial bases (ABC + concrete implementations)
- Base transformations
- Interpolation schemes
This code is still highly experimental and there is no assurance, that neither everything works as expected, nor if further releases will break the current API.