Skip to content

fix: replace hardcoded absolute paths with dynamic paths refs #881#965

Open
ilayfalach wants to merge 2 commits into
masterfrom
issue881
Open

fix: replace hardcoded absolute paths with dynamic paths refs #881#965
ilayfalach wants to merge 2 commits into
masterfrom
issue881

Conversation

@ilayfalach

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced all hardcoded /home/ilay* absolute paths in test files and Jupyter notebooks with dynamic/relative paths
  • Fixes test_notebooks.py, DataHandler_gdal.py, test_experiment_cli_shortcuts.py, and 4 Jupyter notebooks under doc/jupyter/

Test plan

  • Run pytest hera/tests/ -m "not notebook" — no regressions
  • Notebook paths resolve correctly when executed from their own directory

Closes #881

🤖 Generated with Claude Code

Ilay Falach and others added 2 commits June 30, 2026 13:45
… refs #881

Replace every live hardcoded /home/ilay* path with portable alternatives:

- hera/tests/datalayer/DataHandler_gdal.py: use os.path.dirname(__file__)
  to locate the .hgt test file relative to the script itself.

- hera/tests/dynamic_loading_tests_pack/test_experiment_cli_shortcuts.py:
  replace hardcoded /home/ilay/pyargos-master with
  os.environ.get("PYARGOS_PATH", "") so CI can inject the path without
  touching source code.

- User/lowFrequency.ipynb: replace absolute parquet path with
  pathlib.Path("../../../data/lowfrequency/MASSADA.parquet") — CWD is
  set to the notebook directory by the test runner.

- lowFreqToolKit_documentation.ipynb: replace hardcoded fallback paths in
  the _candidates list with os.path.abspath()-based relative paths.

- User/Demography and toolkits/Demography notebooks: replace hardcoded
  shapefile paths with relative os.path.join() expressions from CWD;
  remove hardcoded _fallback variable.

- Developer/Demography: remove hardcoded commented-out path, replace with
  env-var based comment pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…aHandler_gdal.py

File was removed in master (commit 79a53a3, "redundent files") by Lior.
Our change (fixing hardcoded path) is superseded by the intentional deletion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Test all example jupyters in the test-all flow

1 participant