pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Add F* diagram generator to pymatgen

Open jonathanjdenney opened this issue 2 years ago • 9 comments

I have written code that takes a list of symmetrized structure objects and generates an f* diagram automatically with the plotly library.

Checklist

  • [x] Google format doc strings added. Check with ruff.
  • [x] Type annotations included. Check with mypy.
  • [x] 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

jonathanjdenney avatar Aug 28 '23 17:08 jonathanjdenney

@janosh Everything on this pull request looks good from my end. Let me know if there are any changes you want me to make.

jonathanjdenney avatar Sep 01 '23 17:09 jonathanjdenney

@janosh I got the tests to work with just one cif that is already in the test files directory. Please let me know if there are other changes you would like.

jonathanjdenney avatar Sep 04 '23 14:09 jonathanjdenney

@jonathanjdenney There are still 33 changed files and 23k changed lines which make this PR very hard to review. The purpose of these 3 files is obvious.

Screenshot 2023-09-08 at 9 04 16 PM

Could you either explain the purpose of or remove the other 30 files?

janosh avatar Sep 08 '23 19:09 janosh

@janosh Sorry, I didn't realize it thinks I changed/added all those files. The ones you highlighted are the only ones I deliberately added. I'm guessing the others are the remnants of some merge error or something. I will get rid of them.

jonathanjdenney avatar Sep 08 '23 19:09 jonathanjdenney

@janosh Sorry, I didn't realize it thinks I changed/added all those files. The ones you highlighted are the only ones I deliberately added. I'm guessing the others are the remnants of some merge error or something. I will get rid of them.

I'm looking through the extra files and in all of them they are treated as changed files but the addition and deletion lines are identical. I don't what happened, but the files are supposed to be there as they are in the main pymatgen code as well. I'm not quite sure how to move forward. Should I just delete those files from my local version and make that as a pull request? I feel like that would have the same problem of showing as 30 edited files.

jonathanjdenney avatar Sep 08 '23 19:09 jonathanjdenney

I think you need to run sth like

git checkout master -- space/separated paths/to/files you/want/to/revert

janosh avatar Sep 08 '23 19:09 janosh

@jonathanjdenney I removed all the excess files and gzipped pymatgen/analysis/fstar/neutron_factors.csv. The tests look a bit meagre. Maybe you can think of more things to test? E.g. uncovered edge cases?

janosh avatar Sep 16 '23 23:09 janosh

@jonathanjdenney I removed all the excess files and gzipped pymatgen/analysis/fstar/neutron_factors.csv. The tests look a bit meagre. Maybe you can think of more things to test? E.g. uncovered edge cases?

I added a few ValueError messages for situations I know won't work. Specifically structures with less than 3 unique sites, and neutron scattering for atomic numbers greater than 96. I'm having trouble thinking of any more edge cases than that. I'm not sure of any specific tests I can add.

Also I would like to set up a tutorial for this, as some of it's features are not all that intuitive. What would be the best way to go about setting that up?

jonathanjdenney avatar Sep 18 '23 14:09 jonathanjdenney