constants#
The constants serve as predefined and standardized identifiers to ensure consistency and prevent potential spelling mistakes when referencing key elements, such as distributions and models, throughout the project. These constants act as safeguards, making the codebase more robust and less error-prone by eliminating the need for users to manually input or recall exact strings.
Instead of typing “gaussian” directly, users can use the predefined constant GAUSSIAN to avoid typos.
Aliases such as NORMAL for GAUSSIAN ensure semantic clarity while maintaining consistency.
This approach not only reduces the likelihood of errors but also improves code readability and maintainability.
How to use#
They are available for various uses cases, and can be called directly from pyMultiFit using
from pymultifit import EPSILON
from pymultifit import GAUSSIAN, LAPLACE