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

Refactor / replace os.path with pathlib in many places #985

Merged
merged 24 commits into from
May 2, 2023

Conversation

jlnav
Copy link
Member

@jlnav jlnav commented Mar 14, 2023

Should make workflow/ensemble/sim dirs easier to read and maintain.

@jlnav jlnav requested a review from shuds13 March 15, 2023 19:27
@@ -56,7 +57,8 @@ def test_location_stack():

# Push registered location (we should move
s.push_loc(0)
assert s.stack == [None, start_dir], "Directory stack is incorrect." "Wanted [None, {}], got {}.".format(
stack = s.stack
assert stack == [None, Path(start_dir)], "Directory stack is incorrect." "Wanted [None, {}], got {}.".format(
Copy link
Member

Choose a reason for hiding this comment

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

Isn't Path already applied? Is this passing?

Copy link
Member

Choose a reason for hiding this comment

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

Ok, it passes, but I dont think its needed

Copy link
Member Author

Choose a reason for hiding this comment

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

Most of this infrastructure is from David, and I just adjusted it to use Paths.

push_loc() doesn't assume a path, this part tests that self.stack.append(Path.cwd()) works properly.

When we register a location on line 35 we need to make sure we can return to the starting directory by making sure it's on the stack.

@shuds13
Copy link
Member

shuds13 commented May 1, 2023

Will need to resolve comments/conflicts then I approve this.

@jlnav jlnav merged commit 5909f42 into develop May 2, 2023
12 of 13 checks passed
@jlnav jlnav deleted the refactor/pathlib branch May 2, 2023 16:25
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.

None yet

3 participants