orix icon indicating copy to clipboard operation
orix copied to clipboard

Allow passing `Phase` instead of `Symmetry`

Open hakonanes opened this issue 1 year ago • 5 comments

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?

hakonanes avatar Apr 07 '24 11:04 hakonanes

@hakonanes Seems simple enough and would be a nice addition

CSSFrancis avatar Apr 07 '24 12:04 CSSFrancis

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?

harripj avatar Apr 07 '24 19:04 harripj

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

hakonanes avatar Apr 08 '24 05:04 hakonanes

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 🤔.

hakonanes avatar Apr 11 '24 18:04 hakonanes

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

harripj avatar Apr 11 '24 18:04 harripj