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

Extend CubicSupercell transformation to also be able to look for orthorhombic cells #3938

Merged
merged 23 commits into from
Jul 23, 2024

Conversation

JaGeo
Copy link
Member

@JaGeo JaGeo commented Jul 19, 2024

Summary

Added code to also allow to search for orthorhombic supercells. Here, I also introduce the option to check for a maximum_length of the cells

@QuantumChemist will now take over and write the tests for this class and fix the linting etc. :)

@JaGeo JaGeo requested review from shyuep, janosh and mkhorton as code owners July 19, 2024 11:30
@JaGeo JaGeo changed the title Extend CubicSupercell transformation to also be able to look for orthorhombic cells [WIP] Extend CubicSupercell transformation to also be able to look for orthorhombic cells Jul 19, 2024
@JaGeo JaGeo marked this pull request as draft July 19, 2024 13:32
@QuantumChemist
Copy link
Contributor

The failing linting does not stem from our changes.

@JaGeo
Copy link
Member Author

JaGeo commented Jul 19, 2024

Once the other tests pass, this is ready for review

@JaGeo JaGeo marked this pull request as ready for review July 19, 2024 17:18
@JaGeo
Copy link
Member Author

JaGeo commented Jul 19, 2024

@shyuep @mkhorton @janosh this pull request is ready for review. The linting issues show up in different parts of the code.

@JaGeo JaGeo changed the title [WIP] Extend CubicSupercell transformation to also be able to look for orthorhombic cells Extend CubicSupercell transformation to also be able to look for orthorhombic cells Jul 19, 2024
@DanielYang59
Copy link
Contributor

DanielYang59 commented Jul 20, 2024

There are many mysteries in the world of linters, including why they jump up on untouched parts of the code out of the blue 🤣 .

I tried to push a PR to your branch but for some reason your branch wouldn't show up?

src/pymatgen/analysis/local_env.py:3051:32:

- if (m != j) and (m != k) and (not flag_xaxis):
+ if m not in {j, k} and (not flag_xaxis):

src/pymatgen/io/aims/parsers.py:333:12:

- if (line_start == LINE_NOT_FOUND) or (line_end == LINE_NOT_FOUND) or (line_end - line_start != n_kpts):
+ if LINE_NOT_FOUND in {line_start, line_end} or (line_end - line_start != n_kpts):

src/pymatgen/io/vasp/outputs.py:1707:25:

- if (
-                        tag == "eigenvalues_kpoints_opt"
-                        or tag == "projected_kpoints_opt"
-                        or (tag == "dos" and elem.attrib.get("comment") == "kpoints_opt")
-                    ):
+ if tag in {"eigenvalues_kpoints_opt", "projected_kpoints_opt"} or (
+                        tag == "dos" and elem.attrib.get("comment") == "kpoints_opt"
+                    ):

@JaGeo
Copy link
Member Author

JaGeo commented Jul 20, 2024

@DanielYang59 can you try again? You should now be allowed to do this

@DanielYang59
Copy link
Contributor

DanielYang59 commented Jul 20, 2024

Beautiful! Thanks for granting the access. Actually I was not looking for writing access to your fork, but to open a PR where your fork is the base repo, but I cannot find yours as the target repo for some reason.

@JaGeo
Copy link
Member Author

JaGeo commented Jul 20, 2024

@DanielYang59 i am very confused. You mean this branch https://github.com/JaGeo/pymatgen/tree/orthorhombic_supercell ?

@DanielYang59
Copy link
Contributor

Sorry for the confusion. For some reason I can see your fork now (wasn't showing up before):
image

Everything is working fine now! Thanks!

@JaGeo
Copy link
Member Author

JaGeo commented Jul 20, 2024

@DanielYang59 thank you 😀.

I hope someone will then merge our backward compatible code soon!

@DanielYang59
Copy link
Contributor

No problem!

@QuantumChemist
Copy link
Contributor

Beautiful! Thanks for granting the access. Actually I was not looking for writing access to your fork, but to open a PR where your fork is the base repo, but I cannot find yours as the target repo for some reason.

I had the same problem yesterday btw. I worked around it by starting the PR in the JaGeo repo. But good everything worked in the end.

@shyuep shyuep merged commit 8e39294 into materialsproject:master Jul 23, 2024
31 of 32 checks passed
@shyuep
Copy link
Member

shyuep commented Jul 23, 2024

Merged. Sometimes lint errors come up on other parts due to update of the linting software versions.

@JaGeo
Copy link
Member Author

JaGeo commented Jul 23, 2024

Thank you @shyuep

@DanielYang59 DanielYang59 deleted the orthorhombic_supercell branch July 24, 2024 01:25
@janosh janosh changed the title Extend CubicSupercell transformation to also be able to look for orthorhombic cells Extend CubicSupercell transformation to also be able to look for orthorhombic cells Aug 9, 2024
@janosh janosh added enhancement A new feature or improvement to an existing one trafos Concerning transformation classes labels Aug 9, 2024
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 trafos Concerning transformation classes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants