Skip to content

Reorganize the utility modules across the codebase into a sub-package.

Damar Wicaksono requested to merge dev-114 into dev

This merge request includes the reorganization of various utility modules that are scattered across the codebase. Most utility modules are now centralized in the subpackage minterpy.utils that contains different modules named after the context in which they appear (e.g., multi_index, verification). The main idea of such reorganization is to distinguish a bit more clearly different layers of abstractions in Minterpy.

The functions inside minterpy.utils are supposed to be low-level in the sense that they operate on lower-level data structures such as NumPy arrays, numbers, etc. They are not supposed to directly deal with Minterpy higher-level constructs such as instances of concrete polynomial classes, MultiIndexSet, Grid, etc.

Vice versa, in the upper layer of abstraction, we try to minimize functions or methods that directly deal with lower-level data structures. Interface functions will be created to facilitate the bridging.

An example of such functions are the computation of quadrature weights in the polynomial definite integration. The definite integration of each polynomial involves the multiplication of quadrature weights and the polynomial coefficients. The computation of the quadrature weights, however, requires lower-level array manipulation using functions that live on minterpy.utils. Therefore, the weights computations are refactored as separate functions in the interface module.

While these changes affect import statements throughout the codebase, the code functionality itself remains unchanged.

This MR should resolve issue #114 (closed).

Merge request reports

Loading