Skip to content

Add premise>=2.3.7 dependency pin, Python 3.10 floor, and pytest.mark.slow CI marker#15

Open
sustainablewendy wants to merge 10 commits intoSwolfPy-Project:masterfrom
sustainablewendy:chore/premise-dependency-ci-test-strategy
Open

Add premise>=2.3.7 dependency pin, Python 3.10 floor, and pytest.mark.slow CI marker#15
sustainablewendy wants to merge 10 commits intoSwolfPy-Project:masterfrom
sustainablewendy:chore/premise-dependency-ci-test-strategy

Conversation

@sustainablewendy
Copy link

Summary

  • Pin premise to >=2.3.7 in requirements.txt (BW2.5-compatible floor version)
  • Bump requires-python to >=3.10 in pyproject.toml to match premise's minimum requirement
  • Register pytest.mark.slow marker in both pyproject.toml and conftest.py (belt-and-suspenders)

Test plan

  • pytest tests/ -m "not slow" -v → 7 passed, 0 failed
  • No PytestUnknownMarkWarning emitted
  • No slow/credential-gated tests collected
  • tests/test_prospective_lca.py not yet created — confirmed not collected

Checklist

  • Tests passing (7/7)
  • No regressions
  • CLAUDE.md unchanged (no architecture changes)
  • No direct commits to master

Science Quality Review

Science review: N/A (trivial chore — dependency version pin and pytest configuration only)

🤖 Generated with Claude Code

Wendy and others added 10 commits February 19, 2026 14:01
…de PRD

Core migration (Phase 1):
- Replace brightway2==2.4.1 with brightway25>=1.0 (bw2data 4.x, bw2calc 2.x, bw2io 0.9.x)
- Migrate all API: Database(), get_activity() -> get_node(), LCA/MultiLCA construction,
  lca.reverse_dict() -> remap_inventory_dicts(), matrix access patterns
- Add uuid_migration.py: BIOSPHERE_UUID_MIGRATION table mapping 11 legacy ecoinvent 3.5
  biosphere3 UUIDs to current equivalents; migrate_biosphere_key() / original_biosphere_key()
- ProcessDB.Write_DB(): remap stale biosphere keys via migration table (preserves counts)
- Technosphere._write_technosphere(): skip 2 unreplaceable flows (Metiram, Tri-allate)
- Required_keys.py: correct 11 UUID entries for current biosphere3
- swolfpy_method.py: skip missing LCIA CFs with warning
- Technosphere.py: monkey-patch bw2io LCIAImporter._reformat_cfs for tuple compatibility
- __init__.py: make PySide2/GUI import optional for headless environments
- tests/test_swolfpy.py: use original_biosphere_key() for biosphere lookup; 1 passed
- Apply black + isort formatting across all modules

Documentation:
- Add CLAUDE.md: central orchestration document with architecture, conventions, roadmap
- Add docs/PRD_ecoinvent_upgrade.md: PRD for ecoinvent 3.5 -> 3.11/3.12 data upgrade
  covering 6 work streams, effort estimates, blockers, and success criteria

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Relocate docs/PRD_ecoinvent_upgrade.md to ../docs/ (wendylab-swolfpy/docs/)
so all workspace PRDs live at the monorepo root, not inside the code repo.
Update CLAUDE.md docs section to reflect the new path convention.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 1: Upgrade to Brightway 2.5, add UUID migration, and add ecoinvent upgrade PRD
Add PRD_dynamic_lca.md to workspace docs/ directory covering the complete
technical specification for implementing DynamicLCA class with bw_temporalis.

PRD includes:
- Problem statement (why dynamic LCA matters for waste management)
- Complete DynamicLCA class API (constructor, attach_temporal_distributions, calculate)
- Integration pattern with existing LCA_matrix
- Test scenario specification (synthetic LF + WTE system)
- Output contract (annual GWP DataFrame) for Phases 4/5/6
- 4 work streams with 7-9 day effort estimate
- Success criteria and open questions

Update CLAUDE.md docs table to register the new PRD.

This PRD provides sufficient context for a separate Claude Code session to
implement Phase 2 without additional design decisions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add Phase 2 PRD: Temporalis dynamic LCA integration
- Implement DynamicLCA class in swolfpy/dynamic_lca.py
  - Wraps bw_temporalis.TemporalisLCA for time-resolved LCA
  - Supports temporal distribution attachment (exponential decay, immediate, uniform)
  - Dynamic GWP characterization using physics-based CRF
  - Returns annual timeline DataFrame

- Add comprehensive test suite in tests/test_dynamic_lca.py
  - Minimal synthetic test project (LF + WTE + scenario)
  - Test temporal distribution builders (exponential, immediate, uniform)
  - Test temporal distribution attachment
  - Test dynamic LCA calculation with timeline output
  - Test get_timeline() method

- Fix Brightway 2.5 compatibility issue in LCA_matrix.py
  - Rename biosphere_dict/activities_dict to avoid collision with parent properties
  - Use _biosphere_dict_reversed/_activities_dict_reversed instead
  - Update Optimization.py to use renamed attribute

- Update swolfpy/__init__.py to export DynamicLCA
- Update CLAUDE.md module map and roadmap

Phase 2 implementation complete. Awaiting science quality review per Git Workflow Step 7.

TODO tags added per science review recommendations from PR #2:
- TODO(LCA-REVIEW-PR-2): Document decay constant source (line 172)
- TODO(LCA-REVIEW-PR-2): Document GWP100 time horizon (line 228)
- Call timeline.build_dataframe() before characterization (required by bw_temporalis API)
- Relax test assertions for timeline span and cumulative GWP
  - Timeline may extend beyond characterization_period for long temporal distributions
  - Dynamic CRF-based GWP may differ from static GWP100 factors

All 6 tests now passing.
Test coverage: swolfpy/dynamic_lca.py
Add DynamicLCA class with Temporalis integration (Phase 2)

- New swolfpy/dynamic_lca.py module with DynamicLCA class
- Comprehensive test suite (6 tests, 100% coverage)
- Fixed Brightway 2.5 compatibility in LCA_matrix
- Science quality review approved ✅
- Code review approved ✅

Reviews:
- Science: ../docs/reviews/Review_PR-3_phase2-implementation-dynamic-lca_2026-02-21.md
- Code: ../docs/reviews/CodeReview_PR-14_phase2-implementation-dynamic-lca_2026-02-22.md

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 2 (Temporalis integration) has been merged to master:
- DynamicLCA class implemented and tested
- Science quality review approved
- Code review approved
- All 6 tests passing with 100% coverage

Next: Phase 3 (Premise integration)
….slow CI marker

- Pin premise to >=2.3.7 (BW2.5-compatible floor) in requirements.txt
- Bump requires-python to >=3.10 to match premise's requirement
- Register pytest.mark.slow in pyproject.toml markers and conftest.py
- Enables CI to run full unit suite with -m "not slow" without ecoinvent credentials

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant