Skip to content

Add select_by_species helper and freeze species as tuple (closes #66)#73

Merged
bjmorgan merged 5 commits intomainfrom
select-by-species
Apr 12, 2026
Merged

Add select_by_species helper and freeze species as tuple (closes #66)#73
bjmorgan merged 5 commits intomainfrom
select-by-species

Conversation

@bjmorgan
Copy link
Copy Markdown
Owner

Summary

  • StructureScene.species is now stored as a tuple, fixed at construction. No downstream code mutates it; the type annotation cascade is purely mechanical.
  • New select_by_species method filters a full-length per-atom array to keep only selected species, filling the rest with the appropriate missing sentinel (NaN for numeric, None for categorical). Handles integer-to-float and unicode-to-object promotion automatically. Works for 1-D and 2-D arrays.

Closes #66.

Copilot AI review requested due to automatic review settings April 12, 2026 11:11

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings April 12, 2026 11:20
Copy link
Copy Markdown

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


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

Comment thread src/hofmann/model/structure_scene.py
@bjmorgan bjmorgan merged commit 28387c9 into main Apr 12, 2026
9 checks passed
@bjmorgan bjmorgan deleted the select-by-species branch April 12, 2026 11:26
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.

Add StructureScene.select_by_species helper

2 participants