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

standardize export & restore of diffractometer configuration #279

Merged
merged 98 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
c3b5c1a
MNT #256 make this more obvious
prjemian Oct 26, 2023
f8ce51d
TST #256 define some common test components
prjemian Oct 26, 2023
16d2bc8
TST #256 apply common structures
prjemian Oct 26, 2023
7a3398e
ENH #256 new configuration export/restore
prjemian Oct 26, 2023
78868f5
TST #256 test new code
prjemian Oct 26, 2023
83390be
ENH #256 Simplify for high-symmetry crystals
prjemian Oct 26, 2023
d9a56a4
TST #256 was failing locally
prjemian Oct 26, 2023
c3b559e
MNT #256 add datetime to configuration
prjemian Oct 26, 2023
42c63ea
TST #256 don't compare datetime keys
prjemian Oct 26, 2023
b9ae623
DOC #256
prjemian Oct 26, 2023
5e34515
DOC #256 ctach up on the history
prjemian Oct 26, 2023
133644c
DOC #256 one more catch-up
prjemian Oct 26, 2023
d337770
Merge branch 'main' into 256-orientation-dict
prjemian Oct 26, 2023
1a1f94d
DOC #256 sort
prjemian Oct 26, 2023
aec2fc0
MNT #256 do not sort the keys in the YAML output
prjemian Oct 26, 2023
99a79a2
Update hkl/tests/test_configuration.py
prjemian Oct 27, 2023
51f02fc
Update hkl/configuration.py
prjemian Oct 27, 2023
aac09a2
Update hkl/configuration.py
prjemian Oct 27, 2023
ed381f6
Update hkl/configuration.py
prjemian Oct 27, 2023
9e7946e
Update hkl/tests/test_configuration.py
prjemian Oct 27, 2023
ce059b4
Update hkl/tests/test_tardis.py
prjemian Oct 27, 2023
0ad4924
Update hkl/util.py
prjemian Oct 27, 2023
d834db8
Update docs/source/configuration.rst
prjemian Oct 27, 2023
5853e31
Update docs/source/configuration.rst
prjemian Oct 27, 2023
2a2d99d
Update docs/source/configuration.rst
prjemian Oct 27, 2023
ea9fed1
MNT #256 per review
prjemian Oct 27, 2023
1c97c8c
MNT #256 per review
prjemian Oct 27, 2023
0f387e0
MNT #256 relocate helpers, remove unittest legacy
prjemian Oct 27, 2023
a16d515
MNT #256 refactor, isort, relative imports
prjemian Oct 27, 2023
f6bec91
MNT #256 refactor per review
prjemian Oct 27, 2023
7d15dac
TST #256 per review
prjemian Oct 27, 2023
a421952
MNT #256 per review
prjemian Oct 27, 2023
1ebd237
MNT #256 finer-grained tests per review
prjemian Oct 27, 2023
8457175
MNT #256 expose defaults, per review
prjemian Oct 27, 2023
ded08d9
Update docs/source/configuration.rst
prjemian Oct 27, 2023
693e4dc
Update docs/source/configuration.rst
prjemian Oct 27, 2023
6f4f4c5
MNT #256 refactor assert to check and raise
prjemian Oct 27, 2023
503138a
DOC #256
prjemian Oct 28, 2023
ad98489
WIP #279 rewrite in progress
prjemian Oct 28, 2023
54f1d72
PKG #279 uses apischema now
prjemian Oct 28, 2023
8e63abf
DOC #279 typo
prjemian Oct 28, 2023
f2aee7a
MNT #279 restore API parts
prjemian Oct 28, 2023
ee5e331
MNT #279 rename
prjemian Oct 28, 2023
c1f57de
MNT #279 rename, "class" is reserved
prjemian Oct 28, 2023
859594f
MNT #279 replacement ready
prjemian Oct 28, 2023
fffd22d
DOC #279 new_lattice
prjemian Oct 28, 2023
5541eee
DOC #279 synchronize API & docs with prior version
prjemian Oct 28, 2023
c610b58
DOC #279 update the example files
prjemian Oct 28, 2023
e3d04e6
DOC #279
prjemian Oct 28, 2023
32fd274
Update RELEASE_NOTES.rst
prjemian Oct 29, 2023
173aa3e
MNT #279 per review: check not zero
prjemian Oct 29, 2023
9e2f381
MNT #279 physics
prjemian Oct 29, 2023
27a6fbe
MNT #279 per review, 0 < unit cell angles < 180
prjemian Oct 29, 2023
a921c28
DOC #279 per review add wavelength to message
prjemian Oct 29, 2023
b0ffe8f
MNT #279 per review
prjemian Oct 29, 2023
ab5b0c6
ENH #279 for unanticipated terms
prjemian Oct 29, 2023
85d9b68
MNT #279 use factory instead of default value
prjemian Oct 30, 2023
2c04e5c
TST #279 restore attr tests
prjemian Oct 30, 2023
d86da16
TST #279 work-in-progress
prjemian Oct 30, 2023
acee3a8
MNT #279 per review, spell it out
prjemian Oct 31, 2023
cea8f7e
MNT #279 per review, use dataclasses.asdict()
prjemian Oct 31, 2023
6fe62fa
MNT #279 per review, raise exception
prjemian Oct 31, 2023
a850a05
DOC #279 help find things
prjemian Oct 31, 2023
8115256
TST #279 test _all_ the DCxyz classes
prjemian Oct 31, 2023
dc3d6a0
Update hkl/configuration.py
prjemian Oct 31, 2023
096c0cd
DOC #279
prjemian Oct 31, 2023
5ed1bb7
MNT #279 rely on finally clause
prjemian Oct 31, 2023
46d1398
Merge pull request #280 from bluesky/279-refactor-and-use-typing-and-…
prjemian Oct 31, 2023
4ca1243
DOC #256 add new_lattice
prjemian Oct 31, 2023
3fc5482
DOC #256 __init__ not always available for docs
prjemian Oct 31, 2023
ee8e618
TST #256 explicit rather than import
prjemian Oct 31, 2023
b55dde5
MNT #256 remove unused imports
prjemian Oct 31, 2023
bbc3432
MNT #256 add restore from file (as pathlib object)
prjemian Oct 31, 2023
d5c03fb
DOC #256
prjemian Oct 31, 2023
2b0f57b
Update hkl/tests/test_tardis.py
prjemian Nov 1, 2023
eef187f
MNT #256 per review, avoid circular import traps
prjemian Nov 1, 2023
8775b45
TST #256 remove unused imports
prjemian Nov 1, 2023
9032894
MNT #256 to validate restore
prjemian Nov 1, 2023
fc77275
MNT #256 required v. optional, and documentation
prjemian Nov 1, 2023
ca38729
MNT #256 validate computational engine selection
prjemian Nov 1, 2023
d041400
ENH #256 add export to file as pathlib object
prjemian Nov 1, 2023
8eef8af
MNT #256 U matrix is not required
prjemian Nov 1, 2023
473f61f
MNT #256 restore_constraints is an option
prjemian Nov 1, 2023
8550a0f
MNT #256 update config file examples
prjemian Nov 1, 2023
fe85c87
TST #256 restore_constraints should be a bool
prjemian Nov 1, 2023
aed169b
STY #256
prjemian Nov 1, 2023
0b23c5f
Update docs/source/configuration.rst
prjemian Nov 2, 2023
6f33391
DOC #256 code-block
prjemian Nov 2, 2023
131dd97
Merge branch '256-orientation-dict' of https://github.com/bluesky/hkl…
prjemian Nov 2, 2023
2146ed2
PKG #256
prjemian Nov 2, 2023
7438781
Update hkl/configuration.py
prjemian Nov 2, 2023
e07ff12
DOC #256 attribute doc syntax
prjemian Nov 2, 2023
b2036cc
MNT #256 indent=2 default
prjemian Nov 2, 2023
07de552
DOC #256 LaTeX syntax
prjemian Nov 2, 2023
fea4f1a
DOC #256 note
prjemian Nov 2, 2023
8e30eeb
DOC #256 reST syntax
prjemian Nov 2, 2023
371f723
DOC #256
prjemian Nov 2, 2023
82eb9b5
DOC #256
prjemian Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ include pyproject.toml
include pytest.ini

