-
Notifications
You must be signed in to change notification settings - Fork 45
Release r0.10.1 #824
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
Merged
+363
−192
Merged
Release r0.10.1 #824
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f2b361b
Update version to 0.10.1
AlexeyKozhevin 9375e1d
Bump fonttools from 4.55.8 to 4.60.2
dependabot[bot] 3841d79
Bump nbconvert from 7.16.6 to 7.17.0
dependabot[bot] e05e945
Bump protobuf from 6.32.0 to 6.33.5
dependabot[bot] 7cd5584
Bump urllib3 from 2.3.0 to 2.6.3
dependabot[bot] 77fe44b
Bump filelock from 3.17.0 to 3.20.3
dependabot[bot] c6d8903
Bump jupyterlab from 4.3.5 to 4.4.8
dependabot[bot] 28d9e46
Bump tornado from 6.4.2 to 6.5.5
dependabot[bot] c5eb845
Bump requests from 2.32.3 to 2.33.0
dependabot[bot] 2558385
Bump pygments from 2.19.1 to 2.20.0
dependabot[bot] 8c37b97
Bump onnx from 1.18.0 to 1.21.0
dependabot[bot] 4ce7a99
Bump pillow from 10.4.0 to 12.2.0
dependabot[bot] ccbf95b
Bump pytest from 8.3.4 to 9.0.3
dependabot[bot] 2d13991
Change process to thread (#825)
AlexeyKozhevin fb83942
Update batchflow/tests/detachable_test.py
AlexeyKozhevin 4954c5b
Apply changes
AlexeyKozhevin 2ff6469
Minor changes
AlexeyKozhevin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| """Test that the detachable decorator and Plot.save work with detach=True. | ||
|
|
||
| The original implementation used multiprocessing.Process which fails on Python 3.14 | ||
| due to a pickling error: `@wraps(func)` preserves `__qualname__`, so pickle resolves | ||
| `Plot.plot` by name and finds the wrapper instead of the original function. | ||
|
|
||
| Replacing Process with Thread avoids pickling entirely — figure saving doesn't need | ||
| process isolation. | ||
| """ | ||
|
|
||
| import os | ||
| import tempfile | ||
| import time | ||
|
|
||
| import numpy as np | ||
|
|
||
|
|
||
| def _wait_for_file(path, timeout=5): | ||
| """Poll until `path` exists or `timeout` seconds elapse.""" | ||
| deadline = time.monotonic() + timeout | ||
| while not os.path.exists(path) and time.monotonic() < deadline: | ||
| time.sleep(0.05) | ||
|
|
||
|
|
||
| def test_detachable_plot_with_detach(): | ||
| """Plot.plot with detach='save' should complete without PicklingError.""" | ||
| from batchflow.plotter.plot import Plot | ||
|
|
||
| data = np.random.rand(10, 10) | ||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| savepath = os.path.join(tmpdir, "test_detach.png") | ||
| p = Plot(data=data, mode="image", show=False, detach='save', savepath=savepath) | ||
| _wait_for_file(savepath) | ||
| assert p is not None | ||
| assert os.path.exists(savepath) | ||
|
|
||
|
|
||
| def test_plot_save_with_detach(): | ||
| """Plot.save with detach=True should complete without PicklingError.""" | ||
| from batchflow.plotter.plot import Plot | ||
|
|
||
| data = np.random.rand(10, 10) | ||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| savepath = os.path.join(tmpdir, "test_save_detach.png") | ||
| p = Plot(data=data, mode="image", show=False, savepath=savepath) | ||
| assert os.path.exists(savepath) | ||
|
|
||
| savepath2 = os.path.join(tmpdir, "test_save_detach2.png") | ||
| p.save(savepath=savepath2, detach=True) | ||
| _wait_for_file(savepath2) | ||
| assert os.path.exists(savepath2) | ||
|
|
||
|
|
||
| def test_detachable_plot_without_detach(): | ||
| """Plot.plot with detach=False (default) should work as before.""" | ||
| from batchflow.plotter.plot import Plot | ||
|
|
||
| data = np.random.rand(10, 10) | ||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| savepath = os.path.join(tmpdir, "test_no_detach.png") | ||
| Plot(data=data, mode="image", show=False, savepath=savepath) | ||
| assert os.path.exists(savepath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The
detachabledecorator docstring still says it runs the function in a “daemon process”, but the implementation now usesthreading.Thread. Please update the docstring (and any related docs in this file describingdetach) to reflect the new threading behavior so users don’t get misled about isolation/semantics.