-
Notifications
You must be signed in to change notification settings - Fork 66
Open
mwt5345/DeepLenseSim
#1Description
Issue: Hardcoded Absolute File Paths Break Cross-Platform Execution
Description
Currently, several simulation scripts (for example, Model_I/sim_axion.py) contain hardcoded absolute file paths pointing to a specific user’s directory on a Linux cluster (e.g., /users/mtoomey/scratch/...). This causes the scripts to crash immediately on Windows, macOS, or any system other than the original author's.
This causes the scripts to crash immediately on Windows, macOS, or any system other than the original author’s environment.
Steps to Reproduce
- Clone the repository on a Windows or macOS machine.
- Attempt to run the script:
python Model_I/sim_axion.py
- The script fails with a
FileNotFoundErrorbecause the directory/users/mtoomey/...does not exist.### Expected Behavior
The scripts should use relative paths or a configurable base directory so that data is saved within the project folder regardless of the operating system.
Proposed Fix
Replace absolute path strings with os.path joins to the current working directory.
Python
import os
base_path = os.path.join(os.getcwd(), 'data', 'Model_I')
os.makedirs(base_path, exist_ok=True)
Metadata
Metadata
Assignees
Labels
No labels