recursive-include docs *.rst conf.py Makefile make.bat
recursive-include Makefile README.md *.ipynb resources/*
recursive-include . Makefile README.md *.ipynb resources/*
recursive-include . e4c-config.json
recursive-include . e4c-config.yml

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
16 changes: 16 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ v1.1 (expected 2023-12)

Add new geometries from upstream *libhkl*.

New Features and/or Enhancements
--------------------------------

* Add ``DiffractometerConfiguration`` to export & restore configuration and orientation.
* Add ``Petra3_p23_4c`` diffractometer geometry.
* Add ``Petra3_p23_6c`` diffractometer geometry.
* Add ``SoleilNanoscopiumRobot`` diffractometer geometry.
* Add ``SoleilSixsMed2p3v2`` diffractometer geometry.
* Export and reload diffractometer configuration as JSON string, YAML string, or Python dictionary.

Fixes
-----

Expand All @@ -29,6 +39,12 @@ Fixes
Maintenance
-----------

* Add pre-commit checks.
* Add ``apischema`` to package requirements.
* Add test for ``or_swap()``.
* Expand testing to to Py3.8 - Py3.11.
* Fix code in ``util.restore_reflections()`` that failed unit tests locally.
* Make it easier to find the SPEC command cross-reference table.
* Update packaging to latest PyPA recommendations.

v1.0.4 (released 2023-10-06)
Expand Down
200 changes: 200 additions & 0 deletions docs/source/_static/e4c-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"geometry": "E4CV",
"engine": "hkl",
"library": "gi.repository.Hkl",
"mode": "bissector",
"canonical_axes": [
"omega",
"chi",
"phi",
"tth"
],
"real_axes": [
"omega",
"chi",
"phi",
"tth"
],
"reciprocal_axes": [
"h",
"k",
"l"
],
"constraints": {
"omega": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"chi": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"phi": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
},
"tth": {
"low_limit": -180.0,
"high_limit": 180.0,
"value": 0.0,
"fit": true
}
},
"samples": {
"main": {
"name": "main",
"lattice": {
"a": 1.54,
"b": 1.54,
"c": 1.54,
"alpha": 90.0,
"beta": 90.0,
"gamma": 90.0
},
"reflections": [],
"UB": [
[
4.079990459207523,
-2.4982736282101165e-16,
-2.4982736282101165e-16
],
[
0.0,
4.079990459207523,
-2.4982736282101165e-16
],
[
0.0,
0.0,
4.079990459207523
]
],
"U": [
[
1.0,
0.0,
0.0
],
[
0.0,
1.0,
0.0
],
[
0.0,
0.0,
1.0
]
]
},
"vibranium": {
"name": "vibranium",
"lattice": {
"a": 6.283185307179586,
"b": 6.283185307179586,
"c": 6.283185307179586,
"alpha": 90.0,
"beta": 90.0,
"gamma": 90.0
},
"reflections": [
{
"reflection": {
"h": 4.0,
"k": 0.0,
"l": 0.0
},
"position": {
"omega": -145.451,
"chi": 0.0,
"phi": 0.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": false,
"flag": 1
},
{
"reflection": {
"h": 0.0,
"k": 4.0,
"l": 0.0
},
"position": {
"omega": -145.451,
"chi": 0.0,
"phi": 90.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": true,
"flag": 1
},
{
"reflection": {
"h": 0.0,
"k": 0.0,
"l": 4.0
},
"position": {
"omega": -145.451,
"chi": 90.0,
"phi": 0.0,
"tth": 69.0966
},
"wavelength": 1.54,
"orientation_reflection": true,
"flag": 1
}
],
"UB": [
[
1.2217304763701863e-05,
-0.9999999999253688,
-1.7623547209572502e-15
],
[
-1.4926257043558267e-10,
-1.4349296274686127e-42,
-1.0000000000000002
],
[
0.9999999999253688,
1.221730476364063e-05,
-1.492626316575311e-10
]
],
"U": [
[
1.2217304763701863e-05,
-0.9999999999253688,
-1.8235863128158895e-15
],
[
-1.4926257043558267e-10,
-9.139696455822134e-27,
-1.0000000000000002
],
[
0.9999999999253688,
1.2217304763701863e-05,
-1.4926257042444305e-10
]
]
}
},
"name": "e4c",
"datetime": "2023-11-01 16:11:39.049412",
"wavelength_angstrom": 1.54,
"energy_keV": 8.050921974025975,
"hklpy_version": "1.0.5.dev122+g473f61f",
"library_version": "v5.0.0.3001",
"python_class": "SimulatedE4CV",
"other": {}
}
144 changes: 144 additions & 0 deletions docs/source/_static/e4c-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
geometry: E4CV
engine: hkl
library: gi.repository.Hkl
mode: bissector
canonical_axes:
- omega
- chi
- phi
- tth
real_axes:
- omega
- chi
- phi
- tth
reciprocal_axes:
- h
- k
- l
constraints:
omega:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
chi:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
phi:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
tth:
low_limit: -180.0
high_limit: 180.0
value: 0.0
fit: true
samples:
main:
name: main
lattice:
a: 1.54
b: 1.54
c: 1.54
alpha: 90.0
beta: 90.0
gamma: 90.0
reflections: []
UB:
- - 4.079990459207523
- -2.4982736282101165e-16
- -2.4982736282101165e-16
- - 0.0
- 4.079990459207523
- -2.4982736282101165e-16
- - 0.0
- 0.0
- 4.079990459207523
U:
- - 1.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 1.0
vibranium:
name: vibranium
lattice:
a: 6.283185307179586
b: 6.283185307179586
c: 6.283185307179586
alpha: 90.0
beta: 90.0
gamma: 90.0
reflections:
- reflection:
h: 4.0
k: 0.0
l: 0.0
position:
omega: -145.451
chi: 0.0
phi: 0.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: false
flag: 1
- reflection:
h: 0.0
k: 4.0
l: 0.0
position:
omega: -145.451
chi: 0.0
phi: 90.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: true
flag: 1
- reflection:
h: 0.0
k: 0.0
l: 4.0
position:
omega: -145.451
chi: 90.0
phi: 0.0
tth: 69.0966
wavelength: 1.54
orientation_reflection: true
flag: 1
UB:
- - 1.2217304763701863e-05
- -0.9999999999253688
- -1.7623547209572502e-15
- - -1.4926257043558267e-10
- -1.4349296274686127e-42
- -1.0000000000000002
- - 0.9999999999253688
- 1.221730476364063e-05
- -1.492626316575311e-10
U:
- - 1.2217304763701863e-05
- -0.9999999999253688
- -1.8235863128158895e-15
- - -1.4926257043558267e-10
- -9.139696455822134e-27
- -1.0000000000000002
- - 0.9999999999253688
- 1.2217304763701863e-05
- -1.4926257042444305e-10
name: e4c
datetime: '2023-11-01 16:13:24.744943'
wavelength_angstrom: 1.54
energy_keV: 8.050921974025975
hklpy_version: 1.0.5.dev122+g473f61f
library_version: v5.0.0.3001
python_class: SimulatedE4CV
other: {}
1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ API Reference
:glob:

calc
configuration
context
diffract
engine
Expand Down
Loading
Loading