From 021c6c4e09c859853f197efb8e639e131c026864 Mon Sep 17 00:00:00 2001 From: Tim Bartholomew Date: Wed, 20 May 2026 14:40:39 -0400 Subject: [PATCH 1/2] cleaned up egg-info --- .gitignore | 3 +- phreeqcinwt.egg-info/PKG-INFO | 12 --- phreeqcinwt.egg-info/SOURCES.txt | 49 ------------ phreeqcinwt.egg-info/dependency_links.txt | 1 - phreeqcinwt.egg-info/requires.txt | 4 - phreeqcinwt.egg-info/top_level.txt | 1 - src/phreeqcinwt.egg-info/PKG-INFO | 8 -- src/phreeqcinwt.egg-info/SOURCES.txt | 75 ------------------- src/phreeqcinwt.egg-info/dependency_links.txt | 1 - src/phreeqcinwt.egg-info/requires.txt | 4 - src/phreeqcinwt.egg-info/top_level.txt | 1 - 11 files changed, 2 insertions(+), 157 deletions(-) delete mode 100644 phreeqcinwt.egg-info/PKG-INFO delete mode 100644 phreeqcinwt.egg-info/SOURCES.txt delete mode 100644 phreeqcinwt.egg-info/dependency_links.txt delete mode 100644 phreeqcinwt.egg-info/requires.txt delete mode 100644 phreeqcinwt.egg-info/top_level.txt delete mode 100644 src/phreeqcinwt.egg-info/PKG-INFO delete mode 100644 src/phreeqcinwt.egg-info/SOURCES.txt delete mode 100644 src/phreeqcinwt.egg-info/dependency_links.txt delete mode 100644 src/phreeqcinwt.egg-info/requires.txt delete mode 100644 src/phreeqcinwt.egg-info/top_level.txt diff --git a/.gitignore b/.gitignore index bcc1ff3..3af533e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ - +*.egg-info/ +*.egg-info *.dat *.pyc *.inp diff --git a/phreeqcinwt.egg-info/PKG-INFO b/phreeqcinwt.egg-info/PKG-INFO deleted file mode 100644 index b301a21..0000000 --- a/phreeqcinwt.egg-info/PKG-INFO +++ /dev/null @@ -1,12 +0,0 @@ -Metadata-Version: 2.4 -Name: phreeqcinwt -Version: 0.0.1 -Author: Alexander V Dudchenko -Author-email: -Description-Content-Type: text/markdown -Requires-Dist: numpy -Requires-Dist: pyyaml -Requires-Dist: molmass -Requires-Dist: phreeqpy -Dynamic: author -Dynamic: author-email diff --git a/phreeqcinwt.egg-info/SOURCES.txt b/phreeqcinwt.egg-info/SOURCES.txt deleted file mode 100644 index 4ac23bb..0000000 --- a/phreeqcinwt.egg-info/SOURCES.txt +++ /dev/null @@ -1,49 +0,0 @@ -.gitattributes -.gitignore -README.txt -pyproject.toml -setup.py -phreeqcinwt/__init__.py -phreeqcinwt/phreeqc_wt_api.py -phreeqcinwt.egg-info/PKG-INFO -phreeqcinwt.egg-info/SOURCES.txt -phreeqcinwt.egg-info/dependency_links.txt -phreeqcinwt.egg-info/requires.txt -phreeqcinwt.egg-info/top_level.txt -phreeqcinwt/__pycache__/__init__.cpython-38.pyc -phreeqcinwt/__pycache__/data_base_utils.cpython-38.pyc -phreeqcinwt/__pycache__/phreeqc_wt_api.cpython-38.pyc -phreeqcinwt/__pycache__/phreeqcinwt.cpython-38.pyc -phreeqcinwt/core/__init__.py -phreeqcinwt/core/data_base_utils.py -phreeqcinwt/core/reaction_utils.py -phreeqcinwt/core/solution_state_utils.py -phreeqcinwt/core/utility_functions.py -phreeqcinwt/core/__pycache__/__init__.cpython-38.pyc -phreeqcinwt/core/__pycache__/data_base_utils.cpython-38.pyc -phreeqcinwt/core/__pycache__/utility_functions.cpython-38.pyc -phreeqcinwt/databases/defined_reactants.yaml -phreeqcinwt/databases/metadata/pitzer_PHASES.yaml -phreeqcinwt/databases/metadata/pitzer_SOLUTION_MASTER_SPECIES.yaml -phreeqcinwt/databases/metadata/pitzer_SOLUTION_SPECIES.yaml -phreeqcinwt/examples/bench_mark_data_for_reaktoro_pse.py -phreeqcinwt/examples/crys_example.py -phreeqcinwt/examples/error.inp -phreeqcinwt/examples/phreeqc_data.json -phreeqcinwt/examples/simple_database_comparison.py -phreeqcinwt/examples/simple_delta_h.py -phreeqcinwt/examples/simple_density_calc.py -phreeqcinwt/examples/simple_integration_with_watertap.py -phreeqcinwt/examples/simple_mix_example.py -phreeqcinwt/examples/simple_osmotic_pressure.py -phreeqcinwt/examples/simple_ph_adjust.py -phreeqcinwt/examples/simple_phase_exclusion.py -phreeqcinwt/examples/simple_phase_remove.py -phreeqcinwt/examples/simple_scailing_tendencie.py -phreeqcinwt/examples/simple_solution_name_example.py -phreeqcinwt/examples/simple_treatment_train.py -phreeqcinwt/examples/simple_vapor_pressure_comp.py -phreeqcinwt/examples/examples_for_api_dev/simple_soft_sweep.py -phreeqcinwt/examples/examples_for_api_dev/simple_water_reconciliation.py -phreeqcinwt/examples/examples_for_api_dev/test_api.py -phreeqcinwt/examples/examples_for_api_dev/test_api_sr_br.py \ No newline at end of file diff --git a/phreeqcinwt.egg-info/dependency_links.txt b/phreeqcinwt.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/phreeqcinwt.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/phreeqcinwt.egg-info/requires.txt b/phreeqcinwt.egg-info/requires.txt deleted file mode 100644 index 08318ee..0000000 --- a/phreeqcinwt.egg-info/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy -pyyaml -molmass -phreeqpy diff --git a/phreeqcinwt.egg-info/top_level.txt b/phreeqcinwt.egg-info/top_level.txt deleted file mode 100644 index 0d03da1..0000000 --- a/phreeqcinwt.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -phreeqcinwt diff --git a/src/phreeqcinwt.egg-info/PKG-INFO b/src/phreeqcinwt.egg-info/PKG-INFO deleted file mode 100644 index 9a201c0..0000000 --- a/src/phreeqcinwt.egg-info/PKG-INFO +++ /dev/null @@ -1,8 +0,0 @@ -Metadata-Version: 2.4 -Name: phreeqcinwt -Version: 0.0.0 -Description-Content-Type: text/markdown -Requires-Dist: numpy -Requires-Dist: pyyaml -Requires-Dist: molmass -Requires-Dist: phreeqpy diff --git a/src/phreeqcinwt.egg-info/SOURCES.txt b/src/phreeqcinwt.egg-info/SOURCES.txt deleted file mode 100644 index ce35eb8..0000000 --- a/src/phreeqcinwt.egg-info/SOURCES.txt +++ /dev/null @@ -1,75 +0,0 @@ -.gitattributes -.gitignore -README.txt -phreeqcinwt.yml -pyproject.toml -requirements.txt -phreeqcinwt.egg-info/PKG-INFO -phreeqcinwt.egg-info/SOURCES.txt -phreeqcinwt.egg-info/dependency_links.txt -phreeqcinwt.egg-info/requires.txt -phreeqcinwt.egg-info/top_level.txt -src/phreeqcinwt/__init__.py -src/phreeqcinwt/phreeqc_wt_api.py -src/phreeqcinwt.egg-info/PKG-INFO -src/phreeqcinwt.egg-info/SOURCES.txt -src/phreeqcinwt.egg-info/dependency_links.txt -src/phreeqcinwt.egg-info/requires.txt -src/phreeqcinwt.egg-info/top_level.txt -src/phreeqcinwt/core/__init__.py -src/phreeqcinwt/core/data_base_utils.py -src/phreeqcinwt/core/reaction_utils.py -src/phreeqcinwt/core/solution_state_utils.py -src/phreeqcinwt/core/utility_functions.py -src/phreeqcinwt/databases/Amm.dat -src/phreeqcinwt/databases/Tipping_Hurley.dat -src/phreeqcinwt/databases/__init__.py -src/phreeqcinwt/databases/core10.dat -src/phreeqcinwt/databases/defined_reactants.yaml -src/phreeqcinwt/databases/frezchem.dat -src/phreeqcinwt/databases/iso.dat -src/phreeqcinwt/databases/llnl.dat -src/phreeqcinwt/databases/minteq.dat -src/phreeqcinwt/databases/minteq.v4.dat -src/phreeqcinwt/databases/phreeqc.dat -src/phreeqcinwt/databases/pitzer.dat -src/phreeqcinwt/databases/sit.dat -src/phreeqcinwt/databases/wateq4f.dat -src/phreeqcinwt/databases/metadata/llnl_PHASES.yaml -src/phreeqcinwt/databases/metadata/llnl_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/databases/metadata/minteq.v4_PHASES.yaml -src/phreeqcinwt/databases/metadata/minteq.v4_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/databases/metadata/minteq_PHASES.yaml -src/phreeqcinwt/databases/metadata/minteq_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/databases/metadata/phreeqc_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/databases/metadata/pitzer_PHASES.yaml -src/phreeqcinwt/databases/metadata/pitzer_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/databases/metadata/wateq4f_PHASES.yaml -src/phreeqcinwt/databases/metadata/wateq4f_SOLUTION_MASTER_SPECIES.yaml -src/phreeqcinwt/examples/__init__.py -src/phreeqcinwt/examples/bench_mark_data_for_reaktoro_pse.py -src/phreeqcinwt/examples/bench_mark_data_for_reaktoro_pse_wateq4f.py -src/phreeqcinwt/examples/crys_example.py -src/phreeqcinwt/examples/phreeqc_data.json -src/phreeqcinwt/examples/phreeqc_data_waterq4f.json -src/phreeqcinwt/examples/simple_database_comparison.py -src/phreeqcinwt/examples/simple_delta_h.py -src/phreeqcinwt/examples/simple_density_calc.py -src/phreeqcinwt/examples/simple_integration_with_watertap.py -src/phreeqcinwt/examples/simple_lnll_ammonia.py -src/phreeqcinwt/examples/simple_mix_example.py -src/phreeqcinwt/examples/simple_osmotic_pressure.py -src/phreeqcinwt/examples/simple_ph_adjust.py -src/phreeqcinwt/examples/simple_phase_exclusion.py -src/phreeqcinwt/examples/simple_phase_remove.py -src/phreeqcinwt/examples/simple_scailing_tendencie.py -src/phreeqcinwt/examples/simple_solution_name_example.py -src/phreeqcinwt/examples/simple_treatment_train.py -src/phreeqcinwt/examples/simple_vapor_pressure_comp.py -src/phreeqcinwt/examples/examples_for_api_dev/simple_soft_sweep.py -src/phreeqcinwt/examples/examples_for_api_dev/simple_water_reconciliation.py -src/phreeqcinwt/examples/examples_for_api_dev/test_api.py -src/phreeqcinwt/examples/examples_for_api_dev/test_api_sr_br.py -src/phreeqcinwt/tests/__init__.py -src/phreeqcinwt/tests/generate_test_data.py -src/phreeqcinwt/tests/test_solution_build.py \ No newline at end of file diff --git a/src/phreeqcinwt.egg-info/dependency_links.txt b/src/phreeqcinwt.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/src/phreeqcinwt.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/phreeqcinwt.egg-info/requires.txt b/src/phreeqcinwt.egg-info/requires.txt deleted file mode 100644 index 08318ee..0000000 --- a/src/phreeqcinwt.egg-info/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy -pyyaml -molmass -phreeqpy diff --git a/src/phreeqcinwt.egg-info/top_level.txt b/src/phreeqcinwt.egg-info/top_level.txt deleted file mode 100644 index 0d03da1..0000000 --- a/src/phreeqcinwt.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -phreeqcinwt From 21915d0bcf72c8e14880494c9490feb3cbd50c2f Mon Sep 17 00:00:00 2001 From: Tim Bartholomew Date: Wed, 20 May 2026 15:01:00 -0400 Subject: [PATCH 2/2] dropped the second action, simplified osmotic pressure calc --- .gitignore | 1 + src/phreeqcinwt/core/solution_state_utils.py | 59 ++----------------- src/phreeqcinwt/phreeqc_wt_api.py | 61 +------------------- 3 files changed, 8 insertions(+), 113 deletions(-) diff --git a/.gitignore b/.gitignore index 3af533e..fde53b3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.dat *.pyc *.inp +.vscode/ \ No newline at end of file diff --git a/src/phreeqcinwt/core/solution_state_utils.py b/src/phreeqcinwt/core/solution_state_utils.py index 883acf9..855da27 100644 --- a/src/phreeqcinwt/core/solution_state_utils.py +++ b/src/phreeqcinwt/core/solution_state_utils.py @@ -6,41 +6,15 @@ class solution_utils: - def _process_activities(self, result): - # print(result) - activities = {} - for element, name in self.return_dict.items(): - idx = np.where("la_" + element == np.array(result[0]))[0] - if len(idx) > 0: - activities[element] = { - "value": 10 ** result[1][idx[0]], - "units": "dimensionless", - } - activities["log10_{}".format(element)] = { - "value": result[1][idx[0]], - "units": "dimensionless", - } - else: - activities[element] = {"value": None, "units": "dimensionless"} - activities["log10_{}".format(element)] = { - "value": None, - "units": "dimensionless", - } - idx = np.where("la_H2O" == np.array(result[0]))[0] - # print(idx) - activities["H2O"] = {"value": 10 ** result[1][idx[0]], "units": "dimensionless"} - activities["log10_{}".format("H2O")] = { - "value": result[1][idx[0]], - "units": "dimensionless", - } - # print(activities) - return activities - - def _get_osmotic_pressure(self, result, solution_state, activities): + def _get_osmotic_pressure(self, result, solution_state): idx = np.where("h2o_vm" == np.array(result[0]))[0] + activity_idx = np.where("la_H2O" == np.array(result[0]))[0] + + if len(idx) == 0 or len(activity_idx) == 0: + return {"units": "Pa", "value": None} vm = result[1][idx[0]] # cm3/mol - activity = activities["H2O"]["value"] + activity = 10 ** result[1][activity_idx[0]] R = 8.31446261815324 # m3⋅Pa⋅K−1⋅mol−1 T = solution_state["Temperature"]["value"] + 273.15 if vm == 0: @@ -103,27 +77,6 @@ def _get_solution_comp( } return aque_species_comp - def _get_diffusion_transfer_number( - self, - result, - ): - transport_data = {"diffusion": {}, "transfer_number": {}} - for i in range(len(result[1])): - if isinstance(result[1][i], str) and "diffusion" in result[1][i]: - species = result[1][i].split(" ")[1] - transport_data["diffusion"][species] = { - "value": result[1][i + 1], - "units": "m2/s", - } - for i in range(len(result[1])): - if isinstance(result[1][i], str) and "transfer_number" in result[1][i]: - species = result[1][i].split(" ")[1] - transport_data["transfer_number"][species] = { - "value": result[1][i + 1], - "units": "unitless", - } - return transport_data - def _get_scaling_tendencies(self, result, report=False): result_dict = {} for i in range(len(result[1])): diff --git a/src/phreeqcinwt/phreeqc_wt_api.py b/src/phreeqcinwt/phreeqc_wt_api.py index 967a75e..918f395 100644 --- a/src/phreeqcinwt/phreeqc_wt_api.py +++ b/src/phreeqcinwt/phreeqc_wt_api.py @@ -460,6 +460,7 @@ def get_solution_state( command += " -charge_balance true\n" command += " -water true\n" command += " -percent_error true\n" + command += " -activities H2O\n" command += " -user_punch true\n" command += "\n" @@ -477,39 +478,6 @@ def get_solution_state( solution_composition["composition"] = self._get_solution_comp( result, ) - - command = "USE SOLUTION {}\n".format(str(solution_number)) - - command += "EQUILIBRIUM_PHASES\n" - command += "USER_PUNCH\n" - command += "-start\n" - cur_count = 10 - for element in solution_composition["composition"]["species"].keys(): - command += '{} PUNCH "diffusion\t{element}" DIFF_C("{element}")\n'.format( - cur_count, element=element - ) - cur_count += 10 - for element in solution_composition["composition"]["species"].keys(): - command += ( - '{} PUNCH "transfer_number\t{element}" T_SC("{element}")\n'.format( - cur_count, element=element - ) - ) - cur_count += 10 - command += "-end\n" - command += "SELECTED_OUTPUT\n" - command += " -user_punch true\n" - command += " -activities " - for element in solution_composition["composition"]["species"].keys(): - command += " {} ".format(element) - command += " H2O\n" - command += "\n" - command += "END\n" - self.run_string(command) - - result2 = self.phreeqc.get_selected_output_array() - solution_composition["activities"] = self._process_activities(result2) - solution_composition["transport"] = self._get_diffusion_transfer_number(result2) solution_composition["solution_state"].update( self.get_total_concetration(solution_composition) ) @@ -517,7 +485,6 @@ def get_solution_state( self._get_osmotic_pressure( result, solution_composition["solution_state"], - solution_composition["activities"], ) ) self.current_state = solution_composition @@ -554,32 +521,6 @@ def get_solution_state( mass["mw (g/mol)"], "g/mol", ) - - print("activities------------------") - for scalant, SI in solution_composition["activities"].items(): - print( - "\t", - scalant, - SI, - ) - - # print("diffusion------------------") - # for scalant, SI in solution_composition["transport"]["diffusion"].items(): - # print( - # "\t", - # scalant, - # SI, - # ) - - # print("transfer number------------------") - # for scalant, SI in solution_composition["transport"][ - # "transfer_number" - # ].items(): - # print( - # "\t", - # scalant, - # SI, - # ) print("scaling tendendencies------------------") for scalant, SI in solution_composition["scaling_tendencies"].items(): if scalant == "max":