xrdkit 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xrdkit-0.1.0 → xrdkit-0.2.0}/PKG-INFO +76 -25
- {xrdkit-0.1.0 → xrdkit-0.2.0}/README.md +75 -24
- {xrdkit-0.1.0 → xrdkit-0.2.0}/pyproject.toml +4 -1
- {xrdkit-0.1.0 → xrdkit-0.2.0}/pyproject.toml.orig +61 -58
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/__init__.py +94 -1
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/broadening.py +1170 -1155
- xrdkit-0.2.0/src/xrdkit/cell.py +309 -0
- xrdkit-0.2.0/src/xrdkit/cli.py +2951 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/config.py +981 -660
- xrdkit-0.2.0/src/xrdkit/density.py +365 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/gsas2.py +87 -8
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/gsas2_driver.py +267 -6
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/indexing.py +964 -750
- xrdkit-0.2.0/src/xrdkit/instrument.py +283 -0
- xrdkit-0.2.0/src/xrdkit/io.py +254 -0
- xrdkit-0.2.0/src/xrdkit/lattice.py +295 -0
- xrdkit-0.2.0/src/xrdkit/library.py +414 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/peaks.py +391 -340
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/phases.py +749 -494
- xrdkit-0.2.0/src/xrdkit/pipeline.py +2220 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/plotting.py +14 -1
- xrdkit-0.2.0/src/xrdkit/project.py +980 -0
- xrdkit-0.2.0/src/xrdkit/quality.py +254 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/structure.py +579 -470
- xrdkit-0.2.0/src/xrdkit/structures/perovskite/Amm2.toml +60 -0
- xrdkit-0.2.0/src/xrdkit/structures/perovskite/P4mm.toml +60 -0
- xrdkit-0.2.0/src/xrdkit/structures/perovskite/Pbnm.toml +63 -0
- xrdkit-0.2.0/src/xrdkit/structures/perovskite/Pm-3m.toml +49 -0
- xrdkit-0.2.0/src/xrdkit/structures/perovskite/R3c.toml +52 -0
- xrdkit-0.2.0/src/xrdkit/structures/ttb/P4bm.toml +110 -0
- xrdkit-0.2.0/src/xrdkit/structures/ttb/P4mbm.toml +118 -0
- xrdkit-0.2.0/src/xrdkit/symmetry.py +270 -0
- xrdkit-0.2.0/src/xrdkit/writeup.py +1213 -0
- xrdkit-0.1.0/src/xrdkit/density.py +0 -144
- xrdkit-0.1.0/src/xrdkit/io.py +0 -115
- xrdkit-0.1.0/src/xrdkit/lattice.py +0 -233
- {xrdkit-0.1.0 → xrdkit-0.2.0}/LICENSE +0 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/py.typed +0 -0
- {xrdkit-0.1.0 → xrdkit-0.2.0}/src/xrdkit/sizestrain.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xrdkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Reusable X-ray diffraction analysis toolkit for electroceramics research
|
|
5
5
|
Keywords: x-ray diffraction,XRD,powder diffraction,Rietveld,Le Bail,GSAS-II,materials science,ceramics,crystallography
|
|
6
6
|
Author: Amir Khesro
|
|
@@ -36,6 +36,13 @@ A reusable X-ray diffraction analysis toolkit for electroceramics research.
|
|
|
36
36
|
analysing XRD patterns, so that the same analysis code can be reused across
|
|
37
37
|
projects instead of being copied between one-off scripts.
|
|
38
38
|
|
|
39
|
+
New here? [docs/USER_GUIDE.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/USER_GUIDE.md) says what data you need, in
|
|
40
|
+
what form, and how to get from a raw scan to each result.
|
|
41
|
+
|
|
42
|
+
Starting from a machine with nothing installed?
|
|
43
|
+
[docs/GETTING_STARTED.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/GETTING_STARTED.md) sets up Python, xrdkit and
|
|
44
|
+
the folder layout on Windows and macOS.
|
|
45
|
+
|
|
39
46
|
## Installation
|
|
40
47
|
|
|
41
48
|
```bash
|
|
@@ -43,7 +50,8 @@ pip install xrdkit
|
|
|
43
50
|
```
|
|
44
51
|
|
|
45
52
|
Phase matching against the COD needs pymatgen, which comes with the `phases`
|
|
46
|
-
extra
|
|
53
|
+
extra. It is what Section 6 of [docs/USER_GUIDE.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/USER_GUIDE.md) uses
|
|
54
|
+
to identify the phases in a pattern:
|
|
47
55
|
|
|
48
56
|
```bash
|
|
49
57
|
pip install "xrdkit[phases]"
|
|
@@ -54,11 +62,46 @@ GSAS-II is optional and is needed only for the Rietveld driver in
|
|
|
54
62
|
point `XRDKIT_GSAS2_PYTHON` and `XRDKIT_GSAS2_HOME` at it, or leave it at
|
|
55
63
|
`~/gsas2main`. Every other module works without it.
|
|
56
64
|
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
`xrdkit COMMAND --help` describes each command in full.
|
|
68
|
+
|
|
69
|
+
| Command | What it does |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `xrdkit init` | start a project: write `xrdkit.toml` and make its folders |
|
|
72
|
+
| `xrdkit add-sample` | add a sample to `xrdkit.toml` |
|
|
73
|
+
| `xrdkit check SCAN` | report the data quality of a scan, with a verdict per workflow |
|
|
74
|
+
| `xrdkit plot SCAN` | plot one scan, list its peaks, and label them with hkl given a cell |
|
|
75
|
+
| `xrdkit stack SCAN ...` | plot several scans stacked one above the other |
|
|
76
|
+
| `xrdkit density` | theoretical density from a formula and a cell, and relative density |
|
|
77
|
+
| `xrdkit instrument SCAN --cif CIF --cell ...` | instrument parameter file from a standard scan, refined in GSAS-II, with `--name` to record it in `xrdkit.toml` |
|
|
78
|
+
| `xrdkit phases SCAN` | identify the phases against the COD: search by element set, fetch the CIFs, rank the candidates and say what is left over (needs the `phases` extra) |
|
|
79
|
+
| `xrdkit lattice SCAN` | refine the cell of a scan, with its volume and density |
|
|
80
|
+
| `xrdkit lebail SAMPLE` | Le Bail extraction of a sample in GSAS-II, for its cell, to `results/lebail/KEY` |
|
|
81
|
+
| `xrdkit rietveld SAMPLE` | Rietveld refinement of a sample in GSAS-II from its Le Bail result, `--from` and `--through` the modes fixed_atoms, coordinates and occupancies, to `results/rietveld/KEY` |
|
|
82
|
+
|
|
83
|
+
`lebail` and `rietveld` need GSAS-II (below) and a sample of the project file
|
|
84
|
+
whose instrument gives an `instprm`.
|
|
85
|
+
|
|
86
|
+
## Feedback and bug reports
|
|
87
|
+
|
|
88
|
+
Bug reports and feature requests go through GitHub Issues, at
|
|
89
|
+
<https://github.com/amirkhesro/xrdkit/issues>. Questions about method are
|
|
90
|
+
welcome in the same place. Anyone without a GitHub account can send the same
|
|
91
|
+
information by email to <am.khesro@gmail.com>.
|
|
92
|
+
|
|
93
|
+
A useful report gives the xrdkit version (`python -c "import xrdkit; print(xrdkit.__version__)"`),
|
|
94
|
+
the command you ran, the full error text, and a scan or a small sample file if
|
|
95
|
+
it can be shared.
|
|
96
|
+
|
|
97
|
+
Please do not attach measured data from unpublished work to a public issue:
|
|
98
|
+
describe the pattern instead, or use a public standard such as LaB6.
|
|
99
|
+
|
|
57
100
|
## Data
|
|
58
101
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
102
|
+
xrdkit ships no data. Your scans, your CIFs and your `xrdkit.toml` live in a
|
|
103
|
+
folder of your own, and the commands write their results and figures beside
|
|
104
|
+
them, under `results/` in that folder.
|
|
62
105
|
|
|
63
106
|
## GSAS-II refinement
|
|
64
107
|
|
|
@@ -102,8 +145,9 @@ atoms as it left them, the coordinates it refined and held by site, its
|
|
|
102
145
|
occupancy constraints, and a sanity check: negative Uiso, occupancies outside
|
|
103
146
|
0 to 1 (and site totals above 1), and sites moved more than `max_shift`
|
|
104
147
|
(fractional) from the reference. With `bonds`, `run_job` adds the final
|
|
105
|
-
model's cation to anion distances (`xrdkit.structure.bond_lengths`, to
|
|
106
|
-
up to 3 Å by default) to
|
|
148
|
+
model's cation to anion distances (`xrdkit.structure.bond_lengths`, to the
|
|
149
|
+
anions given, the library default O when none are, up to 3 Å by default) to
|
|
150
|
+
the result.
|
|
107
151
|
|
|
108
152
|
### What becomes of a stage that goes wrong
|
|
109
153
|
|
|
@@ -181,37 +225,44 @@ structure.
|
|
|
181
225
|
| --- | --- |
|
|
182
226
|
| `samples.<name>` | `id`, `scan`, `composition` (atoms per formula unit), `structure`, `start_cell` (`{file, model}` or `{a, c}`), `two_theta`, `background` (`{function, terms}`), `refine_microstrain`, `notes`; optionally `followed_reflections`, `trials` (`{runs = [{low, terms}], followed}`), `write_up` (text by mode and section), `unsettled` (the rule for each mode, over the top level one) |
|
|
183
227
|
| `unsettled` | at the top level, the default rule for a stage of each mode that has not settled, `"accept"` (the pipeline's default) or `"reject"`, by the caller's own mode names; each sample carries it merged with its own as its `unsettled` |
|
|
184
|
-
| `structures.<name>` | `cif`, `label`, `phase_name`, `space_group`, `formula_units`, `sites` (`{atoms = {label = element}, wyckoff, kind}`, kind A, B or O), `uiso_groups` (`{name, sites}`), `origin` (`{site, axis}`), `exchange` (`{elements, sites}`), `composition` (`{added = {element = host}}`); optionally `free_coordinates` (by Wyckoff position), `bond_limits` (`{kind = {min, max}}`) |
|
|
228
|
+
| `structures.<name>` | `cif`, `label`, `phase_name`, `space_group`, `formula_units`, `sites` (`{atoms = {label = element}, wyckoff, kind}`, kind a short label such as A, B or O), `uiso_groups` (`{name, sites}`), `origin` (`{site, axis}`), `exchange` (`{elements, sites}`), `composition` (`{added = {element = host}}`); optionally `free_coordinates` (by Wyckoff position), `bond_limits` (`{kind = {min, max}}`) |
|
|
185
229
|
|
|
186
230
|
From a structure table, `xrdkit.structure.site_setup` finds the sites among a
|
|
187
231
|
phase's atoms as the driver reports them, checking that each site's atoms
|
|
188
232
|
share one position, are of the elements given and have the multiplicity of
|
|
189
233
|
its Wyckoff position, and that no atom is left over. It returns the sites by
|
|
190
234
|
kind, the Uiso groups, the coordinates to refine on each site, the origin site
|
|
191
|
-
and the exchange, in the forms the stage keys above take
|
|
235
|
+
and the exchange, in the forms the stage keys above take, with the anions and
|
|
236
|
+
the bond limits of each kind: the library entry's when the structure names
|
|
237
|
+
one (`anions`, and `[entry.bond_limits]`, `[min, max]` by kind, read with
|
|
238
|
+
`xrdkit.library.bond_limits`), else O and 1.6 to 3.0 Å, under the structure's
|
|
239
|
+
own `bond_limits`.
|
|
192
240
|
`composition_edits` gives the atom edits that put a nominal composition on
|
|
193
241
|
the sites by the table's rule: each element the CIF holds is scaled by one
|
|
194
242
|
factor over its sites, which keeps its distribution, and each added element
|
|
195
243
|
goes on its host's sites in proportion to the host's occupancy.
|
|
196
244
|
`cell_contents` gives the atoms of each element per cell.
|
|
197
245
|
|
|
198
|
-
|
|
199
|
-
sample and structure setting from its `config/samples.toml` and runs Le Bail,
|
|
200
|
-
fixed atoms, coordinates and occupancies in turn, each from the saved result
|
|
201
|
-
of the one before:
|
|
246
|
+
## A first run
|
|
202
247
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
248
|
+
These five commands run in an empty folder of your own, with the package
|
|
249
|
+
installed and your own scan copied into it:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
xrdkit init --name demo
|
|
253
|
+
xrdkit add-sample data/raw/sample1.xrdml --structure ttb_p4bm
|
|
254
|
+
xrdkit check sample1
|
|
255
|
+
xrdkit lattice sample1
|
|
256
|
+
xrdkit lebail sample1
|
|
209
257
|
```
|
|
210
258
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
259
|
+
`init` writes `xrdkit.toml` and makes its folders. `add-sample` appends a
|
|
260
|
+
`[samples.sample1]` table naming the scan. `check` reports the data quality of
|
|
261
|
+
the sample's scan with a verdict per workflow. `lattice` refines its cell,
|
|
262
|
+
volume and density to `results/lattice/sample1`. `lebail` extracts the cell in
|
|
263
|
+
GSAS-II to `results/lebail/sample1`. Fill in the instrument and structure
|
|
264
|
+
tables that `init` leaves commented in `xrdkit.toml` before adding a sample;
|
|
265
|
+
`check` and `lattice` also take a scan file in place of a sample key.
|
|
215
266
|
|
|
216
267
|
## Status
|
|
217
268
|
|
|
@@ -221,9 +272,9 @@ notice.
|
|
|
221
272
|
## Citing
|
|
222
273
|
|
|
223
274
|
If xrdkit contributes to work you publish, please cite it. The metadata is in
|
|
224
|
-
[CITATION.cff](CITATION.cff), which GitHub renders as a ready-made citation
|
|
275
|
+
[CITATION.cff](https://github.com/amirkhesro/xrdkit/blob/main/CITATION.cff), which GitHub renders as a ready-made citation
|
|
225
276
|
under **Cite this repository**.
|
|
226
277
|
|
|
227
278
|
## License
|
|
228
279
|
|
|
229
|
-
MIT — see [LICENSE](LICENSE).
|
|
280
|
+
MIT — see [LICENSE](https://github.com/amirkhesro/xrdkit/blob/main/LICENSE).
|
|
@@ -6,6 +6,13 @@ A reusable X-ray diffraction analysis toolkit for electroceramics research.
|
|
|
6
6
|
analysing XRD patterns, so that the same analysis code can be reused across
|
|
7
7
|
projects instead of being copied between one-off scripts.
|
|
8
8
|
|
|
9
|
+
New here? [docs/USER_GUIDE.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/USER_GUIDE.md) says what data you need, in
|
|
10
|
+
what form, and how to get from a raw scan to each result.
|
|
11
|
+
|
|
12
|
+
Starting from a machine with nothing installed?
|
|
13
|
+
[docs/GETTING_STARTED.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/GETTING_STARTED.md) sets up Python, xrdkit and
|
|
14
|
+
the folder layout on Windows and macOS.
|
|
15
|
+
|
|
9
16
|
## Installation
|
|
10
17
|
|
|
11
18
|
```bash
|
|
@@ -13,7 +20,8 @@ pip install xrdkit
|
|
|
13
20
|
```
|
|
14
21
|
|
|
15
22
|
Phase matching against the COD needs pymatgen, which comes with the `phases`
|
|
16
|
-
extra
|
|
23
|
+
extra. It is what Section 6 of [docs/USER_GUIDE.md](https://github.com/amirkhesro/xrdkit/blob/main/docs/USER_GUIDE.md) uses
|
|
24
|
+
to identify the phases in a pattern:
|
|
17
25
|
|
|
18
26
|
```bash
|
|
19
27
|
pip install "xrdkit[phases]"
|
|
@@ -24,11 +32,46 @@ GSAS-II is optional and is needed only for the Rietveld driver in
|
|
|
24
32
|
point `XRDKIT_GSAS2_PYTHON` and `XRDKIT_GSAS2_HOME` at it, or leave it at
|
|
25
33
|
`~/gsas2main`. Every other module works without it.
|
|
26
34
|
|
|
35
|
+
## Commands
|
|
36
|
+
|
|
37
|
+
`xrdkit COMMAND --help` describes each command in full.
|
|
38
|
+
|
|
39
|
+
| Command | What it does |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `xrdkit init` | start a project: write `xrdkit.toml` and make its folders |
|
|
42
|
+
| `xrdkit add-sample` | add a sample to `xrdkit.toml` |
|
|
43
|
+
| `xrdkit check SCAN` | report the data quality of a scan, with a verdict per workflow |
|
|
44
|
+
| `xrdkit plot SCAN` | plot one scan, list its peaks, and label them with hkl given a cell |
|
|
45
|
+
| `xrdkit stack SCAN ...` | plot several scans stacked one above the other |
|
|
46
|
+
| `xrdkit density` | theoretical density from a formula and a cell, and relative density |
|
|
47
|
+
| `xrdkit instrument SCAN --cif CIF --cell ...` | instrument parameter file from a standard scan, refined in GSAS-II, with `--name` to record it in `xrdkit.toml` |
|
|
48
|
+
| `xrdkit phases SCAN` | identify the phases against the COD: search by element set, fetch the CIFs, rank the candidates and say what is left over (needs the `phases` extra) |
|
|
49
|
+
| `xrdkit lattice SCAN` | refine the cell of a scan, with its volume and density |
|
|
50
|
+
| `xrdkit lebail SAMPLE` | Le Bail extraction of a sample in GSAS-II, for its cell, to `results/lebail/KEY` |
|
|
51
|
+
| `xrdkit rietveld SAMPLE` | Rietveld refinement of a sample in GSAS-II from its Le Bail result, `--from` and `--through` the modes fixed_atoms, coordinates and occupancies, to `results/rietveld/KEY` |
|
|
52
|
+
|
|
53
|
+
`lebail` and `rietveld` need GSAS-II (below) and a sample of the project file
|
|
54
|
+
whose instrument gives an `instprm`.
|
|
55
|
+
|
|
56
|
+
## Feedback and bug reports
|
|
57
|
+
|
|
58
|
+
Bug reports and feature requests go through GitHub Issues, at
|
|
59
|
+
<https://github.com/amirkhesro/xrdkit/issues>. Questions about method are
|
|
60
|
+
welcome in the same place. Anyone without a GitHub account can send the same
|
|
61
|
+
information by email to <am.khesro@gmail.com>.
|
|
62
|
+
|
|
63
|
+
A useful report gives the xrdkit version (`python -c "import xrdkit; print(xrdkit.__version__)"`),
|
|
64
|
+
the command you ran, the full error text, and a scan or a small sample file if
|
|
65
|
+
it can be shared.
|
|
66
|
+
|
|
67
|
+
Please do not attach measured data from unpublished work to a public issue:
|
|
68
|
+
describe the pattern instead, or use a public standard such as LaB6.
|
|
69
|
+
|
|
27
70
|
## Data
|
|
28
71
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
72
|
+
xrdkit ships no data. Your scans, your CIFs and your `xrdkit.toml` live in a
|
|
73
|
+
folder of your own, and the commands write their results and figures beside
|
|
74
|
+
them, under `results/` in that folder.
|
|
32
75
|
|
|
33
76
|
## GSAS-II refinement
|
|
34
77
|
|
|
@@ -72,8 +115,9 @@ atoms as it left them, the coordinates it refined and held by site, its
|
|
|
72
115
|
occupancy constraints, and a sanity check: negative Uiso, occupancies outside
|
|
73
116
|
0 to 1 (and site totals above 1), and sites moved more than `max_shift`
|
|
74
117
|
(fractional) from the reference. With `bonds`, `run_job` adds the final
|
|
75
|
-
model's cation to anion distances (`xrdkit.structure.bond_lengths`, to
|
|
76
|
-
up to 3 Å by default) to
|
|
118
|
+
model's cation to anion distances (`xrdkit.structure.bond_lengths`, to the
|
|
119
|
+
anions given, the library default O when none are, up to 3 Å by default) to
|
|
120
|
+
the result.
|
|
77
121
|
|
|
78
122
|
### What becomes of a stage that goes wrong
|
|
79
123
|
|
|
@@ -151,37 +195,44 @@ structure.
|
|
|
151
195
|
| --- | --- |
|
|
152
196
|
| `samples.<name>` | `id`, `scan`, `composition` (atoms per formula unit), `structure`, `start_cell` (`{file, model}` or `{a, c}`), `two_theta`, `background` (`{function, terms}`), `refine_microstrain`, `notes`; optionally `followed_reflections`, `trials` (`{runs = [{low, terms}], followed}`), `write_up` (text by mode and section), `unsettled` (the rule for each mode, over the top level one) |
|
|
153
197
|
| `unsettled` | at the top level, the default rule for a stage of each mode that has not settled, `"accept"` (the pipeline's default) or `"reject"`, by the caller's own mode names; each sample carries it merged with its own as its `unsettled` |
|
|
154
|
-
| `structures.<name>` | `cif`, `label`, `phase_name`, `space_group`, `formula_units`, `sites` (`{atoms = {label = element}, wyckoff, kind}`, kind A, B or O), `uiso_groups` (`{name, sites}`), `origin` (`{site, axis}`), `exchange` (`{elements, sites}`), `composition` (`{added = {element = host}}`); optionally `free_coordinates` (by Wyckoff position), `bond_limits` (`{kind = {min, max}}`) |
|
|
198
|
+
| `structures.<name>` | `cif`, `label`, `phase_name`, `space_group`, `formula_units`, `sites` (`{atoms = {label = element}, wyckoff, kind}`, kind a short label such as A, B or O), `uiso_groups` (`{name, sites}`), `origin` (`{site, axis}`), `exchange` (`{elements, sites}`), `composition` (`{added = {element = host}}`); optionally `free_coordinates` (by Wyckoff position), `bond_limits` (`{kind = {min, max}}`) |
|
|
155
199
|
|
|
156
200
|
From a structure table, `xrdkit.structure.site_setup` finds the sites among a
|
|
157
201
|
phase's atoms as the driver reports them, checking that each site's atoms
|
|
158
202
|
share one position, are of the elements given and have the multiplicity of
|
|
159
203
|
its Wyckoff position, and that no atom is left over. It returns the sites by
|
|
160
204
|
kind, the Uiso groups, the coordinates to refine on each site, the origin site
|
|
161
|
-
and the exchange, in the forms the stage keys above take
|
|
205
|
+
and the exchange, in the forms the stage keys above take, with the anions and
|
|
206
|
+
the bond limits of each kind: the library entry's when the structure names
|
|
207
|
+
one (`anions`, and `[entry.bond_limits]`, `[min, max]` by kind, read with
|
|
208
|
+
`xrdkit.library.bond_limits`), else O and 1.6 to 3.0 Å, under the structure's
|
|
209
|
+
own `bond_limits`.
|
|
162
210
|
`composition_edits` gives the atom edits that put a nominal composition on
|
|
163
211
|
the sites by the table's rule: each element the CIF holds is scaled by one
|
|
164
212
|
factor over its sites, which keeps its distribution, and each added element
|
|
165
213
|
goes on its host's sites in proportion to the host's occupancy.
|
|
166
214
|
`cell_contents` gives the atoms of each element per cell.
|
|
167
215
|
|
|
168
|
-
|
|
169
|
-
sample and structure setting from its `config/samples.toml` and runs Le Bail,
|
|
170
|
-
fixed atoms, coordinates and occupancies in turn, each from the saved result
|
|
171
|
-
of the one before:
|
|
216
|
+
## A first run
|
|
172
217
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
218
|
+
These five commands run in an empty folder of your own, with the package
|
|
219
|
+
installed and your own scan copied into it:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
xrdkit init --name demo
|
|
223
|
+
xrdkit add-sample data/raw/sample1.xrdml --structure ttb_p4bm
|
|
224
|
+
xrdkit check sample1
|
|
225
|
+
xrdkit lattice sample1
|
|
226
|
+
xrdkit lebail sample1
|
|
179
227
|
```
|
|
180
228
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
229
|
+
`init` writes `xrdkit.toml` and makes its folders. `add-sample` appends a
|
|
230
|
+
`[samples.sample1]` table naming the scan. `check` reports the data quality of
|
|
231
|
+
the sample's scan with a verdict per workflow. `lattice` refines its cell,
|
|
232
|
+
volume and density to `results/lattice/sample1`. `lebail` extracts the cell in
|
|
233
|
+
GSAS-II to `results/lebail/sample1`. Fill in the instrument and structure
|
|
234
|
+
tables that `init` leaves commented in `xrdkit.toml` before adding a sample;
|
|
235
|
+
`check` and `lattice` also take a scan file in place of a sample key.
|
|
185
236
|
|
|
186
237
|
## Status
|
|
187
238
|
|
|
@@ -191,9 +242,9 @@ notice.
|
|
|
191
242
|
## Citing
|
|
192
243
|
|
|
193
244
|
If xrdkit contributes to work you publish, please cite it. The metadata is in
|
|
194
|
-
[CITATION.cff](CITATION.cff), which GitHub renders as a ready-made citation
|
|
245
|
+
[CITATION.cff](https://github.com/amirkhesro/xrdkit/blob/main/CITATION.cff), which GitHub renders as a ready-made citation
|
|
195
246
|
under **Cite this repository**.
|
|
196
247
|
|
|
197
248
|
## License
|
|
198
249
|
|
|
199
|
-
MIT — see [LICENSE](LICENSE).
|
|
250
|
+
MIT — see [LICENSE](https://github.com/amirkhesro/xrdkit/blob/main/LICENSE).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xrdkit"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Reusable X-ray diffraction analysis toolkit for electroceramics research"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -44,6 +44,9 @@ Repository = "https://github.com/amirkhesro/xrdkit"
|
|
|
44
44
|
Issues = "https://github.com/amirkhesro/xrdkit/issues"
|
|
45
45
|
Changelog = "https://github.com/amirkhesro/xrdkit/blob/main/CHANGELOG.md"
|
|
46
46
|
|
|
47
|
+
[project.scripts]
|
|
48
|
+
xrdkit = "xrdkit.cli:main"
|
|
49
|
+
|
|
47
50
|
[project.optional-dependencies]
|
|
48
51
|
phases = ["pymatgen>=2026.5.4"]
|
|
49
52
|
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "xrdkit"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "Reusable X-ray diffraction analysis toolkit for electroceramics research"
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.11"
|
|
7
|
-
license = "MIT"
|
|
8
|
-
license-files = ["LICENSE"]
|
|
9
|
-
authors = [
|
|
10
|
-
{ name = "Amir Khesro", email = "am.khesro@gmail.com" }
|
|
11
|
-
]
|
|
12
|
-
keywords = [
|
|
13
|
-
"x-ray diffraction",
|
|
14
|
-
"XRD",
|
|
15
|
-
"powder diffraction",
|
|
16
|
-
"Rietveld",
|
|
17
|
-
"Le Bail",
|
|
18
|
-
"GSAS-II",
|
|
19
|
-
"materials science",
|
|
20
|
-
"ceramics",
|
|
21
|
-
"crystallography",
|
|
22
|
-
]
|
|
23
|
-
classifiers = [
|
|
24
|
-
"Development Status :: 3 - Alpha",
|
|
25
|
-
"Intended Audience :: Science/Research",
|
|
26
|
-
"Operating System :: OS Independent",
|
|
27
|
-
"Programming Language :: Python :: 3.11",
|
|
28
|
-
"Programming Language :: Python :: 3.12",
|
|
29
|
-
"Programming Language :: Python :: 3.13",
|
|
30
|
-
"Topic :: Scientific/Engineering :: Physics",
|
|
31
|
-
"Topic :: Scientific/Engineering :: Chemistry",
|
|
32
|
-
"Typing :: Typed",
|
|
33
|
-
]
|
|
34
|
-
dependencies = [
|
|
35
|
-
"matplotlib>=3.11.1",
|
|
36
|
-
"numpy>=2.0.0",
|
|
37
|
-
"scipy>=1.13.0",
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
[project.urls]
|
|
41
|
-
Homepage = "https://github.com/amirkhesro/xrdkit"
|
|
42
|
-
Repository = "https://github.com/amirkhesro/xrdkit"
|
|
43
|
-
Issues = "https://github.com/amirkhesro/xrdkit/issues"
|
|
44
|
-
Changelog = "https://github.com/amirkhesro/xrdkit/blob/main/CHANGELOG.md"
|
|
45
|
-
|
|
46
|
-
[project.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
]
|
|
1
|
+
[project]
|
|
2
|
+
name = "xrdkit"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Reusable X-ray diffraction analysis toolkit for electroceramics research"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Amir Khesro", email = "am.khesro@gmail.com" }
|
|
11
|
+
]
|
|
12
|
+
keywords = [
|
|
13
|
+
"x-ray diffraction",
|
|
14
|
+
"XRD",
|
|
15
|
+
"powder diffraction",
|
|
16
|
+
"Rietveld",
|
|
17
|
+
"Le Bail",
|
|
18
|
+
"GSAS-II",
|
|
19
|
+
"materials science",
|
|
20
|
+
"ceramics",
|
|
21
|
+
"crystallography",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 3 - Alpha",
|
|
25
|
+
"Intended Audience :: Science/Research",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
32
|
+
"Typing :: Typed",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"matplotlib>=3.11.1",
|
|
36
|
+
"numpy>=2.0.0",
|
|
37
|
+
"scipy>=1.13.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://github.com/amirkhesro/xrdkit"
|
|
42
|
+
Repository = "https://github.com/amirkhesro/xrdkit"
|
|
43
|
+
Issues = "https://github.com/amirkhesro/xrdkit/issues"
|
|
44
|
+
Changelog = "https://github.com/amirkhesro/xrdkit/blob/main/CHANGELOG.md"
|
|
45
|
+
|
|
46
|
+
[project.scripts]
|
|
47
|
+
xrdkit = "xrdkit.cli:main"
|
|
48
|
+
|
|
49
|
+
[project.optional-dependencies]
|
|
50
|
+
phases = [
|
|
51
|
+
"pymatgen>=2026.5.4",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[build-system]
|
|
55
|
+
requires = ["uv_build>=0.12.0,<0.13.0"]
|
|
56
|
+
build-backend = "uv_build"
|
|
57
|
+
|
|
58
|
+
[dependency-groups]
|
|
59
|
+
dev = [
|
|
60
|
+
"pytest>=9.1.1",
|
|
61
|
+
]
|