1. Introduction
CyberWater is a U.S. National Science Foundation project that provides an open data and open model framework designed to facilitate the incremental and seamless integration of diverse datasets and models across multiple water science and engineering disciplines [
1,
2,
3,
4,
5]. CyberWater is built upon VisTrails, an open-source scientific workflow and provenance management system that supports data exploration, visualization, and reproducible research [
6]. VisTrails 1.0 release was in October 2007 and was officially supported for a decade until maintenance ceased in 2017. During that time, it was downloaded thousands of times [
6] and widely used to automate repetitive tasks such as simulations, data analysis, and data visualization [
6]. One of VisTrails’ key strengths was its extensibility, allowing developers to fundamentally adapt the software to their specific models and research needs. CyberWater built on this foundation, leveraging VisTrails’ extensibility to implement its own capabilities for open data and open modeling. However, VisTrails’ official development and maintenance ceased in 2017, leaving projects that depend on it—like CyberWater—responsible for maintaining VisTrails itself. This lack of upstream maintenance became increasingly problematic. By January 2020, Python 2—VisTrails’ underlying programming language—reached its official end-of-life and no longer received updates or security patches. Additionally, PyQt4, the Qt Graphic User Interface (GUI) toolkit used by VisTrails, has also reached end-of-life, making it difficult to find compatible dependencies.
In addition to addressing the legacy issues of VisTrails, upgrading from Python 2 to Python 3 enables CyberWater to leverage modern scientific packages like “Xarray”, “NumPy” and “Pandas”. These packages significantly enhance data processing capacity across various CyberWater modules. For example, “Xarray”’s advanced functionality for subsetting datasets by temporal or spatial coordinates used in CyberWater’s data agents depends heavily on “Pandas”. However, since Pandas has discontinued support for Python 2, these subsetting features would not function properly in the older environment, creating substantial roadblocks for users. Consequently, modules relying on “Xarray” could encounter runtime errors or lose critical functionality. More broadly, Python 2 lacks key features and performance optimizations that are essential for handling the large, multi-dimensional datasets commonly used in Earth science applications.
Another important benefit of the Python 3 migration is compatibility with “fsspec”, a powerful package that provides a unified interface for interacting with various file systems, including cloud storage, Hypertext Transfer Protocol (HTTP) servers, and local directories. However, “fsspec” is not compatible with Python 2, as it relies on modern asynchronous I/O capabilities and streamlined process management introduced in Python 3. For example, both “Xarray” and “fsspec” are utilized in CyberWater’s CMIPAgent to automatically access and retrieve data from the Coupled Model Intercomparison Project (CMIP), enabling seamless integration of distributed datasets for Earth science research and applications.
Geospatial data analysis is also an important component of geoscience research. CyberWater integrates Geographic Resources Analysis Support System (GRASS) geographic information system (GIS), which, through the Python upgrade, has been upgraded from version 7.2 to 8.3, introducing several significant advancements. GRASS GIS 7.2 had limited or no native support for Network Common Data Form (NetCDF) files, complicating work with multidimensional climate and geospatial datasets. In contrast, GRASS GIS 8.3 offers seamless import and export of NetCDF files. It also supports direct data import from URLs—something that 7.2 could not reliably do—streamlining data workflows. Furthermore, certain GRASS GIS–compatible open-source modules such as “r.slope.stability” [
7], require GRASS GIS version 7.8 or later for full Python 3 compatibility. These improvements in GRASS GIS 8.3 enhance CyberWater’s ability to handle large geoscience data and expand its applicability across diverse geoscience studies.
In general, Python 2 lacks key features and performance optimizations present in Python 3 that are crucial for efficient manipulation of large multi-dimensional datasets encountered in Earth science applications. Overall, upgrading VisTrails from Python 2 to Python 3 improves overall performance with faster data processing and optimizations from dependencies, improves stability from updated dependencies, and provides key new features that would never be able to use with the Python 2 version.
As a result of these compounded issues and potential advantages, it became clear that VisTrails became increasingly unsustainable. The CyberWater project saw security vulnerabilities emerge, logical errors appeared more frequently, and installation became increasingly difficult due to the dwindling availability of Python 2 libraries and dependencies. To address these issues and take advantage of the benefits that upgrading the framework provided, we launched an effort to modernize VisTrails and ensure its long-term viability in the context of CyberWater.
The modernization project followed a three-phase approach.
Upgrading the VisTrails source code from Python 2 to Python 3.
Updating VisTrails’ external dependencies to Python 3-compatible libraries.
Updating CyberWater’s own source code to be fully compatible with Python 3.
Most existing work focuses on categorizing software modernization but offers few examples or guidelines on when to apply certain specific techniques. This paper focuses on the sustainable computing perspective of this modernization effort, detailing the technical, organizational, and sustainability challenges involved in maintaining and evolving large-scale scientific software that lacks upstream support. Specifically, the following sections outline the technical upgrade process, the tools and methods used, the testing strategies employed, and the outcomes achieved. We also share key lessons learned regarding sustainable software evolution, with particular attention to the challenges posed by maintaining large-scale open-source software systems in the domain of scientific cyberinfrastructure. The goal is not only to showcase the modernization of the CyberWater-VisTrails project within the context of sustainable computing but also to provide strategies for determining when to apply specific modernization methods.
CyberWater Background
From a software perspective, CyberWater extends VisTrails by introducing two new packages: msm (Meta Scientific Modeling) and AgentTools. In VisTrails, a package is a set of “Python classes—called modules—stored in one or more files” [
6]. These modules define visualization and simulation code that users can incorporate into VisTrails workflows, which are sequences of interconnected modules forming an execution pipeline. VisTrail workflows are sets of modules connected to create a pipeline of execution. Both the msm and AgentTools packages offer numerous modules users can utilize in their workflows, as showcased in
Section 5.
The msm framework is divided into three sets of modules. The first set consists of data agents, which are CyberWater modules that download data from various online sources. The second set consists of model agents, which take workflow inputs, convert them into the file format required by the user’s model, and then execute the model. Once execution is complete, the model agent imports the results back into the workflow and makes them available as outputs for subsequent visualization or further processing. The third set of modules forms the system core.
The AgentTools framework includes the Generic Model Agent Toolkit, the Static Parameter Agent Toolkit, the High-Performance Computing (HPC) Launch Agent, and integration engines. The Generic Model Agent Toolkit enables users to create their own model agents via the VisTrails GUI workflow management system without writing code. The Static Parameter Agent Toolkit provides modules to help users prepare parameter files for their models. The HPC Launch Agent supports the execution of computationally intensive jobs on remote high-performance computing platforms on demand. Finally, the integration engines allow CyberWater to interoperate with external systems such as MATLAB 2022b and GRASS GIS 8.3. The overall structure of the CyberWater framework is shown in
Figure 1.
The remainder of the paper is organized as follows.
Section 2 overviews related works.
Section 3 presents our work and experience on the maintenance and upgrading of CyberWater and VisTrails, including used packages, in a systematic way.
Section 4 reports our testing and validation of the software upgrades. In
Section 5, we provide two real-world CyberWater application cases to illustrate the CyberWater system and its upgrading. Finally, Discussion and Conclusions are given in
Section 6 and
Section 7, respectively.
2. Related Work
The challenge of maintaining and evolving legacy software systems, particularly in scientific computing, has been widely documented in the software engineering literature. Legacy systems often form the backbone of scientific workflows, cyberinfrastructure platforms, and long-term research projects, but these systems face growing risks of obsolescence due to rapid technological changes, evolving computing environments, and the discontinuation of dependencies [
8,
9]. When such systems become unsustainable, they threaten the projects that depend on them.
The issue of upgrading legacy systems to modern platforms is a frequent topic of research, especially in cases involving language migrations such as the transition from Python 2 to Python 3. Previous work as seen in Cordy’s Source transformation, analysis and generation in TXL has explored both automated and manual approaches for language migration [
10]. However, automated tools often require significant manual intervention to handle complex cases such as changes to library semantics, data structures, and custom user interfaces as shown in Malloy’s analysis [
11]. For example, several projects have been developed to automate portions of the Python upgrade process through linters or conversion scripts. Notable examples include pyupgrade, Black, Ruff, Flake8, and pydocstyle. These tools are very useful for maintaining legacy software for specific Python syntax reasons. However, when more complex issues arise, such as problems that cannot be automatically fixed, a developer’s manual intervention is needed. Our work on VisTrails’ modernization aligns with these findings, combining automated tools with extensive manual testing and debugging to ensure a successful transition.
Several studies have also examined the challenges of open-source software sustainability, particularly when primary development teams discontinue support. According to Howison et al., open-source scientific software is particularly vulnerable because many projects rely on small academic teams with limited long-term funding [
12]. When funding cycles end or lead developers leave academia, the software is often left to “bit rot,” where its usability gradually degrades as dependencies and platforms evolve. Our work contributes to this conversation by presenting a real-world case study of a legacy system revival, highlighting both the technical and organizational challenges involved.
This section discusses two topics. The first subsection focuses on legacy system maintenance, including methodologies for upgrading legacy software. These methodologies are used to categorize the type of upgrade performed on the CyberWater-VisTrails framework. The second subsection discusses a sustainable computing framework, examining the layers of sustainability and various challenges involved in sustaining software. Both topics relate to software maintainability but from different perspectives. The first, Legacy System Maintenance, specifically addresses methods for maintaining legacy software. The second, Sustainable Computing Framework, considers sustainability in all types of software, not just legacy systems, and outlines challenges.
2.2. Sustainable Computing Framework
The concept of sustainable computing encompasses a broad set of practices aimed at ensuring the long-term usability, maintainability, and environmental efficiency of software and hardware systems. While much of the sustainable computing literature focuses on reducing the energy consumption of software systems as seen in [
17,
18], sustainable computing also incorporates principles of software sustainability, the long-term sustainability of the software tools and platforms that enable scientific discovery, which are particularly relevant to scientific cyberinfrastructure projects like CyberWater. As this paper demonstrates, maintaining and evolving large-scale scientific software like VisTrails is a critical aspect of sustainable computing, ensuring that past scientific investments remain accessible and usable for future research. For scientific software, sustainability is a multi-dimensional concept that includes:
Technical Sustainability: Ensuring the software can evolve alongside changes in programming languages, platforms, and dependencies. This requires modular design, version control, and continuous integration/testing frameworks that can accommodate future upgrades.
Operational Sustainability: Ensuring that the software remains deployable and usable as computing environments shift, for example, from local clusters to cloud platforms, or as system administrators adopt new security and access policies.
Community Sustainability: Building a user and developer community capable of collective maintenance, knowledge transfer, and shared governance. This reduces reliance on any single developer team or institution.
Scientific Sustainability: Ensuring the software continues to support reproducibility and transparent provenance tracking, so that scientific workflows built on the platform remain valid over time.
The VisTrails upgrade effort, framed within sustainable computing, highlights several key sustainability challenges faced by long-lived scientific software.
The end-of-life of Python 2 and PyQt4 created an urgent sustainability risk, as the software was no longer receiving security patches or community support. Sustainable scientific software must anticipate and plan for language and library lifecycles, either by ensuring backward compatibility or developing well-documented migration pathways.
- 2.
Automation and Tooling for Sustainability
While tools like 2to3.py provided initial automation for the Python 2 to 3 migration, they could not fully address custom extensions, GUI components, or scientific-specific modules. A sustainable computing framework should include semi-automated pipelines for dependency audits, migration recommendations, and compatibility testing.
- 3.
Continuous Integration and Testing
Sustainable software benefits from continuous integration pipelines that automatically test compatibility across supported platforms and configurations. This reduces the technical debt accumulated during long maintenance gaps. During the VisTrails modernization, we established such testing workflows to detect compatibility regressions and performance bottlenecks early.
- 4.
Scientific Reproducibility and Trustworthiness
Scientific software sustainability is tightly coupled with scientific sustainability—the ability to reproduce and verify results over time. In updating VisTrails, ensuring that historical workflows produced consistent outputs across Python versions was critical for maintaining scientific trustworthiness.
By integrating these principles into the VisTrails modernization, CyberWater contributes to the development of a sustainable computing framework for scientific cyberinfrastructure. While the technical upgrade (Python 2 to 3) was the immediate goal, the broader aim was to establish a pathway for continuous evolution, community participation, and scientific reliability, ensuring that CyberWater-VisTrails remains valuable resources for future researchers. The following sections detail the technical process, tools, and lessons learned, highlighting the importance of sustainable computing practices for ensuring the longevity and usability of scientific software.
3. Transition and Upgrading of Language, Software and Library
CyberWater was developed for both Python 2 and Python 3 but began facing maintenance issues after support for VisTrails ceased. Initially, the CyberWater team manually updated dependencies to keep VisTrails functional, but this approach became increasingly difficult over time as more dependencies became outdated. As a result, the functionality and security of the entire software were at risk, prompting the need for a larger upgrade process to resolve these issues and mitigate future risks.
The systematic upgrade of the CyberWater-VisTrails system was divided into three main components: upgrading Python, updating the associated Python libraries for VisTrails, and then transitioning CyberWater’s source code to Python 3. These three components had undergone the most significant changes over the five-year period when VisTrails ceased maintenance and CyberWater started its own upgrade project. These three components also formed the backbone of the CyberWater-VisTrails system. While other libraries were updated as well, their modifications were relatively minor in comparison.
Table 1 summarizes the major version changes, including the starting version, its release date, the updated version, and the updated version’s release date. These changes highlight the necessity of the updates, reflecting the lack of maintenance in the years between the conclusion of the VisTrails project and the CyberWater team assuming responsibility for its upkeep. A full overview of upgrade issues is provided in
Table A1 in
Appendix A.
At the time of the upgrade, the release date of each framework version was a key factor in deciding which version to adopt, especially for the Python upgrade. Python was the first component updated, and the latest version was chosen due to security concerns as Python 2.7 no longer receives updates. Subsequent framework balanced recency with compatibility with Python 3.9.10. For example, PyQt4 supports only Python 2.X, while PyQt5 supports Python version 3.7 and above. Visualization Toolkit (VTK) was upgraded to its latest version after extensive integration testing, as it supports all Python 3 versions. Finally, GRASS GIS 7.2, which relied on Python 2.7, was also upgraded to the most recent version to ensure compatibility with the overall CyberWater-VisTrails application. Although security improvements were a secondary motivation for these upgrades, compatibility with Python 3.9.10 was the primary driver for all frameworks except Python itself.
Even though Python, PyQt, VTK, and GRASS GIS are major framework upgrades, CyberWater-VisTrails utilizes 135 Python packages that were also updated in this upgrade process in addition to PyQt and VTK. These upgrades did not require extensive updates across the CyberWater-VisTrails source code, so only the four frameworks shown in
Table 1 will be covered. In summary, 2102 files within the CyberWater-VisTrails project were updated. About 594,299 lines of code were added, while 424,648 lines of code were deleted. For reference, CyberWater-VisTrails in total consists of 944,214 lines of code across 2248 files. This means about 93.51% of CyberWater-VisTrails files were affected by this upgrade and about 62.94% of CyberWater-VisTrails source code was affected by this upgrade. Because of the nature of recording lines changed within the project, it is difficult to quantify how many lines of codes were just updates, as a simple line change for source translation is both treated as a line addition and line deletion, nor do they provide a greater picture on the effort made to complete this upgrade. A major upgrade can still be seen on how widespread this upgrade process came to be through the number of files and lines of code that have been changed.
The first portion of the software that was upgraded was the VisTrails source code. CyberWater only makes up about 441,482 lines of code, or about 46.76% of the entire CyberWater-VisTrails software. The process was first source translating of the code from Python 2 to Python 3, utilizing scripts and documentation to update from PyQt4 to PyQt5, and various smaller updates for the 136 Python packages that were also updated like VTK and the VTK VisTrails package. The second step was with the CyberWater source code which followed very similar steps. First, translate the source code from Python 2 to Python 3, utilize scripts and documentation to update from PyQt4 to PyQt5, and update the usage of various smaller Python packages within the source code. No static analysis tools were used within this upgrade process. Because only minor testing was performed throughout the upgrade process, a more thorough functional testing phase was conducted after the whole conversion as described in future sections.
At the start of this upgrade, little support was available for updating the VisTrails project. Although the CyberWater team had access to publicly available user documentation and the VisTrails GitHub repository, both sources had not been updated since 2017. As a result, the transition process relied heavily on CyberWater’s own development resources, including its internal development documentation and the project’s private GitHub repository. While CyberWater is an open-source project, the source code for the current beta version has not been officially released. Prior to this upgrade, the CyberWater support framework was limited to maintaining the CyberWater source code (specifically, the AgentTools and msm VisTrails packages). Through this upgrade process, the CyberWater support framework was expanded to include the VisTrails source code as well, enabling better overall maintenance and preventing the software from falling behind on future updates.
4. Testing and Evaluation
Following the completion of all upgrades, a rigorous testing phase was conducted. Testing the VisTrails upgrade primarily relied on use-case scenarios rather than predefined test cases, as PyQt-based GUI functionality posed challenges for automated testing initially. One major challenge in testing came from the enforcement of a single encapsulating QApplication to structure the entire VisTrails application. This framework made it difficult to isolate functionalities for test cases. Python debuggers such as “pdb” also posed problems, as the application would often fail to initialize within a debugging environment. As a result, only simple unit tests could initially be conducted, and more sophisticated testing had to rely on pre-made workflows and use-case scenarios. Over time, however, debuggers like “pdb” would become more usable as the upgrade process progressed, allowing them to be integrated into the testing workflow.
The primary goal of testing was to identify any functional errors in the software following the upgrade. To achieve this, various example workflows created for the CyberWater-VisTrails beta version were utilized as test workflows. The Python 2 beta version of CyberWater-VisTrails is publicly available on the CyberWaterBeta GitHub repository (
https://github.com/cyberwaterproject/CyberWaterBeta (accessed on 27 October 2025)). The Python 3 version of CyberWater-Vistrails will be publicly available by the end of 2025. The testing workflows are publicly available on the CyberWater HydroShare resource (
https://www.hydroshare.org/resource/608d220c4f774aaaa7f81426011f6e8f/ (accessed on 21 July 2025)). Since they were originally developed for the Python 2-based beta version, they provided a valuable basis for comparison, highlighting potential issues users might encounter during workflow execution. While VisTrails includes built-in testing functions, these functions primarily evaluate core functionality rather than GUI behavior. Future maintenance efforts should establish comprehensive test cases to systematically validate new upgrades.
The testing environment varied since the testing phase was conducted by multiple developers using different PCs. Individual developers worked on separate machines to simulate a user’s experience with CyberWater-VisTrails. Because Windows is the primary operating system targeted for CyberWater, more extensive testing was performed on Windows 10 and Windows 11, while other operating systems like Ubuntu received less coverage.
Two physical hardware limitations were also focused on during testing to evaluate whether CyberWater-VisTrails’ minimum hardware requirements needed revision: 6 GB of RAM and a 2.1 GHz core processor. Performance was assessed against these hardware and operating system conditions, though—as stated earlier—the primary focus of the testing phase was functionality, with performance treated as a secondary objective.
The testing phase was organized into four main categories:
Basic Initialization—software startup and GUI responsiveness.
Core Functionality—workflow creation, updating, and execution in VisTrails.
Advanced Functionality– features such as mashups, database storage of VisTrails objects, and exploration tools.
Performance Review—workflow execution speed and initialization efficiency.
All four categories revealed bugs and issues that required resolution, but the Core Functionality and Advanced Functionality phases uncovered the most significant cases worth highlighting. In the following subsections, three key issues encountered during testing and their implications for future maintenance will be highlighted. The first issue arose from Python’s method resolution order (MRO) in class hierarchies with multiple inheritance. The second involved a RuntimeError related to PyQt objects being deleted on the C++ side but still accessed later in Python. The third issue occurred when trying to connect to a remote HPC platform that requires two-factor authentication.
4.3. Issue 3: Operational Sustainability for Connecting to HPCs with Two-Factor Authentication
The transition of CyberWater-VisTrails to Python 3 revealed areas of the CyberWater codebase that needed updates for reasons beyond Python 3 or library upgrades. The CyberWater HPC module initially assumed that logging into any HPC cluster using Secure Shell (SSH) required only a username and password. However, many HPC clusters have since adopted more secure connection methods, such as two-factor authentication (2FA). To accommodate these changes, the HPC module needed to be updated to support 2FA. To enable 2FA support, a new checkbox was added to the module configuration. Users can check this box to indicate that 2FA is required for their connection.
In the previous implementation, the system attempted to connect using the username and password via the “paramiko” library (see
Figure 12). The “paramiko” is a Python library that implements the SSHv2 protocol. The “paramiko” library is one of the most popular Python packages for SSH support, so naturally the library was used with the HPC module. However, if the connection required an additional 2FA passcode, the connection would fail.
To resolve this, the system was updated utilizing the “paramiko” library to handle interactive authentication. This method mimics the terminal login process, where the connection initiates, prompts are received, and responses are sent back. A handler function is passed to manage the interaction.
Figure 13 showcases the updated source code that handles interactive authentication.
The handler function is invoked when the server sends a prompt (e.g., “Password:”). It checks the prompt for keywords that indicate whether the system needs to provide a password or the 2FA code. Based on the prompt, the appropriate response is sent to the server, as shown in
Figure 14.
The 2FA checkbox allows users to choose between using the HPC module in its original form (non-2FA connections) or utilizing the new features for supporting 2FA. These features were tested across various HPC connections with CyberWater-VisTrail workflows. As the checkbox introduces new features, it could raise the possibility of new bugs and design issues, making it essential to include these new features in the testing phase. During the testing phase, a comprehensive validation process was conducted. Fourteen representative workflows were tested, all 91 of CyberWater developed modules were tested, and the majority of VisTrails core functionalities, including the workflow management system, provenance management, explore system, and file import/export system, were systematically verified. In the early stages of testing, many workflows initially failed. However, these issues were progressively resolved. While the upgrade did not immediately yield a significant improvement in workflow execution performance, the successful transition to Python 3 has laid a modern, robust foundation for future performance optimization efforts.
These issues underscore the importance of not only upgrading software components but also addressing legacy logical errors that persist across versions, as well as operational sustainability for evolving security and access policies for the CyberWater project. Future maintainers must rely on thorough debugging and source code analysis to diagnose and resolve such problems efficiently. Given the limited documentation available for VisTrails, maintainers should prioritize code comments and structured documentation to facilitate future upgrades and troubleshooting.
A survey conducted for the Annual International Conference on Design of Communication: Documenting & Designing for Pervasive Information found that, regardless of the intended usage, software engineers ranked source code as the most valuable artifact [
21]. The second most valued artifact was code comments. This finding highlights that class documentation, use case documentation, and other design documents are not always essential for understanding a software system. A developer can often comprehend both the problem and the software itself solely by examining the source code. However, this approach is not the most efficient, as reading well-structured design documents is easier and faster than deciphering the source code that emerges from those documents.
5. CyberWater Application Examples
Two CyberWater workflow examples are provided here to showcase the functionalities that can be done now with the upgraded Python 3 CyberWater-VisTrails and GRASS 8.3. The first example focuses on the West Branch Susquehanna Watershed, and the second on the Indiantown Run Watershed, both located in Pennsylvania, U.S.A.
5.1. West Branch Susquehanna Watershed Example
In the first example, the workflow includes model coupling simulations using two models with two different datasets for the West Branch Susquehanna (WBS) River Basin, which spans over 17,700 square kilometers. The two models, coupled with each other, are the Variable Infiltration Capacity (VIC) model [
22,
23] version 5.0 (VIC5) and a routing model [
24]. The simulation period covers 15 March 1997, to 15 May 1997. The first simulation uses a complete set from NASA Land Data Assimilation System (NLDAS) as VIC5 model’s forcing data, which is automatically retrieved via CyberWater’s NLDASAgent module. The NLDASAgent module’s purpose is to download data from NASA Land Data Assimilation System. The NLDASAgent module takes in needed inputs like username, password, time range, space range, and a list of variables to download forcing data for models like VIC5. The second simulation uses hybrid data retrieved from two different data sources as VIC5’s forcing data. The two data sources are:
The ERA5 atmospheric forcing variables, 2 m air temperature, 10 m U wind component, 10 m V wind component, and surface pressure, were retrieved using the NetCDF4ToDataset module from ERA5’s data links/URLs, while the remaining variables (precipitation, longwave and shortwave radiation, and specific humidity) continue to be sourced from NLDAS. The NetCDF4ToDataset module converts NetCDF4 files into Python dataset classes that other CyberWater modules can utilize. The NetCDF4ToDataset module uses the “fsspec” and “Xarray” Python packages to subset remote NetCDF files based on the specified time range and study area. The use of “fsspec” and “Xarray” functions to subset remote data to be retrieved is critical, because—for example—when using the ERA5 2 m air temperature variable, the full file covering the required period (from the beginning of March 1997 to the end of May 1997) is approximately 4.31 gigabytes. By applying spatial and temporal subsetting through the NetCDF4ToDataset module, the amount of data downloaded is reduced to just 435 KB, significantly optimizing resource usage. This highlights the importance of using the NetCDF4ToDataset module, which is only possible with Python 3, to extract only the necessary data via subsetting.
The ERA5 data retrieved from the National Center for Atmospheric Research (NCAR) Research Data Archive (
https://rda.ucar.edu/ (accessed on 18 July 2025)), with an hourly temporal resolution and an original spatial resolution of 0.25 degrees, are subsetted based on the temporal range and spatial extent of our study area—WBS river basin, allowing only the relevant variables and region to be extracted. These data are then resampled to 0.125 degrees using the Resample module to match the resolution required by the VIC5 model. As illustrated in
Figure 15, the complete workflow includes data access, subsetting based on the study area and time range, preparation of the forcing datasets, and coupling the VIC model with the Routing model to generate streamflow.
Figure 15a,b highlight the NLDAS and ERA5 data groups used in the workflow, respectively. A comparison of the two simulation outputs is shown in
Figure 16, which also includes observed streamflow data from the United States Geological Survey (USGS) at the WBS river basin’s outlet location (USGS Site ID: 01553500), retrieved using the UsgsAgent module. For more information about the data and model agents used in the example, readers are referred to [
1]. The objective of this example is to demonstrate the importance of subsetting large datasets from data sources using upgraded Python 3 through a workflow which accomplishes the tasks of accessing forcing data online, processing and subsetting the data, utilizing the data to execute hydrological model simulations, and evaluating the model simulation results with observations.
5.4. Walkthrough of Indiantown Run Watershed Example
The first step of the workflow involves defining the temporal and spatial range of the model using the TimeRange and SpaceRange modules. The starting time for this example is “1 January 2007 00:00:00” and the ending time is “1 June 2007 00:00:00”. The spatial domain is defined as: x_min = −76.75, x_max = −76.5, y_min = 40.375, and y_max = 40.5.
With the temporal and spatial ranges defined for the simulation, the next phase of the workflow is data acquisition and data handling. Three data agents are used in this workflow—the NLDASAgent, UsgsAgent, and DEMAgent modules—each described earlier. While all share the same case study, they acquire different datasets for use with the models within the workflow.
In this example, the NLDASAgent acquires five variables directly from NLDAS. Through msmUnitConversion modules, two of these variables are converted into different units. In addition, two new variables are derived from the original five using the msmDatasetOperation module. These operations yield a total of six variables for use in the models.
Radiation Flux Long Wave [W/m2];
Radiation Flux Short Wave [W/m2];
Temperature [K];
Total Precipitation [m/h];
Wind Speed [m/s];
Relative Humidity [kg/kg].
The configuration of the NLDASAgent modules is shown in
Figure 20.
The NLDAS-acquired data are then used to drive the DHSVM, which is subsequently compared against observed streamflow measurements acquired from USGS. The DHSVMAgent_g module, which executes the DHSVM, requires six specific input datasets for model execution. These datasets are connected to the corresponding NLDAS outputs, as shown in
Figure 18a.
HUMIDITY: [kg/kg] Specific humidity;
LONG WAVE: [W/m2] Long-wave downwards radiation;
SHORT WAVE: [W/m2] Short-wave downwards radiation;
PREC: [m] Total precipitation per time-step;
TEMP: [C] Air temperature;
WIND: [m/s] Total magnitude of wind speed.
Using these inputs, the DHSVMAgent_g simulates streamflow, which is then compared to observed data acquired via the UsgsAgent module. The UsgsAgent is configured to acquire streamflow data using the following parameters:
The msmUnitConversion module converts the DHSVM streamflow output into cubic meters per second (m
3/s). The output from UsgsAgent can then be linked to msmShowChart along with the output of DHSVMAgent_g, enabling a comparison between observed data and the DHSVM results. The comparison, as visualized by msmShowChart, is shown in
Figure 19.
The second part of the workflow demonstrates CyberWater’s integration with GRASS GIS. Data acquisition is performed by the DEMAgent module, which requires a connection to the GISEngine module. The GISEngine initializes the GRASS GIS environment within Python, allowing subsequent GRASS GIS modules such as DEMAgent and GISRunModuleAgent to execute GRASS GIS scripts. The DEM data acquired by DEMAgent is passed to the first GISRunModuleAgent, named “g.region” in
Figure 18a. As the name suggests, this agent executes the GRASS GIS script “g.region.raster”, which generates a raster map of the initialized region.
The output from “g.region” GISRunModuleAgent’s Ready port is then passed to the next GISRunModuleAgent, “r.geomorphon”. The Ready output port acts as a flag, indicating whether the next module should be executed, and is used as a mechanism to organize the execution sequence of GRASS GIS operations in CyberWater. The “r.geomorphon” script identifies surface forms based on terrain shape and arrangement. Its Ready output is subsequently connected to the next GISRunModuleAgent, Save, which executes the GRASS GIS script “r.out.text”. The script converts the raster map layer into a GRASS American Standard Code for Information Interchange (ASCII) text file.
The Ready output port of the “Save” GISRunModuleAgent is connected to the final GISRunModuleAgent, “Category”. The “Category” module executes the GRASS GIS script “r.category”, which manages category values and labels associated with user-specified raster map layers.
Since the GISRunModuleAgent operates outside the CyberWater-VisTrails framework, its output must be imported back into the system. This is accomplished with the DirToStaticDataSet module, which creates a single dataset from an operating system folder. Only one map is expected to be loaded as a static map, specifically the file saved by the “Save” GISRunModuleAgent.
The imported dataset is then passed to the msmAnimation module to visualize the output from “r.geomorphon”. The msmAnimation module generates an animated Graphics Interchange Format (GIF) from the dataset produced by DirToStaticDataSet. The resulting visualization is shown in
Figure 18c.
6. Discussion
The approach taken for this maintenance upgrade of CyberWater-VisTrails would not be sustainable for future updates. While reengineering may be necessary for major upgrades, a more sustainable strategy would be to conduct maintenance earlier and on a more regular basis. Addressing issues incrementally prevents them from accumulating into large-scale overhauls, reducing the time and effort required for future upgrades. For example, rather than debugging a complex issue involving deprecated C/C++ methods, redefined classes, and other bugs all at once, proactive maintenance might limit the scope to just one of these changes. Regularly checking for software updates during available maintenance periods can enable shorter, more manageable upgrade cycles.
Some parts of VisTrails’ source code, however, require reengineering to minimize the impact of future maintenance. A notable example is the VTK package, whose wrapper is currently fragile and likely to break with future VTK updates. The most critical improvement would be enhancing the system that determines whether a class is abstract. As previously noted, updating the VTK wrapper currently involves adding abstract classes to disabled class, module, and method lists. The decision to reengineer ultimately depends on how much a solution impacts future maintenance. In the case of VTK wrapper, a simple fix does not address the growing disabled classes list and the slow process of determining which classes should not be imported. A more sustainable solution is to reengineer the wrapper so that it dynamically disables classes that cannot be imported because they are abstract. Automating this process would significantly streamline future maintenance.
Reengineering, however, can be costly. As noted in the introduction, reengineering follows a reverse engineering process where an existing system is analyzed, redesigned, and redeveloped to produce a more modern version. This often requires rebuilding the system from the ground up. By contrast, a “fix-as-we-go” approach modernizes only enough to preserve the system’s original functionality. While this method demands less time and effort, it results in short-term fixes that complicate future development.
Maintenance should be streamlined so developers can focus on expanding software rather than repeatedly repairing its foundations. During this upgrade project, several candidates for reengineering emerged. The most significant was the VisTrails VTK wrapper, but challenges such as VisTrails’ reliance on multiple inheritance with PyQt and CyberWater’s rigid integration of GRASS GIS also highlighted the need. One missed opportunity in this upgrade was the limited use of reengineering. Time constraints and the small number of developers available often made the quicker “fix-as-we-go” path more appealing, even though it might compromise long-term maintainability.
In the case of VTK wrapper, applying a simple fix does not resolve the broader concern of an ever-growing disabled classes list and the slow process of determining which classes should be excluded from import. A more sustainable solution is to reengineer the process so that the wrapper dynamically disables classes that cannot be imported because they are abstract. This automation is already partially implemented. When a class is imported, the system first checks whether it appears in a hardcoded obsolete list. If not, VisTrails attempts to instantiate the class via the VTK Python package. If instantiation raises a TypeError or NotImplementedError, the class is identified as abstract; otherwise, it is valid. The logic is illustrated in the is_abstract() method. For every VTK class, each method is mapped to either an input or output port depending on its use case. Their parameters are then validated with is_type_allowed(), which checks only whether a type appears in the disabled_classes or disallowed_types lists. During the upgrade from VTK 5.10 to VTK 9.3, various errors surfaced when VisTrails attempted to instantiate vtkWeakPointers. This vtkWeakPointer type is not intended to be instantiated—it exists solely for the C++ side of VTK. However, the current VisTrails process assumes that nearly all types are instantiable, which is not the case. The quick workaround was to disable all methods involving vtkWeakPointer, but this inadvertently removed access to valid methods that could otherwise be used within VisTrails.
Exploring the VTK wrapper highlighted several challenges and potential development pitfalls, but it also provided valuable lessons for future CyberWater-VisTrails developers and maintainers. The consideration is whether reengineering the wrapper yields long-term efficiency gains. Each upgrade currently with the VisTrails VTK wrapper requires expanding the hardcoded disabled classes lists, leading to software bloat: easy to maintain at a basic level, but inefficient and error-prone for rapid iteration. Effective software maintenance relies on striking the right balance between simplicity and flexibility within the project’s constraints.
That said, not every issue requires reengineering. Some challenges can be addressed using other software evolution techniques, such as replacement, translation, or wrapping. While reengineering demands a substantial upfront investment, it can save significant time in the long run. However, for certain bugs, a quick resolution that does not impact long-term maintenance may be preferable. By balancing these strategies, future VisTrails maintenance can become far more efficient and sustainable.