Skip to main content

python library to interact with Integrated Water Flow Model (IWFM) applications

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iwfm-pywfm-0.2.5.tar.gz (73.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iwfm_pywfm-0.2.5-py3-none-any.whl (77.4 kB view details)

Uploaded Python 3

File details

Details for the file iwfm-pywfm-0.2.5.tar.gz.

File metadata

  • Download URL: iwfm-pywfm-0.2.5.tar.gz
  • Upload date:
  • Size: 73.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for iwfm-pywfm-0.2.5.tar.gz
Algorithm Hash digest
SHA256 f72a701b7763ccc8dbd618e7d34ebcd1aab5c5c6edc1241cd57789e5a14e88c1
MD5 0855758792cfa13d67ff26714971d5c2
BLAKE2b-256 08adfb58fd6a4f8f533f25ae254c3ff604fccb9bd41d5f8cec45967e0a720774

See more details on using hashes here.

File details

Details for the file iwfm_pywfm-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: iwfm_pywfm-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 77.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for iwfm_pywfm-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5b89bc57d9e6456124fd81b0e89b504112c8d7ed7fabdea81ba5c4f36def354f
MD5 c20bff19ad799f885c2e67a3395940c2
BLAKE2b-256 33ce48c5f5e3693af5857bd221e15f5651c19f94962a4daebce253cd35a45247

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page