Skip to content

Conversation

@pm-gusmano
Copy link

Currently when using a Material class constructed with a from_* method, Pylance will throw an error if you try to access a material property (e.g. through .get_density) because the from_* methods will return a Material or None. This PR updates the from_* methods to raise errors instead of return None to make them more user-friendly.

Paul Gusmano added 4 commits September 30, 2025 16:49
This improves static analysis and error handling by raising exceptions instead of printing messages and returning None.
Helps with static analysis and code readability.
Makes more sense, given atomic weight is a quantity.
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