Skip to main content

PyWFM


python library to expose the functionality of the IWFM DLL

Full documentation of PyWFM is available here

To use the pywfm module, users need to download this repository

Note Users must also download the IWFM DLL.

The IWFM DLL can be downloaded from the CNRA Open Data Platform

Overview


The pywfm library includes 3 main classes (IWFMModel, IWFMBudget, and IWFMZBudget). Each of these inherits from the IWFMMiscellaneous base class. Many of the methods in the IWFMMiscellaneous base class cannot be used on their own because the IWFMMiscellaneous class was designed without direct access to the IWFM DLL. Users can access all of this functionality from within the IWFMModel, IWFMBudget, and IWFMZBudget classes.

Design


The pywfm library wraps each of the IWFM DLL functions so that the user does not have to deal with the IWFM DLL syntax directly. Instead, users familiar with python can work with standard python objects such as strings, ints, floats, lists, and numpy arrays.

Many parts of the IWFM DLL procedures are handled internally allowing the user to provide only a few pieces of required information to obtain results.

IWFMModel

the IWFMModel class can be run in two modes.

  1. is_for_inquiry=0, which allows running model simulations from python and interacting with the model simulations at runtime
  2. is_for_inquiry=1, which allows obtaining data from a model that has already been completed

IWFMBudget

the IWFMBudget class performs budget processing from the HDF output files

IWFMZBudget

the IWFMZBudget class performs ZBudgets based on user provided zone definitions and the HDF output files

IWFMModel methods

To obtain data from an already completed model, use the following code:

# import libraries
from pywfm import IWFMModel

# set paths to files needed to create model object
preprocessor_in_file = 'SampleModel/Preprocessor/PreProcessor_MAIN.IN'
simulation_in_file = 'SampleModel/Simulation/Simulation_MAIN.IN'

# create instance of the IWFMModel class
m = IWFMModel(preprocessor_in_file, simulation_in_file)

To see all methods available within the IWFMModel class, type the following:

from pywfm import IWFMModel

help(IWFMModel)

IWFMBudget methods

To use IWFMBudget, use the following code:

# import libraries
from pywfm import IWFMBudget

# set paths to files needed to create budget object
gw_budget_file = 'SampleModel/Results/GW.hdf'

# create instance of the IWFMBudget class
gw_budget = IWFMBudget(gw_budget_file)

IWFMZBudget methods

To use IWFMZBudget, use the following code:

# import libraries
from pywfm import IWFMZBudget

# set paths to files needed to create zbudget object
gw_budget_file = 'SampleModel/Results/GW_ZBud.hdf'

# create instance of the IWFMZBudget class
z = IWFMZBudget(zbudget_file)

Metadata

Release files for iwfm-pywfm 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iwfm-pywfm 0.2.5
File Size Uploaded
iwfm-pywfm-0.2.5.tar.gz 73.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iwfm-pywfm 0.2.5
File Interpreter ABI Platform
iwfm_pywfm-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 151.3 kB

Release files / iwfm-pywfm-0.2.5.tar.gz

Download URL iwfm-pywfm-0.2.5.tar.gz
Size 73.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f72a701b7763ccc8dbd618e7d34ebcd1aab5c5c6edc1241cd57789e5a14e88c1
BLAKE2b-256 checksum
How to use checksums
08adfb58fd6a4f8f533f25ae254c3ff604fccb9bd41d5f8cec45967e0a720774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / iwfm_pywfm-0.2.5-py3-none-any.whl

Download URL iwfm_pywfm-0.2.5-py3-none-any.whl
Size 77.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b89bc57d9e6456124fd81b0e89b504112c8d7ed7fabdea81ba5c4f36def354f
BLAKE2b-256 checksum
How to use checksums
33ce48c5f5e3693af5857bd221e15f5651c19f94962a4daebce253cd35a45247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page