Bookmark and Share FiPy: A Finite Volume PDE Solver Using Python
Version 3.0.1-dev139-ge5d2233

This Page

Contact

FiPy developers
Jonathan Guyer
Daniel Wheeler
James Warren

Join our mailing list

100 Bureau Drive, M/S 6555
Gaithersburg, MD 20899

301-975-5329 Telephone
301-975-4553 Facsimile

examples.updating.update2_0to3_0ΒΆ

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

but we summarize the necessary changes here. If these tips are not sufficient to make your scripts compatible with FiPy 3.0, please don’t hesitate to ask for help on the mailing list.

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.

    Note

    the old behavior can be obtained, at least for now, by setting the FIPY_INCLUDE_NUMERIX_ALL environment variable.

  • If your equation contains a TransientTerm, then you must specify the timestep by passing a dt= argument when calling solve() or sweep().

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.