IPhreeqcPy Module

class IPhreeqcPy.IPhreeqc(dll_path=None)[source]

Python wrapper for the compiled IPhreeqc.

Parameters:(optional) string (dll_path) – path for the iphreeqc compiled library .dll for windows or .so for linux

Note

IPhreeqc is compiled on installation for Linux GNU compilers are used and for windows visual studio 10 compilers are used. By default these compiled files are used.

AccumulateLine(line)[source]

Accumlate line(s) for input to phreeqc

AddError(phc_error_msg)[source]

Appends the given error message and increments the error count. Internally used fo create an error condition

Parameters:phc_error_msg (string) – Error message to append
AddWarning(phc_warn_msg)[source]

Appends the given warning message and increments the warning count. Internally used to create warning condition

Parameters:phc_warn_msg (string) – Warning message to append
ClearAccumulatedLines()[source]

Clear the accumlated input buffer. Input buffer is accumlated from calls to AccumulateLine()

CreateIPhreeqc()[source]

Create a new IPhreeqc instance

DestroyIPhreeqc()[source]

Release an IPhreeqc instance from memory

GetComponent(index)[source]

Retrieves the given component

Parameters:index (integer) – The zero-based index of the component to retrieve
GetComponentCount

Retrieves the number of component in the current component list

GetComponentList()[source]

Get names of all components

Returns:list with component names
Return type:list
GetDumpString()[source]

Gives dump string as output

GetErrorString()[source]

Retrieves the error messages from the last call to RunAccumulated(), RunFile(), RunString(), LoadDatabase(), LoadDatabaseString()

Returns:Error string
Return type:string
GetSelectedOutputArray()[source]

Get all values from selected output

Returns:All values of the selected output in multi-list form
Return type:list
GetSelectedOutputCol(col)[source]

Get all values for one column from selected output

Parameters:col (integer) – column index
Returns:list of selected output for a given column
Return type:list
GetSelectedOutputColumnCount

Retrieves the number of columns in the selected output buffer

GetSelectedOutputRow(row)[source]

Get all values for one row from selected output

Parameters:row (integer) – row index
Returns:list of selected output for a given row
Return type:list
GetSelectedOutputRowCount

Get number of rows in selected output

GetSelectedOutputValue(row, col)[source]

Get one value from selected output at given row and column

Parameters:
  • row (integer) – row index
  • column (integer) – column index
Returns:

Selected output value

Return type:

Real

LoadDatabase(database_name)[source]

Load a database with given file_name

Parameters:database_name (string) –

path to the database. IphreeqcPy comes with all databases of phreeqc and cemdata07.To use one of these database type the relevant filename. Filenames are listed below

  • alkaline.dat
  • cemdata07.dat
  • ex15.dat
  • llnl.dat
  • mcatexch.dat
  • minteq.dat
  • minteq.V4.dat
  • phreeqc.dat
  • phreeqcU.dat
  • phreeqd.dat
  • pitzer.dat
  • wateq4f.dat
LoadDatabaseString(input_string)[source]

Loads a database from a string

Parameters:input_string (string) – input database string
RunAccumulated()[source]

Run the input buffer as defined by calls to AccumulateLine()

RunFile(Filename)[source]

run instructions from a file

Parameters:Filename (string) – path to file to run instructions from
RunString(cmd_string)[source]

Run PHREEQC input from string

Parameters:cmd_string (string) – string of phreeqc command to be executed
SetDumpFileOff()[source]

Set the dump file switch off

SetDumpFileOn()[source]

Set the dump file switch on to write dump file

SetDumpStringOff()[source]

Set the dump string switch off

SetDumpStringOn()[source]

Set the dump string switch on to get dump string

SetSelectedOutputFileOff()[source]

Turn on writing to selected output file

SetSelectedOutputFileOn()[source]

Turn on writing to selected output file