picmi-standard / picmi

Standard input format for Particle-In-Cell codes
https://picmi.readthedocs.io
Other
35 stars 25 forks source link

Removed SciPy references #35

Closed dpgrote closed 3 years ago

dpgrote commented 3 years ago

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 calling register_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.

ax3l commented 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?

dpgrote commented 3 years ago

@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.

ax3l commented 3 years ago

Thank you for the background, that makes sense to use them consistently then in all places. Cool!

ax3l commented 3 years ago

@dpgrote one last change: you can remove scipy from the setup.py dependency list then again with this PR :)