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

Fixes and updating version number #81

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Conversation

kratman
Copy link
Collaborator

@kratman kratman commented Dec 20, 2024

Changes:

  • Update version number to v0.5.0 so that users can pin to bpx<0.5.0 if required.
  • Fixed some typing errors due to paths/strings
  • Switched to the default JSON implementation since there did not seem to be a need to install the other dependency
  • Switched copy.copy() to copy.deepcopy() as an extra layer of safety since all of the tests interact with the same dictionary
  • Disabled fail-fast since the tests are quick

@kratman
Copy link
Collaborator Author

kratman commented Dec 20, 2024

@rtimms There are a lot of experimentation commits in here, so we should definitely squash this PR

Copy link
Collaborator Author

@kratman kratman left a comment

Choose a reason for hiding this comment

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

Explanations

Comment on lines -101 to -111
# Delete
tmp.close()
Path(tmp.name).unlink(missing_ok=True)
if module.__cached__:
cached_file = Path(module.__cached__)
cached_path = cached_file.parent
cached_file.unlink(missing_ok=True)
if not any(cached_path.iterdir()):
cached_path.rmdir()

# return the new function object
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was causing failures due to cached files not being found. It did not seem necessary

@@ -26,13 +31,13 @@ def parse_bpx_obj(bpx: dict, v_tol: float = 0.001) -> BPX:
return BPX.model_validate(bpx)


def parse_bpx_file(filename: str, v_tol: float = 0.001) -> BPX:
def parse_bpx_file(filename: str | Path, v_tol: float = 0.001) -> BPX:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This makes the file name more flexible


bpx = ""
if filename.endswith((".yml", ".yaml")):
if str(filename).endswith((".yml", ".yaml")):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Related to the path check

@kratman kratman self-assigned this Dec 20, 2024
kratman added a commit that referenced this pull request Dec 20, 2024
Updating the changelog to match #81
@rtimms rtimms merged commit dce7051 into FaradayInstitution:main Dec 20, 2024
9 checks passed
rtimms pushed a commit that referenced this pull request Dec 20, 2024
Updating the changelog to match #81
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