Skip to content

**Title:** [Bug] Hardcoded absolute paths in Model_I/II simulation scripts #99

@Shrishagk

Description

@Shrishagk

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

  1. Clone the repository on a Windows or macOS machine.
  2. Attempt to run the script:
    python Model_I/sim_axion.py
  3. The script fails with a FileNotFoundError because 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions