fix: repair OFLSMToolkit import chain and pandas 2.2 compatibility refs #883#967
Merged
Conversation
#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hera/simulations/openFoam/lagrangian/LSM/toolkit.py: wrongtoolkitHomeimport location, missingtoolkitmodule import, hardevtkimport (now optional via try/except), anddelim_whitespace=Trueremoved in pandas 2.2delim_whitespacedeprecation inhera/simulations/openFoam/toberewritten/utils.pyHERAMETADATAimport fromtoberewritten/utils.py(symbol never existed)hera/tests/test_of_lsm_flow.pywith 18@pytest.mark.unittests and 1@pytest.mark.integrationtest (skipped when OpenFOAM not installed) covering import chain, file parsing, and record readingTest plan
pytest hera/tests/test_of_lsm_flow.py -v— 18 passed, 1 skippedfrom hera.simulations.openFoam.lagrangian.LSM.toolkit import OFLSMToolkitno longer raises ImportErrorCloses #883
🤖 Generated with Claude Code