Skip to content

Running OFF on Windows #29

Description

@daanvanderhoek

When running OFF on Windows, the simulation aborts when trying to assign the results directory using the Unix variable 'PWD'. The relevant code is found in off.py:

try:
    root_dir = data_dir or f'{os.environ["OFF_PATH"]}/runs/'
    lg.info('Root runs directory: ' + root_dir)
except KeyError:
    if os.environ["PWD"].endswith("03_Code"):
         root_dir = data_dir or f'{os.environ["PWD"][:-len("03_Code")]}/runs/'
    else:
         root_dir = data_dir or f'{os.environ["PWD"]}/runs/'

Suggested fix:

try:
    root_dir = data_dir or f'{os.environ["OFF_PATH"]}/runs/'
    lg.info('Root runs directory: ' + root_dir)
except KeyError:
    cwd = os.getcwd()
    if cwd.endswith("03_Code"):
         root_dir = data_dir or f'{cwd[:-len("03_Code")]}/runs/'
    else:
         root_dir = data_dir or f'{cwd}/runs/'

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions