Skip to content

Fix issues with labels - #3169

Merged
janosh merged 5 commits into
materialsproject:masterfrom
stefsmeets:label-fix
Jul 20, 2023
Merged

Fix issues with labels#3169
janosh merged 5 commits into
materialsproject:masterfrom
stefsmeets:label-fix

Conversation

@stefsmeets

@stefsmeets stefsmeets commented Jul 20, 2023

Copy link
Copy Markdown
Contributor

Summary

This PR fixes some issues with labels and adds new tests for previously unspecified behaviour.

Major changes:

  • Site.label (and derivatives) defaults to .species_string instead of None
  • Add label attribute to Neighbor and PeriodicNeighbor

Closes #3166
Closes #3160

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

@janosh janosh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stefsmeets Thanks for putting together a PR so quickly! This looks great!

@janosh janosh added fix Bug fix PRs core Pymatgen core labels Jul 20, 2023
@janosh
janosh enabled auto-merge (squash) July 20, 2023 15:20
@janosh
janosh merged commit 9a98f4c into materialsproject:master Jul 20, 2023
@stefsmeets
stefsmeets deleted the label-fix branch July 21, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Pymatgen core fix Bug fix PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

label in Structure.as_dict() is None in the latest version AttributeError: attr='label' not found on PeriodicNeighbor

2 participants