pyxem / orix

Analysing crystal orientations and symmetry in Python
https://orix.readthedocs.io
GNU General Public License v3.0
78 stars 45 forks source link

Allow passing `Phase` instead of `Symmetry` #480

Open hakonanes opened 3 months ago

hakonanes commented 3 months ago

As @CSSFrancis pointed out in https://github.com/pyxem/orix/pull/478#issuecomment-2041084910, it may sometimes be simpler to pass a Phase with a point group set, rather than extracting the corresponding Symmetry, to functions like the sampling functions. Since a Phase only has one Symmetry, this should not be a problem.

I'm for this. What do other people think?

CSSFrancis commented 3 months ago

@hakonanes Seems simple enough and would be a nice addition

harripj commented 3 months ago

I think this would be a convenient addition to sampling.get_sample_reduced_fundamental. Would this also be applicable for other parts of the API?

hakonanes commented 3 months ago

That was my intention, yes,wherever it makes sense.

hakonanes commented 2 months ago

I'm not sure of the best implementation. Should we allow passing a Phase to functions with a point_group parameter? What about to the space_group parameter? Or should we replace these parameters with one which can be all these types? I haven't thought this through, but realize it requires some thought 🤔.

harripj commented 2 months ago

Would it be enough to improve the docstrings and examples with an example extracting the point_group from a Phase object?