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

adding same reflection should be ignored #248

Open
prjemian opened this issue Nov 10, 2022 · 1 comment
Open

adding same reflection should be ignored #248

prjemian opened this issue Nov 10, 2022 · 1 comment
Labels
hklpy2 For hklpy2 task
Milestone

Comments

@prjemian
Copy link
Contributor

When a user creates a file that is reloaded many times, such as during development, it can lead to the same reflections being added multiple times. We should handle this case more gracefully than to simply accumulate additional reflections.

Example:

  • fourc = Fourc(...
  • select_diffractometer(fourc)
  • new_sample(...
  • add_reflection(1,1,2, ...
  • add_reflection(-4,0,2, ...

These would be in a example.py file that is reloaded with %run -i example.py

@prjemian prjemian added the task label Nov 10, 2022
@prjemian prjemian added this to the v1.1 milestone Nov 10, 2022
@prjemian prjemian modified the milestones: v1.2, v2.0 Nov 1, 2023
@prjemian
Copy link
Contributor Author

prjemian commented Nov 1, 2023

This would be enabled in a Python reflection class with a dunder equal method:

def __eq__(self, other):
    return comparison_result

@prjemian prjemian added the hklpy2 For hklpy2 label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hklpy2 For hklpy2 task
Projects
None yet
Development

No branches or pull requests

1 participant