Skip to content

fix: pathlib-refactor leftovers in HPC example_cpu.py#136

Merged
Jammy2211 merged 1 commit intomainfrom
feature/cluster-h-hpc-pathlib-fix
May 8, 2026
Merged

fix: pathlib-refactor leftovers in HPC example_cpu.py#136
Jammy2211 merged 1 commit intomainfrom
feature/cluster-h-hpc-pathlib-fix

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Mirror of PyAutoLabs/autogalaxy_workspace's Cluster H fix. The autolens HPC tutorial scripts/guides/hpc/example_cpu.py carries the exact same two classes of leftover typos from #128 (the os.pathpathlib refactor):

  1. Path(path.sep…) at lines 58, 76, 94 — path was the old os.path import, removed by refactor: replace os.path with pathlib in workspace scripts #128. Replaced with Path("/" …); pathlib normalises / correctly on both POSIX and Windows, and the HPC scripts target SLURM-style absolute paths like /hpc/data/....
  2. dataset_Path() at line 291 — the case-insensitive substitution corrupted the variable name dataset_path (a Path instance) into dataset_Path and re-styled it as a callable. Replaced with dataset_path.

The bug did not appear in the latest workspace test run because this script is listed in config/build/no_run.yaml ("HPC paths dont exist locally."), which pre-dates the typo. Verified post-fix that the script no longer raises NameError and instead reaches the expected pre-existing ConfigException: /hpc/home/hpc_username/hpc/config does not exist at line 110 — i.e. exactly the failure mode no_run.yaml documents. The skip entry is therefore left as-is.

Scripts Changed

  • scripts/guides/hpc/example_cpu.py — three Path(path.sep …)Path("/" …) at lines 58, 76, 94; one dataset_Path()dataset_path at line 291.

Test Plan

  • PYAUTO_TEST_MODE=1 python scripts/guides/hpc/example_cpu.py no longer raises NameError; reaches the documented ConfigException for missing HPC paths (line 110), the very reason it remains skipped in no_run.yaml.
  • grep -n "path\.sep\|dataset_Path" scripts/guides/hpc/ returns no matches in this file.

🤖 Generated with Claude Code

Mirror of PyAutoLabs/autogalaxy_workspace's Cluster H fix. Four
sites in scripts/guides/hpc/example_cpu.py: three Path(path.sep…)
leftovers and one dataset_Path() identifier corrupted from
dataset_path by PR #128's blanket os.path → pathlib substitution.
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 8, 2026
@Jammy2211 Jammy2211 merged commit 2caeb22 into main May 8, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/cluster-h-hpc-pathlib-fix branch May 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant