chore: clean up unused constants/imports + fix jupyter-lab-server CLI registration - #1058
Conversation
- Remove unused HighFreqToolKit.DOCTYPE_STATIONS / DOCTYPE_MEASUREMENTS - Remove unused TOOLKIT_VECTOR_REGIONNAME constant in vector toolkit - Remove unused LSMToolkit.TRUE/FALSE constants (template.py uses hardcoded ".TRUE."/".FALSE." literals directly) - Remove unused LSMTemplate.STABILITY_NEUTRAL/STABLE/UNSTABLE constants - Remove unused CASETYPE_RECONSTRUCTED import and unused hera_logging import in pvOpenFOAMBase.py Confirmed unreferenced via repo-wide grep before removal. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
setup.py builds scripts=[...] via glob.glob("hera/bin/hera-*"), which only
matches files whose basename starts with "hera-". The Jupyter Lab launcher
script was named "jupyter-lab-server" and therefore silently never got
installed, despite being documented in docs/cli/reference.md as a
first-class CLI entry point alongside hera-ui, hera-experiment, etc.
Rename it to hera-jupyter-lab-server (via git mv, preserving history) so
it matches the glob, and update all references to the old name in
docs/cli/reference.md and the RiskAnalysis example notebooks.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hera/tests/dynamic_loading_tests_pack/test_experiment_cli_shortcuts.py reads os.environ["PYARGOS_PATH"] to optionally point the experiment CLI tests at a local pyargos-master installation, but this env var was never documented anywhere in the repo. Add an entry alongside the other testing variables (HERA_FULL_LOGGING_TESTS, RESULT_SET, GDF_TOL_AREA, etc.) in docs/configuration/env_vars.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Per @lior-antonov's review: - Reverted the hera-jupyter-lab-server rename; the script keeps its original name jupyter-lab-server, and docs/cli/reference.md and both RiskAnalysis notebooks are restored to master state (this PR no longer touches them). Fixed the underlying bug differently instead: setup.py only globbed hera/bin/hera-*, so the script was never installed despite being documented. It is now listed explicitly. - Restored LSMToolkit.TRUE / LSMToolkit.FALSE and used them at all six places in LSM/template.py that hardcoded ".TRUE." / ".FALSE.", including the fileDict at line 111. The lowercase ".true." / ".false." keys have no constants and stay as literals, so fileDict keeps the same four keys and values. LSMTemplate.STABILITY_NEUTRAL/STABLE/UNSTABLE stay removed: unlike TRUE/FALSE they have no intended call site — no "neutral"/"stable"/ "unstable" literal appears anywhere in hera/simulations/LSM/. Refs #1022
e1e4750 to
eaeff9f
Compare
|
@lior-antonov all five comments handled — replies in the threads. The rename: reverted, bug fixed differentlyThe script keeps the name The underlying bug is still fixed, just without renaming. scripts=[s for s in glob.glob("hera/bin/hera-*") if not s.endswith(".old")]
+ ["hera/bin/jupyter-lab-server"],Worth noting: the notebook edits were doing more damage than the rename. They also flattened the LSM constants: wired up at all six sites
Verified Left removed: RebasedThe branch was 35 commits behind master; rebased cleanly. Since #1054 merged and touched Verification
Down from 10 files to 6. |
Summary
Smaller cleanups: removes unused constants (
DOCTYPE_STATIONS/DOCTYPE_MEASUREMENTS,TOOLKIT_VECTOR_REGIONNAME,LSMToolkit.TRUE/FALSE,LSMTemplate.STABILITY_*) and unused imports. Plus two real fixes:hera/bin/jupyter-lab-serverdidn't match thehera-*glob insetup.pyand was silently never installed despite being documented — renamed tohera-jupyter-lab-server(git mv) and updated all doc/notebook references.PYARGOS_PATHenv var indocs/configuration/env_vars.md.10 files changed. Full detail in the "5. cleanup-constants-imports" section of #1022.
Verification:
python3 -m py_compileon all touched files.Refs #1022