Skip to content

Read site labels from cif file #3136

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

Merged
merged 5 commits into from
Jul 6, 2023

Conversation

stefsmeets
Copy link
Contributor

Summary

Major changes:

  • feature 1: Read site labels from cif file and store these under Structure.site_properties.

Closes #3135

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 merged commit b11f091 into materialsproject:master Jul 6, 2023
@janosh janosh added enhancement A new feature or improvement to an existing one io Input/output functionality labels Jul 6, 2023
@janosh
Copy link
Member

janosh commented Jul 6, 2023

Thanks @stefsmeets! 👍

@janosh
Copy link
Member

janosh commented Jul 6, 2023

Sorry, was a bit trigger happy on the merge. Tests didn't run on account of this change 1975b921f I just reverted. Could you do me a favor and take a look at the failing tests?

@janosh
Copy link
Member

janosh commented Jul 7, 2023

I reverted fc6cfaf and ef0d5a5
in 5cdc9d3 for now. Sorry about the inconvenience. Feel free to open another PR as tests will run correctly this time.

janosh added a commit that referenced this pull request Jul 11, 2023
* Store site label in `site_properties`

Revise implementation to fix test failures

* Add test

* pre-commit auto-fixes

* rename single-letter vars, use snake_case

* assert len(struct.site_properties["labels"]) == len(struct) and len(set(struct.site_properties["labels"])) == 4

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Janosh Riebesell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement to an existing one io Input/output functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get site labels from cif file
2 participants