Skip to content

fix: pathlib-refactor leftovers in HPC example_cpu_and_gpu.py - #62

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

Jammy2211 merged 1 commit into
mainfrom
feature/cluster-h-hpc-pathlib-fix

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented May 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Cluster H follow-up to #59 (the os.path → pathlib refactor). Two classes of leftover typos in scripts/guides/hpc/example_cpu_and_gpu.py, both produced by the same case-insensitive path → Path substitution:

  1. Path(path.sep…) at lines 64, 82, 100 — path was the old os.path import, removed by refactor: replace os.path with pathlib in workspace scripts #59. Execution died at line 64 with NameError: name 'path' is not defined. Did you mean: 'Path'?. Replaced with Path("/" …); pathlib normalises / correctly on both POSIX and Windows, and the HPC scripts target SLURM-style absolute paths like /hpc/data/... which always begin with /.
  2. dataset_Path() at lines 207, 242, 254 — the substitution corrupted the variable name dataset_path (defined at line 205 as a Path instance) into dataset_Path, then re-styled it as a callable. Replaced with dataset_path (no parens — it’s a Path instance, not a constructor).

Without #2 the script would only fail later at line 207 instead of line 64; both fixes are needed for the script to run end-to-end.

Scripts Changed

  • scripts/guides/hpc/example_cpu_and_gpu.py — three Path(path.sep …) → Path("/" …) at lines 64, 82, 100; three dataset_Path() → dataset_path at lines 207, 242, 254.

Test Plan

  • PYAUTO_TEST_MODE=1 python scripts/guides/hpc/example_cpu_and_gpu.py runs to exit 0 (was NameError: name 'path' is not defined at line 64).
  • grep -n "path\.sep\|dataset_Path" scripts/guides/hpc/ returns no matches in this file.

🤖 Generated with Claude Code

Cluster H follow-up to PR #59 (the os.path → pathlib refactor).
Six sites in scripts/guides/hpc/example_cpu_and_gpu.py: three
Path(path.sep…) leftovers and three dataset_Path() identifiers
that the case-insensitive substitution corrupted from dataset_path.
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 8, 2026
@Jammy2211
Jammy2211 merged commit 12ac190 into main May 8, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/cluster-h-hpc-pathlib-fix branch May 8, 2026 12:41
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 2026
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.

1 participant