-
Notifications
You must be signed in to change notification settings - Fork 104
Implement c-type cells in crystallography module #2756
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
Changes from 3 commits
1b6c90f
9572f44
045afeb
ab1acac
87d22b4
c7e15d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ | |
| __contact__ = "Jerome.Kieffer@ESRF.eu" | ||
| __license__ = "MIT" | ||
| __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
| __date__ = "08/10/2025" | ||
| __date__ = "09/01/2026" | ||
| __status__ = "production" | ||
|
|
||
|
|
||
|
|
@@ -57,6 +57,57 @@ class ReflectionCondition: | |
| Help is welcome to polish this class and fix the non-validated ones. | ||
| """ | ||
|
|
||
| @staticmethod | ||
| def default(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| Default selection rule: h=k=l=0 is forbidden | ||
| """ | ||
| return not (h == 0 and k == 0 and l == 0) | ||
|
|
||
| type_P = default | ||
|
|
||
| @staticmethod | ||
| def type_A(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| End-centered A type: h+l even | ||
| """ | ||
| return ((h + l) % 2 == 0) | ||
|
|
||
| @staticmethod | ||
| def type_B(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| End-centered B type: k+l even | ||
| """ | ||
| return ((k + l) % 2 == 0) | ||
|
||
|
|
||
| @staticmethod | ||
| def type_C(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| End-centered C type: h+k even | ||
| """ | ||
| return ((h + k) % 2 == 0) | ||
|
|
||
| @staticmethod | ||
| def type_F(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| Face-centered type: h,k,l all even or all odd | ||
| """ | ||
| return (h % 2 + k % 2 + l % 2) in (0, 3) | ||
kif marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @staticmethod | ||
| def type_I(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| Body-centered type: h+k+l even | ||
| """ | ||
| return (h + k + l) % 2 == 0 | ||
|
|
||
| @staticmethod | ||
| def type_R(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
| Rhombohedral type: h-k+l multiple of 3 | ||
| """ | ||
| return ((h - k + l) % 3 == 0) | ||
|
||
|
|
||
| @staticmethod | ||
| def group1_P1(h: int, k: int, l: int) -> bool: # noqa: E741 | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.