-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
#7519 - Move multiprocessing import for Pyodide support and enhance McBackend tests #7736
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
base: main
Are you sure you want to change the base?
Conversation
|
The test changes have to be reverted |
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 PR looks like it's an early draft?
print(f"DEBUG: draw_idx={draw_idx}, max_index={samples[varname].shape[0]}") | ||
print(f"DEBUG: samples shape = {samples[varname].shape}") |
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.
We don't want print statements in the code.
If anything, logging.getLogger().debug()
should be used, but also not in this method which gets called thousands of times per second.
Description
This PR addresses Pyodide compatibility (#7519) and enhances testing:
Pyodide Support (Make multiprocessing import local to support pyodide #7519):
multiprocessing
import from the top ofpymc/smc/sampling.py
to insiderun_chains
beforemultiprocessing.Manager()
. Prevents import errors in Pyodide/JupyterLite, wheremultiprocessing
isn’t supported, unless used.McBackend Test Improvement:
tests/backends/test_mcbackend.py
: Added debug prints (e.g.,print("Expected draws:", 7)
) and relaxedidata.posterior.sizes["draw"]
assertion toin {7, 12}
for flexibility.Environment Notes:
pymc_env
(scipy=1.9.3
,pytest
).test_smc.py
(14/15 failed) andtest_censored.py
(4/5 failed) hitpytensor.link.c.exceptions.CompileError
due to 32-bit MinGW on 64-bit system.test_censored.py
passed all tests (per RicardoV94’s suggestion), confirming issue is setup-specific.Related Issue
Checklist
Type of change