Contribute Media
A thank you to everyone who has made this possible: Read More

Python for bridging between researchers and service operators: from CFFI to Jupyterhub


Kevin Plastow This talk will give an overview of a water forecasting system, which exposes via Python a suite of tools developed in C++ for hydrologists to use.

PySWIFT is a Python software system that allows the use of SWIFT (Short-term Water Information and Forecasting Tools), a hydrologic suite of tools for flood and short-term streamflow forecasting.

When integrating the SWIFT C++ system with Python, we aimed to achieve two main goals: 1. Provide a productive and interactive environment for hydrological modelling. 2. Take advantage of a complex multi-threaded C++ suite of tools that enables rapid execution.

To achieve the first goal, we created a modelling environment using JupyterHub. In this environment, modellers can set up, run, inspect and modify models, which is ideal to conduct exploratory experiments with the models. To achieve the second goal, we used CFFI to create a Python wrapper for SWIFT’s API. CFFI allows us to interact with SWIFT’s C interface.

In this presentation, we will highlight the challenges and learnings that came about whilst building this system.


Improve this page