Pastas Code Style#
This page provides information on the code style to use when writing code for Pastas.
Pastas uses TypeHinting, which is used to check user-provided input options. Please provide TypeHints when creating new methods and classes.
Much of the Pastas code is highly optimized to main high speed and productivity. Please make sure to optimize your code in terms of performance, particularly when changing or adding methods that are called by ml.simulate and ml.solve. It may also be possible to use Numba for speed-ups.
Private methods in Pastas are identified by a leading underscore. For example:
This basically means that these methods may be removed or their behaviour may be changed without DeprecationWarning or any other form of notice.
When a message to the logger is provided, it is important to use the s-string format (no f-strings) to prevent performance issues:
>>> logger.info("Message here: %s", value)