Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example run changes directory to repository root #289

Closed
wants to merge 1 commit into from

Conversation

edbaskerville
Copy link
Collaborator

The example depends on being run in the root directory of the repo.

This minimal change simply does a cd into the root directory of the repo. A longer-term conversation: how do paths work relative to scripts, config files, etc., etc.? Best not to change anything significant until the reproducibility model stabilizes.

Also modified path computations to use os.path.join().


os.chdir(ROOT_PATH)

# the different segments of code responsible for running the model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the file to fail pre-commit checks: E402 Module level import not at top of file. You have two solutions, either add the following command: # ruff: noqa: E402 to disable the particular pre-commit check. Or move the lines below the import. I suggest the latter unless you have a good reason to keep the current ordering

@edbaskerville
Copy link
Collaborator Author

edbaskerville commented Oct 25, 2024

I'll take a look at this on Tuesday.

@edbaskerville
Copy link
Collaborator Author

edbaskerville commented Oct 29, 2024

I think it probably makes sense to punt this kind of thing until after the packages get reorg'd and relative paths get re-thought.

At that point we can identify the best non-hacky solution—I suspect there's a "correct" way to do this that doesn't involve messing with the python search path at runtime.

@arik-shurygin agree?

@edbaskerville edbaskerville deleted the 2024-10-22-example+paths-edbaskerville branch November 12, 2024 18:51
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.

2 participants