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

Known lattice mapping #31

Closed
wants to merge 2 commits into from
Closed

Conversation

xivh
Copy link
Contributor

@xivh xivh commented Jul 17, 2024

  • expose lattice_isotropic_strain_cost and lattice_symmetry_breaking_strain_cost from c++
  • add map_lattices_without_reorientation to perform a lattice mapping from a known parent to deformed child, e.g. after VASP relaxation
  • did not change k_best for map_lattices in case the default value of None is needed somewhere else

def map_lattices_without_reorientation(
lattice1: xtal.Lattice,
lattice2: xtal.Lattice,
transformation_matrix_to_super=np.eye(3, dtype=int),
Copy link
Collaborator

Choose a reason for hiding this comment

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

For documenting optional arrays with a default, I've been using the convention

    transformation_matrix_to_super: typing.Optional[np.ndarray] = None,

With docs:

        transformation_matrix_to_super: Optional[np.ndarray] = None,
            An integer shape=(3,3) transformation matrix ...
            If None, :math:`T` is set to the identity matrix.
        

And then inside:

if transformation_matrix_to_super is None:
    transformation_matrix_to_super = np.eye(3, dtype=int)

Otherwise, I think the generated docs print the entire array in function signature.

@bpuchala
Copy link
Collaborator

Is this ready? It's marked as draft still.

@xivh xivh force-pushed the known_lattice_mapping branch from d69a2a7 to 47011c4 Compare August 15, 2024 21:56
@xivh xivh marked this pull request as ready for review August 15, 2024 21:56
@xivh
Copy link
Contributor Author

xivh commented Aug 15, 2024

Do you want me to add any tests?

@xivh xivh force-pushed the known_lattice_mapping branch from 47011c4 to 5f20cb0 Compare August 15, 2024 22:01
@bpuchala
Copy link
Collaborator

@xivh Thanks! I merged this on my system and made some edits. I think the force pushes are making it not recognized the it is already merged, so I will close it now.

@bpuchala bpuchala closed this Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants