Skip to content

Replace ctypes PhreeqcRM interface with phreeqcrm pip package #34

@matteomasi

Description

@matteomasi

Our current PhreeqcRM interface (mibiremo/phreeqc.py) is a hand-written ctypes wrapper that requires shipping platform-specific DLL/SO files. The official phreeqcrm pip package now provides the same functionality with cross-platform compatibility. The pip package is still in beta (v0.0.17)

I propose replacing the ctypes backend with phreeqcrm while keeping our custom functions (initialize_phreeqc, run_initial_from_file, get_selected_output_df) as high-level API.

The improvements are:

  • Remove the need to include binaries .dll / .so in the package, and avoid re-compiling them for new versions
  • Cross-platform support via pip (Windows, Linux, macOS)
  • The PhreeqcRM version is always kept updated through pip

This is quite a major change and the work to be done whould be the following:

  • Change PhreeqcRM class to use phreeqcrm.PhreeqcRM as backend
  • Update the tests that currently mocked ctypes calls
  • Remove lib/ directory with shared libraries
  • Insert phreeqcrm version in dependencies

Furthermore, this change will significantly facilitate the integration of mf6rtm (#22) in mibiremo, because mf6rtm uses phreeqcrm package.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions