Infowater.pro Class

infowater.pro

The infowater.pro module provides application-level Python access while a model project is open in ArcGIS Pro. Use it to get project context, list and activate scenarios, run and load simulations, and resolve result file paths.

To read pressures, flows, and other numeric results, call simulation_open_output(). It returns an infowater.output.manager.Manager instance, the same class you get from Manager(path) when you pass the path to an output file (for example, HYDQUA.OUT). All result methods, such as get_range_data() and get_metadata(), are documented in Infowater.output.manager Class.

After importing the module, call its functions directly. Refer to Introduction for details on setting up a Python Notebook in ArcGIS Pro.

>>> import infowater.pro as iwp

Module contents at a glance

Member Kind Description
SimulationMode Enumeration Mode in which a simulation runs (foreground or background).
SimulationStatus Enumeration Status of a simulation.
SimulationType Enumeration Type of simulation (standard, fire flow, surge, and so on).
project_get_context() Function Get project context information.
scenario_activate() Function Activate a scenario.
scenario_get() Function Get scenario details.
scenario_list() Function List scenarios.
simulation_get_paths() Function Get paths for simulation result files.
simulation_load() Function Check simulation status and load simulation results.
simulation_open_output() Function Open the output file for simulation results as a Manager instance.
simulation_run() Function Run a simulation.

class infowater.pro.SimulationMode(*values)

Simulation mode.

Member Description Type
STANDARD Run simulation in foreground int
BACKGROUND Run simulation in background int

class infowater.pro.SimulationStatus(*values)

Simulation status.

Member Description Type
NONE No corresponding simulation int
FAILED Simulation failed int
SCHEDULED Simulation scheduled int
RUNNING Simulation running int
SUCCEEDED Simulation succeeded int
WARNING Simulation succeeded with warnings int

class infowater.pro.SimulationType(*values)

Simulation type.

Member Description Type
STANDARD Standard hydraulic simulation int
FIREFLOW Fireflow simulation int
MULTI_FIREFLOW Multi-fireflow simulation int
SCADA Standard hydraulic simulation with SCADA data int
HYDRANT_CURVE Hydrant curve simulation int
SYSTEM_CURVE System curve simulation int
SURGE Surge simulation int
BREAK Pipes break simulation int

project_get_context()

infowater.pro.project_get_context() → dict

Get project context information.

Examples

>>> import infowater.pro as iwp
>>> iwp.project_get_context()
{'projectKey': '...', 'sourceDatabase': '...', 'cacheDatabase': '...', 'activeScenario': '...', 'scenarioOutputFolder': '...'}

scenario_activate()

infowater.pro.scenario_activate(id: str, apply_facility: bool = True, no_reactivate: bool = True, use_cache: bool = False) → str

Activate a scenario.

Examples

>>> import infowater.pro as iwp
>>> iwp.scenario_activate('MIN')
'MIN'

scenario_get()

infowater.pro.scenario_get(id: str = '') → dict

Get scenario details.

Examples

>>> import infowater.pro as iwp
>>> iwp.scenario_get('MAX')
{'ID': 'MAX', 'DESCRIPT': 'Maximum Demand', 'PARENT': 'BASE', 'DMD_SET': 'MAX', 'TANK_SET': 'BASE', 'RES_SET': 'BASE', 'PUMP_SET': 'BASE', 'VALVE_SET': 'BASE', 'PIPE_SET': 'BASE', 'CTRL_SET': 'BASE', 'ENG_SET': 'BASE', 'FF_SET': 'BASE', 'LOGIC_SET': 'BASE', 'QUAL_SET': 'BASE', 'SCADA_SET': 'BASE', 'PATN_SET': 'BASE', 'CURVE_SET': 'BASE', 'SURGE_SET': 'BASE', 'LEAK_SET': 'BASE'}

scenario_list()

infowater.pro.scenario_list(parent: str = '') → list[str]

List scenarios.

Examples

>>> import infowater.pro as iwp
>>> iwp.scenario_list('BASE')
['SUBDIVISION', 'MAX', 'MIN']

simulation_get_paths()

infowater.pro.simulation_get_paths(type: SimulationType, id: str = '') → dict

Get paths for simulation results.

Examples

>>> import infowater.pro as iwp
>>> iwp.simulation_get_paths(iwp.SimulationType.STANDARD)
{'input': '...', 'output': '...', 'report': '...'}

simulation_load()

infowater.pro.simulation_load(load_all: bool = False) → SimulationStatus | int

Check simulation status and load simulation results. You can also use this function to check the status of the simulation for the active scenario.

Examples

>>> import infowater.pro as iwp
>>> iwp.simulation_load(False)
<SimulationStatus.SUCCEEDED: 3>

simulation_open_output()

infowater.pro.simulation_open_output(type: SimulationType, id: str = '') → Manager

Open the output file for simulation results. The function resolves the correct output path for the active (or named) scenario and returns a Manager instance that you use exactly as you would after calling Manager(path).

Examples

The following example opens the standard simulation results for the active scenario and returns the list of pumps.

>>> import infowater.pro as iwp
>>> outman = iwp.simulation_open_output(iwp.SimulationType.STANDARD)
>>> outman.get_element_list("Pump")
['Pump_1', 'Pump_2']

simulation_run()

infowater.pro.simulation_run(type: SimulationType, mode: SimulationMode = SimulationMode.STANDARD) → SimulationStatus | int

Run a simulation.

Examples

>>> import infowater.pro as iwp
>>> iwp.simulation_run(iwp.SimulationType.STANDARD, iwp.SimulationMode.STANDARD)
<SimulationStatus.SUCCEEDED: 3>