Closed dpgrote closed 3 years ago
Thank you, just saw this!
I might not get the implementation in full picture yet. Do you think this complicated the implementation downstream if those constants need to be defined by downstream? Or do we / can we fall back to some defaults?
@ax3l It is part of the standard that the implementation define the constants. Specifically, the implementation needs to define and object called 'constants' and use the standard names for the constants. The only additional code then in the implementation is passing that object to picmistandard.register_constants
.
Thank you for the background, that makes sense to use them consistently then in all places. Cool!
@dpgrote one last change: you can remove scipy
from the setup.py
dependency list then again with this PR :)
This removes the references to SciPy by allowing use of constants that are defined in the implementing code. The change adds
_implementation_constants
which is set by the implementing code by callingregister_constants
. Then internally, whenever a constant is needed, it should call_get_constants()
to retrieve the implementation's constant object.This avoids a potential problem created by having the constants defined in two different places, the implementing code and scipy. It is unlikely that there would be significant issue, but his avoids obscure problems that would arise if the constants in the two difference places have slightly different values.