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

New Feature: Allow passing phase to sample generation #481

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

CSSFrancis
Copy link
Member

@CSSFrancis CSSFrancis commented Apr 7, 2024

Description of the change

Adds #480 for sampling generators.

Progress of the PR

Minimal example of the bug fix or new feature

a = 5.431
latt = Lattice(a, a, a, 90, 90, 90)
atom_list = []
for coords in [[0, 0, 0], [0.5, 0, 0.5], [0, 0.5, 0.5], [0.5, 0.5, 0]]:
    x, y, z = coords[0], coords[1], coords[2]
    atom_list.append(
        Atom(atype="Si", xyz=[x, y, z], lattice=latt)
    )  # Motif part A
    atom_list.append(
        Atom(atype="Si", xyz=[x + 0.25, y + 0.25, z + 0.25], lattice=latt)
    )  # Motif part B
struct = Structure(atoms=atom_list, lattice=latt)
p = Phase(structure=struct, space_group=227)
rotations = get_sample_reduced_fundamental(resolution=4, phase=phase)

For reviewers

  • The PR title is short, concise, and will make sense 1 year later.
  • New functions are imported in corresponding __init__.py.
  • New features, API changes, and deprecations are mentioned in the unreleased
    section in CHANGELOG.rst.
  • Contributor(s) are listed correctly in __credits__ in orix/__init__.py and in
    .zenodo.json.

@CSSFrancis CSSFrancis requested review from hakonanes and pc494 and removed request for hakonanes April 11, 2024 16:19
@hakonanes
Copy link
Member

Thanks for this, @CSSFrancis.

But, I suggest to wait with this until after the v0.12.0 release. As @harripj asked and I agreed with in #480, we should allow this all places where it makes sense.

Also, I'm not sure of the best implementation. Should we allow passing a Phase to the point_group parameter? What about to space_group parameter? Or should we replace these parameters with one which can be all these types?

@CSSFrancis
Copy link
Member Author

@hakonanes That's fair! We can just make the 0.12.0 release and then figure this out later if you think that is a good idea.

I was just trying to follow what was there previously. We should probably have one parameter that checks if it is a point group, a space group or phase or something that checks to make sure only one is defined.

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.

None yet

2 participants