Reorganize the source code of Minterpy
As new functions and modules are introduced to implement new functionalities, the codebase of Minterpy grows steadily. How the functions are organized within the modules, however, are not always logical or intuitive. It may now be a good time to do some cleaning up.
Take, for instance, the minterpy.jit_compiled_utils
module. The module is supposedly contains numba-optimized functions.
But numba-optimized functions also appears in minterpy.schemes.barycentric.precomp
module and some other places.
Consequently, it is not very easy to spot jit-compiled functions as they are scattered in several places.
On the other hand, I also don't think it would be nice to dump all jit-compiled functions in one module.
I'd like to propose collecting all jit-compiled utilities belonging to a particular context in a specific module.
For instance, the jit-compiled functions related to multi-index set (e.g., index_is_contained()
, all_indices_are_contained()
) should be collected together and separated from, say,
the jit-compiled functions related to polynomial evaluation (e.g., eval_newton_monomials_single()
).
Another common problem is the module utils
in different sub-packages; this kind of modules is typically used as a place to dump unrelated functions that are seemingly generic (either w.r.t sub-packages or the whole package) but are actually not (e.g., it is used only in one place).
A suggestion to deal with this is to evaluate whether a function is used in multiple places within a subpackage (resp. package wide) and whether the function is really "utility" in nature; if not, then perhaps the function should be put in the module where it is used or in a new more-aptly-named module (instead of "utils.py")
This kind of reorganization (including, perhaps, renaming low-level functions) is in principle a refactoring; the behavior of the package should not be altered.