Skip to content

fix: repair OFLSMToolkit import chain and pandas 2.2 compatibility refs #883#967

Merged
lior-antonov merged 2 commits into
masterfrom
issue883
Jul 2, 2026
Merged

fix: repair OFLSMToolkit import chain and pandas 2.2 compatibility refs #883#967
lior-antonov merged 2 commits into
masterfrom
issue883

Conversation

@ilayfalach

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed 4 cascading import bugs in hera/simulations/openFoam/lagrangian/LSM/toolkit.py: wrong toolkitHome import location, missing toolkit module import, hard evtk import (now optional via try/except), and delim_whitespace=True removed in pandas 2.2
  • Fixed same delim_whitespace deprecation in hera/simulations/openFoam/toberewritten/utils.py
  • Removed dead HERAMETADATA import from toberewritten/utils.py (symbol never existed)
  • Added hera/tests/test_of_lsm_flow.py with 18 @pytest.mark.unit tests and 1 @pytest.mark.integration test (skipped when OpenFOAM not installed) covering import chain, file parsing, and record reading

Test plan

  • pytest hera/tests/test_of_lsm_flow.py -v — 18 passed, 1 skipped
  • from hera.simulations.openFoam.lagrangian.LSM.toolkit import OFLSMToolkit no longer raises ImportError

Closes #883

🤖 Generated with Claude Code

Ilay Falach and others added 2 commits June 30, 2026 12:07
#883

- hera/simulations/openFoam/toberewritten/utils.py: remove dead
  `from hera.simulations.openFoam import HERAMETADATA` import
  (HERAMETADATA was never defined and never used); uncomment `import pandas`
  which the module actually needs; replace deprecated `delim_whitespace=True`
  with `sep=r'\s+'` for pandas ≥ 2.2.

- hera/simulations/openFoam/lagrangian/LSM/toolkit.py: fix broken
  `from hera.toolkit import toolkitHome` (toolkitHome lives in `hera`,
  not `hera.toolkit`) and add the missing `toolkit` module import so
  `toolkit.abstractToolkit` / `toolkit.TOOLKIT_SAVEMODE_*` resolve;
  guard `evtk` import with try/except so the module loads without
  the optional evtk package; replace deprecated `delim_whitespace=True`.

- hera/tests/test_of_lsm_flow.py: 18 new tests covering import sanity,
  vector/scalar/compact-uniform file parsing via _extractFile, and full
  per-particle record assembly via _readRecord; OpenFOAM-binary test skips
  gracefully when blockMesh is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mark unit-test classes with @pytest.mark.unit (no external deps) and
TestOpenFOAMIntegration with @pytest.mark.integration (requires blockMesh).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lior-antonov lior-antonov merged commit 2b5ef46 into master Jul 2, 2026
1 check passed
@lior-antonov lior-antonov deleted the issue883 branch July 2, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full OpenFOAM LSM flow

2 participants