Skip to content

Conversation

@KedoKudo
Copy link
Collaborator

@KedoKudo KedoKudo commented Dec 9, 2025

Summary

Fixes #206 - Manifest isotopes list is ignored during resonance analysis.

  • Add isotopes: list[str] | None field to ManifestData with format validation
  • Parse isotopes from YAML frontmatter in extract_manifest()
  • Use manifest isotopes as priority level 2 in _get_isotope_composition():
    1. User-specified isotopes (highest priority) - equal weights
    2. Manifest isotopes list (new) - equal weights
    3. Enrichment dict - custom abundances
    4. Natural abundance (fallback)

Test plan

  • 15 new unit tests covering all edge cases
  • ManifestData.isotopes field validation (valid list, None, empty list, invalid formats, non-string elements)
  • extract_manifest parsing (parses list, handles missing/empty, works with enrichment)
  • _get_isotope_composition priority order (user > isotopes > enrichment > natural)
  • All 82 workflow tests pass
  • Pre-commit hooks pass (ruff, codespell, etc.)

🤖 Generated with Claude Code

Add support for explicit isotopes list in manifest to control which
isotopes are analyzed. Previously, the isotopes field in manifest YAML
was completely ignored, causing all natural isotopes to be included.

Changes:
- Add isotopes field to ManifestData with format validation
- Parse isotopes from YAML frontmatter in extract_manifest
- Use manifest isotopes as priority 2 in _get_isotope_composition:
  1. User-specified isotopes (highest)
  2. Manifest isotopes list (new)
  3. Enrichment dict
  4. Natural abundance (fallback)

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully fixes issue #206 by implementing support for parsing and using a manifest isotopes list in resonance analysis workflows. The implementation adds a new priority level for isotope composition determination, allowing users to specify an explicit list of isotopes in the manifest that takes precedence over enrichment values but can still be overridden by user-specified isotopes.

Key changes:

  • Added isotopes: list[str] | None field to ManifestData with comprehensive validation for isotope format (Element-MassNumber)
  • Integrated isotopes list into priority hierarchy as level 2 (between user-specified and enrichment)
  • Comprehensive test coverage with 15 new unit tests covering all edge cases and priority interactions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/pleiades/workflows/models.py Added isotopes field to ManifestData with @field_validator that validates isotope format using regex pattern ^[A-Z][a-z]?-\d+$
src/pleiades/workflows/resonance.py Updated extract_manifest() to parse isotopes from YAML frontmatter and modified _get_isotope_composition() to use manifest isotopes as priority level 2 with equal weights
tests/unit/pleiades/workflows/test_resonance.py Added 15 comprehensive unit tests covering ManifestData validation, extract_manifest parsing, and _get_isotope_composition priority order with various edge cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KedoKudo KedoKudo merged commit 69eb0b8 into feature/163-mcp-integration Dec 9, 2025
8 checks passed
@KedoKudo KedoKudo deleted the feature/206-manifest-isotopes-list branch December 9, 2025 01:31
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.

2 participants