How to update scripts from version 2.0 to 3.0.
FiPy 3.0 introduces several syntax changes from FiPy 2.0. We appreciate that this is very inconvenient for our users, but we hope you’ll agree that the new syntax is easier to read and easier to use. We assure you that this is not something we do casually; it has been over two and a half years since our last incompatible change (when FiPy 2.0 superceded FiPy 1.0).
All examples included with version 3.0 have been updated to use the new syntax, but any scripts you have written for FiPy 2.0 will need to be updated. A complete listing of the changes needed to take the FiPy examples scripts from version 2.0 to version 3.0 can be found at
The following items must be changed in your scripts
We have reconsidered the change in FiPy 2.0 that included all of the functions of the numerix module in the fipy namespace. You now must be more explicit when referring to any of these functions:>>> from fipy import * >>> y = numerix.exp(x)>>> from fipy.tools.numerix import exp >>> y = exp(x)
We generally use the first, but you may see us import specific functions if we feel it improves readability. You should feel free to use whichever form you find most comfortable.
the old behavior can be obtained, at least for now, by setting the FIPY_INCLUDE_NUMERIX_ALL environment variable.
The remaining changes are not required, but they make scripts easier to read and we recommend them. FiPy may issue a DeprecationWarning for some cases, to indicate that we may not maintain the old syntax indefinitely.
“getter” and “setter” methods have been replaced with properties, e.g., use>>> x, y = mesh.cellCenters
instead of>>> x, y = mesh.getCellCenters()