#7519 - Move multiprocessing import for Pyodide support and enhance McBackend tests #7736
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.

Description
This PR addresses Pyodide compatibility (#7519) and enhances testing:
Pyodide Support (Make multiprocessing import local to support pyodide #7519):
multiprocessingimport from the top ofpymc/smc/sampling.pyto insiderun_chainsbeforemultiprocessing.Manager(). Prevents import errors in Pyodide/JupyterLite, wheremultiprocessingisn’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.CompileErrordue to 32-bit MinGW on 64-bit system.test_censored.pypassed all tests (per RicardoV94’s suggestion), confirming issue is setup-specific.Related Issue
Checklist
Type of change