pySWAP: Python wrapper for SWAP hydrological model
- Vrije Universiteit Brussel, Department of Hydrology and Hydraulic Engineering, Ixelles, Brussels, Belgium (mateusz.zawadzki@vub.be)
The Soil-Water-Atmosphere-Plant (SWAP) model has been continuously developed since 1974 and has gained a community of users. The need for clearer and more reproducible model development and interpretation drove the development of wrapper packages in R, such as SWAPTools and RSWAP. Due to the steady increase in the community of Python users, it became important to provide similar interface tools written in Python. This work introduces the pySWAP Python package, developed as a wrapper for the SWAP model.
A key feature of pySWAP is its user-friendly, object-oriented design. Users provide the essential model setup, for example, in the form of a Jupyter notebook, and the package creates the input files while preemptively checking for errors. This ensures a smooth setup and execution process, significantly reducing common user errors and streamlining the model setup. This is especially beneficial for those new to SWAP, who can easily access documentation through their Integrated Development Environments (IDEs). The package also runs the model, captures the results, and provides tools for simple data visualization.
pySWAP also aims to optimize work with multiple scenarios and the parameter estimation process. This is achieved through the integration of a SQLite database, which stores data from intermediate simulations. This method not only reduces file storage requirements but also enhances the efficiency of data retrieval and manipulation during and after simulation runs. The use of open-source SQLite is also beneficial for sharing models between users, as it can efficiently store input and output data of multiple models in a single file, accessible on all operating systems. Furthermore, we are in the process of developing a Dockerized version of PySWAP, which may further improve collaboration on models and allow users to effortlessly deploy and execute simulations developed on local machines on supercomputers.
As a proof-of-concept, we use pySWAP in the Grow project to develop a SWAP model for a pilot site in Kinrooi, East Belgium, where treated wastewater is reused through a subirrigation system.
How to cite: Zawadzki, M.: pySWAP: Python wrapper for SWAP hydrological model, EGU General Assembly 2024, Vienna, Austria, 14–19 Apr 2024, EGU24-19745, https://doi.org/10.5194/egusphere-egu24-19745, 2024.