Closed SCiarella closed 3 months ago
Thanks @stefsmeets for the suggestions!
I'm wondering if we can simplify it a bit, from:
transforms = ['Normalize', 'Conventional', 'Symmetrize'] vasp_orientations.set_transformation(transforms) transformed_traj = vasp_orientations.execute_transformations()
to
transforms = ['Normalize', 'Conventional', 'Symmetrize'] transformed_traj = vasp_orientations.transform(transforms)
I have used this approach, it makes total sense!
Moreover, this PR partially covers #286 because now rectilinear_plot
uses Orientations.transformed_trajectory
which can be any series of transformations.
@tfamprikis can you check if this solves the problem described in #286?
This PR improves the
Orientations
class. In particular, this PR implements a Strategy design pattern to allow users to select which transformations to use and their order.Previous methods of
Orientations
have been reformatted into the abstract classesNormalize
,Conventional
, andSymmetrize
that perform their respective transformation. The user will then accessOrientation.transformed_trajectory
to get the result of any series of transformations, instead of using different_get*
methods.The specific outcomes of the PR are the following:
set_transformation
andexecute_transformation
Orientations.prim_to_conv_matrix
Normalize
transformation as needed.The corresponding notebook has been updated.