-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
@rtimms There are a lot of experimentation commits in here, so we should definitely squash this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanations
# 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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")): |
There was a problem hiding this comment.
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
Updating the changelog to match #81
Updating the changelog to match #81
Changes:
bpx<0.5.0
if required.copy.copy()
tocopy.deepcopy()
as an extra layer of safety since all of the tests interact with the same dictionary