Conceptual Models > Incorporation PHREEQC in programming languages

PHREEQpy in unix

(1/4) > >>

freiburgermsu:
Dear PHREEQCusers,

I am developing ROSSpy (https://pypi.org/project/ROSSpy/) as an application of PHREEQpy for simulating the geochemical reactive transport of reverse osmosis desalination. ROSSpy executes flawlessly in windows, however, the package yields an error that the database cannot load in unix systems (https://github.com/freiburgermsu/ROSSpy/blob/main/examples/other/test_function/executing_rosspy_test.ipynb). This error occurs despite parameterizing DATABASE as the first line of the PQI file (https://github.com/freiburgermsu/ROSSpy/blob/main/examples/other/test_function/rosspy_test-2/input.pqi) and despite providing the database as an argument to the imported PHREEQpy object (https://github.com/freiburgermsu/ROSSpy/blob/main/rosspy/core.py#L719-L721).

The PHREEQpy object is also differentially defined based upon the operating system (https://github.com/freiburgermsu/ROSSpy/blob/main/rosspy/core.py#L47-L50), which suggests that the PHREEQpy object should behave identically in both operating sysytems. What could be the source of this error with different operating systems? How can it be resolved?

I am optimistic that some of you may be able to help clarify and resolve the issue. I can elaborate any details of the error or the corresponding code at anyone's request.

Thank you for your support :)
  Andrew

dlparkhurst:
The DATABASE keyword is disabled for input files in Linux. Here is what my guru says:
================================

I think he needs to make sure the call to phreeqc.load_database() see line 720:

https://github.com/freiburgermsu/ROSSpy/blob/main/examples/other/test_function/executing_rosspy_test.ipynb

is called with the correct path of the pitzer database.  He mentions in the post that the PQI file is using the DATABASE keyword but iphreeqc ignores it, it requires the DB to be loaded using LoadDatabase or in phreeqpy's case load_database().

freiburgermsu:
Dear David,

I printed the path in the Notebook (https://github.com/freiburgermsu/ROSSpy/blob/main/examples/other/test_function/executing_rosspy_test.ipynb) and verified that database path

--- Code: ---/Users/Andrew/Documents/Research/University of Victoria Civil Engineering/ROSSpy/rosspy/databases/pitzer.dat
--- End code ---
is correct via the "Go" function of the Finder, which accepts a path and leads to that location. The acceptance of the path by "Go" suggests that the syntax of the path is correct, although, perhaps some syntactic detail is implicitly understood by Mac OS yet might not be sufficient for PHREEQpy?

I appreciate your guidance :)
   Andrew

dlparkhurst:
Try a quoted string "/users/..." instead of a variable. And do an ls from Python with the same string just to make sure Python can see the file. If it works, you can modify as necessary.

freiburgermsu:
I hard-coded the path to the load_database() function and received the same error. What is the syntax for "Is from Python"?

Navigation

[0] Message Index

[#] Next page

Go to full version