Skip to content

Fix parallel inventory calculation with dirty Brightway databases - #69

Open
langeluca wants to merge 1 commit into
RWTH-LTT:mainfrom
langeluca:fix/clean-databases-before-parallel-workers
Open

langeluca wants to merge 1 commit into
RWTH-LTT:mainfrom
langeluca:fix/clean-databases-before-parallel-workers

Conversation

@langeluca

Copy link
Copy Markdown

Summary

  • clean pending Brightway database changes in the parent process before starting parallel inventory workers
  • prevent spawned workers from concurrently writing the shared Brightway database metadata file
  • add a regression test that verifies the registry is cleaned before the process executor is constructed

Fixes #68.

Validation

  • uv run --extra dev python -m pytest tests/test_background_inventory_performance.py::test_parallel_cleans_database_registry_before_workers -q
  • Black, isort, and Flake8 pass for the changed test; Black and isort pass for both changed files
  • the original Windows notebook reproduction completed parallel inventory calculation for four background databases after applying the same parent-process clean

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Parallel inventory calculation fails on Windows when Brightway databases are dirty

1 participant