Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element composition dict with str and mixed keys #100

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

lmseidler
Copy link
Member

  • added the capability to use composition dicts with string keys instead of atomic number keys, as well as mixed keys
  • added test cases for dict[int, tuple[int, int]], dict[str, tuple[int, int]], dict[str | int, tuple[int, int]]
  • added check for validity of provided atomic numbers in composition dict (check, if atomic number in PSE table)
  • side-effect is that element composition is effectively a copy of the input argument, protecting the attribute from possibly unwanted changes due to passing by reference when using a dict as input

Copy link
Member

@marcelmbn marcelmbn left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for contributing!

Before merging:

  1. Have you checked if pytest -vv --optional succeeds as well? (Contains all tests that depend on external non-Python dependencies.)
  2. Can you update the Python API description in README.md and the corresponding lines/descriptions in the sample mindlessgen.toml (only if applicable)?
  3. Can you add a line to CHANGELOG.md, describing your changes?

src/mindlessgen/prog/config.py Outdated Show resolved Hide resolved
src/mindlessgen/prog/config.py Outdated Show resolved Hide resolved
@marcelmbn marcelmbn added enhancement New feature or request code-standard Enhancing the code standard and all "backend-only"-related PRs that do not alter functionality. labels Jan 6, 2025
lmseidler and others added 2 commits January 8, 2025 13:50
Co-authored-by: Marcel Mueller <marcel.mueller@thch.uni-bonn.de>
Co-authored-by: Marcel Mueller <marcel.mueller@thch.uni-bonn.de>
@marcelmbn
Copy link
Member

On my machine, all tests (including --optional) pass on branch lmseidler:main.
So, just points 2 and 3 in the previous comment are left. 🙂

Copy link
Member

@marcelmbn marcelmbn left a comment

Choose a reason for hiding this comment

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

Great, thanks for your contribution!

@lmseidler lmseidler merged commit c2087b2 into grimme-lab:main Jan 8, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-standard Enhancing the code standard and all "backend-only"-related PRs that do not alter functionality. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants