reciprocalspaceship 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl
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.
Potentially problematic release.
This version of reciprocalspaceship might be problematic. Click here for more details.
- reciprocalspaceship/VERSION +1 -1
- reciprocalspaceship/__init__.py +1 -0
- reciprocalspaceship/algorithms/scale_merged_intensities.py +8 -7
- reciprocalspaceship/commandline/mtzdump.py +0 -1
- reciprocalspaceship/dataset.py +7 -1
- reciprocalspaceship/decorators.py +2 -2
- reciprocalspaceship/dtypes/__init__.py +16 -14
- reciprocalspaceship/dtypes/base.py +21 -266
- reciprocalspaceship/dtypes/floating.py +691 -0
- reciprocalspaceship/dtypes/integer.py +537 -0
- reciprocalspaceship/dtypes/internals.py +1365 -0
- reciprocalspaceship/io/__init__.py +7 -1
- reciprocalspaceship/io/crystfel.py +568 -234
- reciprocalspaceship/io/mtz.py +25 -0
- reciprocalspaceship/stats/completeness.py +0 -1
- reciprocalspaceship/utils/__init__.py +6 -1
- reciprocalspaceship/utils/asu.py +6 -0
- reciprocalspaceship/utils/cell.py +5 -0
- reciprocalspaceship/utils/stats.py +5 -7
- reciprocalspaceship/utils/structurefactors.py +5 -0
- reciprocalspaceship/utils/units.py +14 -4
- {reciprocalspaceship-1.0.0.dist-info → reciprocalspaceship-1.0.2.dist-info}/METADATA +26 -28
- reciprocalspaceship-1.0.2.dist-info/RECORD +58 -0
- {reciprocalspaceship-1.0.0.dist-info → reciprocalspaceship-1.0.2.dist-info}/WHEEL +1 -1
- {reciprocalspaceship-1.0.0.dist-info → reciprocalspaceship-1.0.2.dist-info}/entry_points.txt +0 -1
- tests/test_dataseries.py +1 -1
- tests/test_dataset_preserve_attributes.py +3 -9
- reciprocalspaceship/dtypes/anomalousdifference.py +0 -25
- reciprocalspaceship/dtypes/batch.py +0 -25
- reciprocalspaceship/dtypes/hklindex.py +0 -23
- reciprocalspaceship/dtypes/intensity.py +0 -47
- reciprocalspaceship/dtypes/m_isym.py +0 -25
- reciprocalspaceship/dtypes/mtzint.py +0 -23
- reciprocalspaceship/dtypes/mtzreal.py +0 -25
- reciprocalspaceship/dtypes/phase.py +0 -50
- reciprocalspaceship/dtypes/stddev.py +0 -69
- reciprocalspaceship/dtypes/structurefactor.py +0 -72
- reciprocalspaceship/dtypes/weight.py +0 -25
- reciprocalspaceship-1.0.0.dist-info/RECORD +0 -66
- {reciprocalspaceship-1.0.0.dist-info → reciprocalspaceship-1.0.2.dist-info}/LICENSE +0 -0
- {reciprocalspaceship-1.0.0.dist-info → reciprocalspaceship-1.0.2.dist-info}/top_level.txt +0 -0
reciprocalspaceship/io/mtz.py
CHANGED
|
@@ -227,3 +227,28 @@ def write_mtz(
|
|
|
227
227
|
)
|
|
228
228
|
mtz.write_to_file(mtzfile)
|
|
229
229
|
return
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def read_cif(ciffile):
|
|
233
|
+
"""
|
|
234
|
+
Populate the dataset object with reflection data from a CIF/ENT file.
|
|
235
|
+
|
|
236
|
+
Reflections from CIF/ENT files are merged.
|
|
237
|
+
A merged reflection DataSet will always be constructed.
|
|
238
|
+
|
|
239
|
+
The function reads a CIF/ENT file and returns a rs.DataSet.
|
|
240
|
+
|
|
241
|
+
Parameters
|
|
242
|
+
----------
|
|
243
|
+
ciffile : str or file
|
|
244
|
+
name of a CIF reflection file or a file object
|
|
245
|
+
|
|
246
|
+
Returns
|
|
247
|
+
-------
|
|
248
|
+
DataSet
|
|
249
|
+
"""
|
|
250
|
+
gemmi_cif = gemmi.cif.read(ciffile)
|
|
251
|
+
rblocks = gemmi.as_refln_blocks(gemmi_cif)
|
|
252
|
+
rblock = rblocks[0]
|
|
253
|
+
gemmi_cif = gemmi.CifToMtz().convert_block_to_mtz(rblock)
|
|
254
|
+
return from_gemmi(gemmi_cif)
|
|
@@ -160,7 +160,6 @@ def compute_completeness(
|
|
|
160
160
|
result.columns = pd.MultiIndex.from_product([result.columns, ["non-anomalous"]])
|
|
161
161
|
|
|
162
162
|
if anomalous:
|
|
163
|
-
|
|
164
163
|
# Compute completeness (all)
|
|
165
164
|
result2 = completeness_by_bin(asu, labels)
|
|
166
165
|
result2.columns = pd.MultiIndex.from_product([result2.columns, ["all"]])
|
|
@@ -52,4 +52,9 @@ from reciprocalspaceship.utils.symmetry import (
|
|
|
52
52
|
phase_shift,
|
|
53
53
|
polar_axes,
|
|
54
54
|
)
|
|
55
|
-
from reciprocalspaceship.utils.units import
|
|
55
|
+
from reciprocalspaceship.utils.units import (
|
|
56
|
+
Angstroms2eV,
|
|
57
|
+
angstroms2ev,
|
|
58
|
+
ev2angstroms,
|
|
59
|
+
eV2Angstroms,
|
|
60
|
+
)
|
reciprocalspaceship/utils/asu.py
CHANGED
|
@@ -40,6 +40,12 @@ def in_asu(H, spacegroup):
|
|
|
40
40
|
"""
|
|
41
41
|
Check to see if Miller indices are in the asymmetric unit of a space group.
|
|
42
42
|
|
|
43
|
+
Notes
|
|
44
|
+
-----
|
|
45
|
+
This function only returns True for the +ASU, and does not consider Miller
|
|
46
|
+
indices for Friedel pairs to be in the ASU. As such, anomalous data should
|
|
47
|
+
be provided in two-column anomalous format.
|
|
48
|
+
|
|
43
49
|
Parameters
|
|
44
50
|
----------
|
|
45
51
|
H : array
|
|
@@ -24,6 +24,11 @@ def compute_dHKL(H, cell):
|
|
|
24
24
|
# Compress the hkls so we don't do redudant computation
|
|
25
25
|
H = np.array(H, dtype=np.float32)
|
|
26
26
|
hkls, inverse = np.unique(H, axis=0, return_inverse=True)
|
|
27
|
+
|
|
28
|
+
# The behavior of np.unique changed with v2.0. This block maintains v1 compatibility
|
|
29
|
+
if inverse.shape[-1] == 1:
|
|
30
|
+
inverse = inverse.squeeze(-1)
|
|
31
|
+
|
|
27
32
|
F = np.array(cell.fractionalization_matrix.tolist()).astype(np.float64)
|
|
28
33
|
dhkls = np.reciprocal(np.linalg.norm((hkls @ F), 2, 1)).astype(np.float32)
|
|
29
34
|
return dhkls[inverse]
|
|
@@ -41,8 +41,6 @@ def compute_redundancy(
|
|
|
41
41
|
if dmin is None:
|
|
42
42
|
dmin = dhkl.min()
|
|
43
43
|
hobs = hobs[dhkl >= dmin]
|
|
44
|
-
decimals = 5.0 # Round after this many decimals
|
|
45
|
-
dmin = np.floor(dmin * 10**decimals) * 10**-decimals
|
|
46
44
|
hobs, isym = rs.utils.hkl_to_asu(hobs, spacegroup)
|
|
47
45
|
if anomalous:
|
|
48
46
|
fminus = isym % 2 == 0
|
|
@@ -107,15 +105,15 @@ def weighted_pearsonr(x, y, w):
|
|
|
107
105
|
"""
|
|
108
106
|
z = np.reciprocal(w.sum(-1))
|
|
109
107
|
|
|
110
|
-
mx = z * (w
|
|
111
|
-
my = z * (w
|
|
108
|
+
mx = z * np.einsum("...a,...a->...", w, x)
|
|
109
|
+
my = z * np.einsum("...a,...a->...", w, y)
|
|
112
110
|
|
|
113
111
|
dx = x - np.expand_dims(mx, axis=-1)
|
|
114
112
|
dy = y - np.expand_dims(my, axis=-1)
|
|
115
113
|
|
|
116
|
-
cxy = z * (w
|
|
117
|
-
cx = z * (w
|
|
118
|
-
cy = z * (w
|
|
114
|
+
cxy = z * np.einsum("...a,...a,...a->...", w, dx, dy)
|
|
115
|
+
cx = z * np.einsum("...a,...a,...a->...", w, dx, dx)
|
|
116
|
+
cy = z * np.einsum("...a,...a,...a->...", w, dy, dy)
|
|
119
117
|
|
|
120
118
|
r = cxy / np.sqrt(cx * cy)
|
|
121
119
|
return r
|
|
@@ -104,6 +104,11 @@ def is_centric(H, spacegroup):
|
|
|
104
104
|
"""
|
|
105
105
|
group_ops = spacegroup.operations()
|
|
106
106
|
hkl, inverse = np.unique(H, axis=0, return_inverse=True)
|
|
107
|
+
|
|
108
|
+
# The behavior of np.unique changed with v2.0. This block maintains v1 compatibility
|
|
109
|
+
if inverse.shape[-1] == 1:
|
|
110
|
+
inverse = inverse.squeeze(-1)
|
|
111
|
+
|
|
107
112
|
centric = group_ops.centric_flag_array(hkl)
|
|
108
113
|
return centric[inverse]
|
|
109
114
|
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import numpy as np
|
|
1
2
|
from scipy.constants import Planck, c, electron_volt
|
|
2
3
|
|
|
4
|
+
_conversion_factor = Planck * c / 1e-10 / electron_volt
|
|
3
5
|
|
|
4
|
-
def ev2angstroms(ev):
|
|
5
|
-
return Planck * c / ev / 1e-10 / electron_volt
|
|
6
6
|
|
|
7
|
+
def eV2Angstroms(ev):
|
|
8
|
+
out = np.empty_like(ev)
|
|
9
|
+
np.divide(_conversion_factor, ev, out=out)
|
|
10
|
+
return out
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
|
|
13
|
+
def Angstroms2eV(angstroms):
|
|
14
|
+
return eV2Angstroms(angstroms)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Add legacy aliases
|
|
18
|
+
ev2angstroms = eV2Angstroms
|
|
19
|
+
angstroms2ev = Angstroms2eV
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: reciprocalspaceship
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Tools for exploring reciprocal space
|
|
5
5
|
Home-page: https://rs-station.github.io/reciprocalspaceship/
|
|
6
6
|
Author: Kevin M. Dalton, Jack B. Greisman
|
|
@@ -9,7 +9,6 @@ License: MIT
|
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/rs-station/reciprocalspaceship/issues
|
|
10
10
|
Project-URL: Documentation, https://rs-station.github.io/reciprocalspaceship/
|
|
11
11
|
Project-URL: Source Code, https://github.com/rs-station/reciprocalspaceship
|
|
12
|
-
Platform: UNKNOWN
|
|
13
12
|
Classifier: Development Status :: 3 - Alpha
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
15
14
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -18,36 +17,37 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
|
18
17
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
19
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
19
|
Classifier: Programming Language :: Python
|
|
21
|
-
Requires-Python:
|
|
20
|
+
Requires-Python: >=3.9
|
|
22
21
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: gemmi
|
|
24
|
-
Requires-Dist: pandas
|
|
22
|
+
Requires-Dist: gemmi<=0.6.6,>=0.5.5
|
|
23
|
+
Requires-Dist: pandas<=2.2.2,>=2.2.2
|
|
25
24
|
Requires-Dist: numpy
|
|
26
25
|
Requires-Dist: scipy
|
|
27
26
|
Requires-Dist: ipython
|
|
28
27
|
Provides-Extra: dev
|
|
29
|
-
Requires-Dist: pytest
|
|
30
|
-
Requires-Dist: pytest-cov
|
|
31
|
-
Requires-Dist: pytest-xdist
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist: sphinx
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist:
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
Requires-Dist:
|
|
43
|
-
Requires-Dist:
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
|
31
|
+
Requires-Dist: ray; extra == "dev"
|
|
32
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
33
|
+
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
34
|
+
Requires-Dist: nbsphinx; extra == "dev"
|
|
35
|
+
Requires-Dist: sphinx-design; extra == "dev"
|
|
36
|
+
Requires-Dist: sphinxcontrib-autoprogram; extra == "dev"
|
|
37
|
+
Requires-Dist: autodocsumm; extra == "dev"
|
|
38
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
39
|
+
Requires-Dist: tqdm; extra == "dev"
|
|
40
|
+
Requires-Dist: matplotlib; extra == "dev"
|
|
41
|
+
Requires-Dist: seaborn; extra == "dev"
|
|
42
|
+
Requires-Dist: celluloid; extra == "dev"
|
|
43
|
+
Requires-Dist: scikit-image; extra == "dev"
|
|
44
44
|
Provides-Extra: examples
|
|
45
|
-
Requires-Dist: jupyter
|
|
46
|
-
Requires-Dist: tqdm
|
|
47
|
-
Requires-Dist: matplotlib
|
|
48
|
-
Requires-Dist: seaborn
|
|
49
|
-
Requires-Dist: celluloid
|
|
50
|
-
Requires-Dist: scikit-image
|
|
45
|
+
Requires-Dist: jupyter; extra == "examples"
|
|
46
|
+
Requires-Dist: tqdm; extra == "examples"
|
|
47
|
+
Requires-Dist: matplotlib; extra == "examples"
|
|
48
|
+
Requires-Dist: seaborn; extra == "examples"
|
|
49
|
+
Requires-Dist: celluloid; extra == "examples"
|
|
50
|
+
Requires-Dist: scikit-image; extra == "examples"
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
``reciprocalspaceship`` provides a ``pandas``-style interface for
|
|
@@ -68,5 +68,3 @@ Features of this library include:
|
|
|
68
68
|
use space groups, unit cell parameters, and crystallographic symmetry
|
|
69
69
|
operations.
|
|
70
70
|
- Support for reading and writing MTZ reflection files.
|
|
71
|
-
|
|
72
|
-
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
reciprocalspaceship/VERSION,sha256=n9KGQtOsoZHlx_wjg8_W-rsqrIdD8Cnau4mJrFhOMbw,6
|
|
2
|
+
reciprocalspaceship/__init__.py,sha256=69LJFzMjF05nmlwROByI53LTwM37sgrgYAp5k1n6wCs,1842
|
|
3
|
+
reciprocalspaceship/concat.py,sha256=v2eg8-RBiNLYHkkPDeaozh3HvGCaFbmlC15FaeNJMgY,1695
|
|
4
|
+
reciprocalspaceship/dataseries.py,sha256=ibU1bHMd8zORFxRtDswtvLh_n-miAyBqO0ghLmY29Js,6188
|
|
5
|
+
reciprocalspaceship/dataset.py,sha256=YUcpvaTifmlQeR4qewHkzo-RSz6DOq_xLalFRXa_O94,57008
|
|
6
|
+
reciprocalspaceship/decorators.py,sha256=U2gfm29infWHVGzQnfnpRsjxOihDD6Iah7oHd4uD8jk,5612
|
|
7
|
+
reciprocalspaceship/algorithms/__init__.py,sha256=r5IYCGswTHXpSs9Q7c6PfEz8_P8d1fEei2SyTkp5aYY,258
|
|
8
|
+
reciprocalspaceship/algorithms/intensity.py,sha256=iDHaqqrMAe0v-aTVT5jf54JwkNQLSQ7HhezPw6qZndg,2657
|
|
9
|
+
reciprocalspaceship/algorithms/merge.py,sha256=iwPrDfjtliBwLqEzHbcIfoTkvS_0s2_CszS5IfrEUXI,2154
|
|
10
|
+
reciprocalspaceship/algorithms/scale_merged_intensities.py,sha256=hNKKISCCDvchail1PZ_0r6sq1Rbgoraqaz1aDCayTYQ,11269
|
|
11
|
+
reciprocalspaceship/commandline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
reciprocalspaceship/commandline/mtzdump.py,sha256=JBg_W-CWQ6rbOOVmtK7TsErFXhCBR5pmC5RRSCapEZg,2939
|
|
13
|
+
reciprocalspaceship/dtypes/__init__.py,sha256=cO0M2F6pO_0jtqx-MlkbzqxLSmK1Ibmon5p_ksWmcbk,1038
|
|
14
|
+
reciprocalspaceship/dtypes/base.py,sha256=1X56U4jKt_wjVkW930C9gP2Di0RpCMDZsDKNTxYle5I,1052
|
|
15
|
+
reciprocalspaceship/dtypes/floating.py,sha256=jOQ25GZEE4QromaJA3_oeu0Tkjq1iT4dHCke_7W6TYo,19675
|
|
16
|
+
reciprocalspaceship/dtypes/inference.py,sha256=jLgF8VfKtITGRzQbfeyZzEoJ1fQlbHXB_gXIJ9-AQxk,3029
|
|
17
|
+
reciprocalspaceship/dtypes/integer.py,sha256=fPaLTWfMsJ-wuEPkm9oEJez3NDqzB4XKVHFRFEb585A,15816
|
|
18
|
+
reciprocalspaceship/dtypes/internals.py,sha256=BkkqUDEvTTlebLXjcu7EiQV295-qR7GdMJXqrOKbbU0,47596
|
|
19
|
+
reciprocalspaceship/dtypes/summarize.py,sha256=1w6-N3odFcI3ZEQP5qgrog6ucbGjO71vSgabmjklkbc,1114
|
|
20
|
+
reciprocalspaceship/io/__init__.py,sha256=ZMQ_rGfLmfzijbErnjEFphJuZokPvZyyVRk65DC0gLA,400
|
|
21
|
+
reciprocalspaceship/io/ccp4map.py,sha256=yztiHPTdyR9FiCKRg-eVmL-_MyZTKThPI9uuHuuPF_0,1029
|
|
22
|
+
reciprocalspaceship/io/crystfel.py,sha256=lKpGzM2OLNXBjy6njwahtk1IsI3MH0edaGSmaQ6NbGk,21662
|
|
23
|
+
reciprocalspaceship/io/csv.py,sha256=A2ZnqAnFwFUQskF7_3EsQAPCcrJ5KEgjhZls6MDViv8,1194
|
|
24
|
+
reciprocalspaceship/io/mtz.py,sha256=8XqFVoSJz47vjK-kEzwSu7NxwQnEyyHd0pgt1CaBavM,8074
|
|
25
|
+
reciprocalspaceship/io/pickle.py,sha256=clnSTK8T2O_d7midS_E54WHmXEHrL10d386gWx7ztsM,818
|
|
26
|
+
reciprocalspaceship/io/precognition.py,sha256=DWRE2erXPVpm9-y5DjIWUHfmv9jZcsqoa47ienp1Sao,3641
|
|
27
|
+
reciprocalspaceship/stats/__init__.py,sha256=jdAWbpD_CKAn0W0sO_MKSnTu3bZSoLAXgb1_Y6jDMzk,197
|
|
28
|
+
reciprocalspaceship/stats/completeness.py,sha256=1QM-Ac_V58nTLJoewbOK5CL69qsb0C0sc8L0c59WorQ,6702
|
|
29
|
+
reciprocalspaceship/utils/__init__.py,sha256=bKJwbkxXa-TX2etIQgIESKkv9kdag1rHL77JLhI-2B8,1714
|
|
30
|
+
reciprocalspaceship/utils/asu.py,sha256=WwxvIq-_QEF2UvyELuNudVo53daty9wiN-vaOYAUbKI,8680
|
|
31
|
+
reciprocalspaceship/utils/binning.py,sha256=CHf5z8EsHSg34ZgC-yM_8Gd3D2BB8cqTtHAf7vwfgLo,2786
|
|
32
|
+
reciprocalspaceship/utils/cell.py,sha256=aNIaugA3F8CRs9n8Ck0Rjc8YI7qHZcW3lJPE7yvj0dk,2053
|
|
33
|
+
reciprocalspaceship/utils/grid.py,sha256=xB7sw1xrhgzFojrVHbC_uVBT3NMTBsvKsCqaRrVfvTQ,1893
|
|
34
|
+
reciprocalspaceship/utils/math.py,sha256=m6Iq9u0fjiieftzjQPAEHTN2htBIOwLhBCJdrcIN5Ao,1019
|
|
35
|
+
reciprocalspaceship/utils/phases.py,sha256=zyiE99bq-TV_4aI6ZhBi4MLAvKwE3Sx1dFqppJL5rkE,2438
|
|
36
|
+
reciprocalspaceship/utils/rfree.py,sha256=qFgepLOfgdU-cvZIMu8WfzlFExTc4jILff2ro7iu8FQ,3411
|
|
37
|
+
reciprocalspaceship/utils/stats.py,sha256=p_1R3bTVVAVlDWh-hzcurlT8GOHkJA8ovFuQjD0w5AY,3681
|
|
38
|
+
reciprocalspaceship/utils/structurefactors.py,sha256=ZW6CVPn_04dxay0DDnA0-byUrZnGraQ0kItqN1m5F3k,3686
|
|
39
|
+
reciprocalspaceship/utils/symmetry.py,sha256=xsYmEUo0PTH57-kctJdUq_-k14ci5LUGeG5LwzmjjPU,2963
|
|
40
|
+
reciprocalspaceship/utils/units.py,sha256=ng-2hzZBERYo9bnQDPr-HLr7xPah-JzOthfrpHH816Y,388
|
|
41
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
tests/conftest.py,sha256=bQZClqzu3lonsI01OdP5X38asMd7F76fAGzlWWYPXAI,3930
|
|
43
|
+
tests/test_dataseries.py,sha256=go-q5tT8lLq3tlRVnmrwUytK7PlaoKs3CBPjWryGfGg,3309
|
|
44
|
+
tests/test_dataset.py,sha256=dMFW6-pCs1rjIYEqbfstVqFRiYwKfz5rHlncVL9grQg,22231
|
|
45
|
+
tests/test_dataset_anomalous.py,sha256=LQb1inSS_oDbVYEIyyx_GBFAkXGlEQYZ-ZhpwMeyMmQ,6963
|
|
46
|
+
tests/test_dataset_binning.py,sha256=NgD_vy-TUh3vQrUVgysVBSZu75xN66LR6hRu2_qAUTs,3564
|
|
47
|
+
tests/test_dataset_grid.py,sha256=S2EswVAbcg08WT9TjLtQ3YF1_zJmEKcucHrN3Lw5EM8,4086
|
|
48
|
+
tests/test_dataset_index.py,sha256=-6sMVgAKkkcYRc7UfLuVEH3p7D83o1S7e7c6MbrOrZo,2842
|
|
49
|
+
tests/test_dataset_preserve_attributes.py,sha256=gwQQJGsiBZld2KKmLrcMkuc9zesR3FD7GVnPDNRScto,5314
|
|
50
|
+
tests/test_dataset_symops.py,sha256=PV86tLu1qDACuk-YqjYQszk8Ctb0-h_NsQRnuCDFnOU,10864
|
|
51
|
+
tests/test_decorators.py,sha256=ExR7mCU0iIqhHo4ho6ywPrZIEaGcsElaI4jtH9o5afE,5331
|
|
52
|
+
tests/test_summarize_mtz_dtypes.py,sha256=JE0ctXMWii1AV-cmKogF6hjb8NCHrgvxNZ0ZRCHh-Ho,696
|
|
53
|
+
reciprocalspaceship-1.0.2.dist-info/LICENSE,sha256=E22aZlYy5qJsJCJ94EkO_Vt3COio5UcLg59dZLPam7I,1093
|
|
54
|
+
reciprocalspaceship-1.0.2.dist-info/METADATA,sha256=36KZFStMfUhplc6K1h7vpF-FVJ-TrExqWI3XXdW5oTE,3056
|
|
55
|
+
reciprocalspaceship-1.0.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
56
|
+
reciprocalspaceship-1.0.2.dist-info/entry_points.txt,sha256=Bqjl2J8UrG4UAHHhPbdH5r-xYaOdLCEdyRH6zJ9joDw,76
|
|
57
|
+
reciprocalspaceship-1.0.2.dist-info/top_level.txt,sha256=tOo679MsLFS7iwiYZDwnKTuTpJLYVFBk6g9xnnB_s-w,26
|
|
58
|
+
reciprocalspaceship-1.0.2.dist-info/RECORD,,
|
tests/test_dataseries.py
CHANGED
|
@@ -39,7 +39,7 @@ def test_constructor_expanddim(data, series_name, frame_name, dtype):
|
|
|
39
39
|
|
|
40
40
|
assert isinstance(d, rs.DataSet)
|
|
41
41
|
assert len(d.columns) == 1
|
|
42
|
-
assert isinstance(d.dtypes[0], type(ds.dtype))
|
|
42
|
+
assert isinstance(d.dtypes.iloc[0], type(ds.dtype))
|
|
43
43
|
|
|
44
44
|
# Test hierarchy for column naming
|
|
45
45
|
if frame_name:
|
|
@@ -106,13 +106,9 @@ def test_join_list_datasets(data_fmodel, check_isomorphous, sg):
|
|
|
106
106
|
other = [o.rename(lambda x: x + str(i), axis=1) for i, o in enumerate(other)]
|
|
107
107
|
if check_isomorphous and sg.number == 19:
|
|
108
108
|
with pytest.raises(ValueError):
|
|
109
|
-
result = data_fmodel.join(
|
|
110
|
-
other, lsuffix="x", rsuffix="y", check_isomorphous=check_isomorphous
|
|
111
|
-
)
|
|
109
|
+
result = data_fmodel.join(other, check_isomorphous=check_isomorphous)
|
|
112
110
|
else:
|
|
113
|
-
result = data_fmodel.join(
|
|
114
|
-
other, lsuffix="x", rsuffix="y", check_isomorphous=check_isomorphous
|
|
115
|
-
)
|
|
111
|
+
result = data_fmodel.join(other, check_isomorphous=check_isomorphous)
|
|
116
112
|
assert isinstance(result, rs.DataSet)
|
|
117
113
|
assert len(result) == len(data_fmodel)
|
|
118
114
|
assert len(result.columns) == len(data_fmodel.columns) * 4
|
|
@@ -131,9 +127,7 @@ def test_join_list_dataseries(data_fmodel, check_isomorphous, sg):
|
|
|
131
127
|
other.spacegroup = sg
|
|
132
128
|
other = [other[c] for c in other.columns]
|
|
133
129
|
other = [c.rename(c.name + str(i)) for i, c in enumerate(other)]
|
|
134
|
-
result = data_fmodel.join(
|
|
135
|
-
other, lsuffix="x", rsuffix="y", check_isomorphous=check_isomorphous
|
|
136
|
-
)
|
|
130
|
+
result = data_fmodel.join(other, check_isomorphous=check_isomorphous)
|
|
137
131
|
assert isinstance(result, rs.DataSet)
|
|
138
132
|
assert len(result) == len(data_fmodel)
|
|
139
133
|
assert len(result.columns) == len(data_fmodel.columns) * 2
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZFloat32Dtype, MTZFloatArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class AnomalousDifferenceDtype(MTZFloat32Dtype):
|
|
8
|
-
"""Dtype for anomalous difference data in reflection tables"""
|
|
9
|
-
|
|
10
|
-
name = "AnomalousDifference"
|
|
11
|
-
mtztype = "D"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return AnomalousDifferenceArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class AnomalousDifferenceArray(MTZFloatArray):
|
|
22
|
-
"""ExtensionArray for supporting AnomalousDifferenceDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = AnomalousDifferenceDtype()
|
|
25
|
-
pass
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZInt32Dtype, MTZIntegerArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class BatchDtype(MTZInt32Dtype):
|
|
8
|
-
"""Dtype for representing batch numbers"""
|
|
9
|
-
|
|
10
|
-
name = "Batch"
|
|
11
|
-
mtztype = "B"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return BatchArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class BatchArray(MTZIntegerArray):
|
|
22
|
-
"""ExtensionArray for supporting BatchDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = BatchDtype()
|
|
25
|
-
pass
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZInt32Dtype, MTZIntegerArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class HKLIndexDtype(MTZInt32Dtype):
|
|
8
|
-
"""Custom MTZ Dtype for Miller indices"""
|
|
9
|
-
|
|
10
|
-
name = "HKL"
|
|
11
|
-
mtztype = "H"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return HKLIndexArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class HKLIndexArray(MTZIntegerArray):
|
|
22
|
-
_dtype = HKLIndexDtype()
|
|
23
|
-
pass
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZFloat32Dtype, MTZFloatArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class IntensityDtype(MTZFloat32Dtype):
|
|
8
|
-
"""Dtype for Intensity data in reflection tables"""
|
|
9
|
-
|
|
10
|
-
name = "Intensity"
|
|
11
|
-
mtztype = "J"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return IntensityArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class IntensityArray(MTZFloatArray):
|
|
22
|
-
"""ExtensionArray for supporting IntensityDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = IntensityDtype()
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@register_extension_dtype
|
|
29
|
-
class FriedelIntensityDtype(MTZFloat32Dtype):
|
|
30
|
-
"""Dtype for I(+) or I(-) data in reflection tables"""
|
|
31
|
-
|
|
32
|
-
name = "FriedelIntensity"
|
|
33
|
-
mtztype = "K"
|
|
34
|
-
|
|
35
|
-
def is_friedel_dtype(self):
|
|
36
|
-
return True
|
|
37
|
-
|
|
38
|
-
@classmethod
|
|
39
|
-
def construct_array_type(cls):
|
|
40
|
-
return FriedelIntensityArray
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class FriedelIntensityArray(MTZFloatArray):
|
|
44
|
-
"""ExtensionArray for supporting FriedelIntensityDtype"""
|
|
45
|
-
|
|
46
|
-
_dtype = FriedelIntensityDtype()
|
|
47
|
-
pass
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZInt32Dtype, MTZIntegerArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class M_IsymDtype(MTZInt32Dtype):
|
|
8
|
-
"""Dtype for representing M/ISYM values"""
|
|
9
|
-
|
|
10
|
-
name = "M/ISYM"
|
|
11
|
-
mtztype = "Y"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return M_IsymArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class M_IsymArray(MTZIntegerArray):
|
|
22
|
-
"""ExtensionArray for supporting M_IsymDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = M_IsymDtype()
|
|
25
|
-
pass
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZInt32Dtype, MTZIntegerArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class MTZIntDtype(MTZInt32Dtype):
|
|
8
|
-
"""Dtype for generic integer data"""
|
|
9
|
-
|
|
10
|
-
name = "MTZInt"
|
|
11
|
-
mtztype = "I"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return MTZIntArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class MTZIntArray(MTZIntegerArray):
|
|
22
|
-
_dtype = MTZIntDtype()
|
|
23
|
-
pass
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZFloat32Dtype, MTZFloatArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class MTZRealDtype(MTZFloat32Dtype):
|
|
8
|
-
"""Dtype for generic MTZ real data"""
|
|
9
|
-
|
|
10
|
-
name = "MTZReal"
|
|
11
|
-
mtztype = "R"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return MTZRealArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class MTZRealArray(MTZFloatArray):
|
|
22
|
-
"""ExtensionArray for supporting MtzRealDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = MTZRealDtype()
|
|
25
|
-
pass
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZFloat32Dtype, MTZFloatArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class PhaseDtype(MTZFloat32Dtype):
|
|
8
|
-
"""Dtype for representing phase data in reflection tables"""
|
|
9
|
-
|
|
10
|
-
name = "Phase"
|
|
11
|
-
mtztype = "P"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return PhaseArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class PhaseArray(MTZFloatArray):
|
|
22
|
-
"""ExtensionArray for supporting PhaseDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = PhaseDtype()
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@register_extension_dtype
|
|
29
|
-
class HendricksonLattmanDtype(MTZFloat32Dtype):
|
|
30
|
-
"""
|
|
31
|
-
Dtype for representing phase probability coefficients
|
|
32
|
-
(Hendrickson-Lattman) in reflection tables
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
name = "HendricksonLattman"
|
|
36
|
-
mtztype = "A"
|
|
37
|
-
|
|
38
|
-
def is_friedel_dtype(self):
|
|
39
|
-
return False
|
|
40
|
-
|
|
41
|
-
@classmethod
|
|
42
|
-
def construct_array_type(cls):
|
|
43
|
-
return HendricksonLattmanArray
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class HendricksonLattmanArray(MTZFloatArray):
|
|
47
|
-
"""ExtensionArray for supporting HendricksonLattmanDtype"""
|
|
48
|
-
|
|
49
|
-
_dtype = HendricksonLattmanDtype()
|
|
50
|
-
pass
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from pandas.core.dtypes.dtypes import register_extension_dtype
|
|
2
|
-
|
|
3
|
-
from reciprocalspaceship.dtypes.base import MTZFloat32Dtype, MTZFloatArray
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@register_extension_dtype
|
|
7
|
-
class StandardDeviationDtype(MTZFloat32Dtype):
|
|
8
|
-
"""Dtype for standard deviation of observables: J, F, D or other"""
|
|
9
|
-
|
|
10
|
-
name = "Stddev"
|
|
11
|
-
mtztype = "Q"
|
|
12
|
-
|
|
13
|
-
def is_friedel_dtype(self):
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def construct_array_type(cls):
|
|
18
|
-
return StandardDeviationArray
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class StandardDeviationArray(MTZFloatArray):
|
|
22
|
-
"""ExtensionArray for supporting StandardDeviationDtype"""
|
|
23
|
-
|
|
24
|
-
_dtype = StandardDeviationDtype()
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@register_extension_dtype
|
|
29
|
-
class StandardDeviationFriedelSFDtype(MTZFloat32Dtype):
|
|
30
|
-
"""Dtype for standard deviation of F(+) or F(-)"""
|
|
31
|
-
|
|
32
|
-
name = "StddevFriedelSF"
|
|
33
|
-
mtztype = "L"
|
|
34
|
-
|
|
35
|
-
def is_friedel_dtype(self):
|
|
36
|
-
return True
|
|
37
|
-
|
|
38
|
-
@classmethod
|
|
39
|
-
def construct_array_type(cls):
|
|
40
|
-
return StandardDeviationFriedelSFArray
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class StandardDeviationFriedelSFArray(MTZFloatArray):
|
|
44
|
-
"""ExtensionArray for supporting StandardDeviationFriedelSFDtype"""
|
|
45
|
-
|
|
46
|
-
_dtype = StandardDeviationFriedelSFDtype()
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@register_extension_dtype
|
|
51
|
-
class StandardDeviationFriedelIDtype(MTZFloat32Dtype):
|
|
52
|
-
"""Dtype for standard deviation of I(+) or I(-)"""
|
|
53
|
-
|
|
54
|
-
name = "StddevFriedelI"
|
|
55
|
-
mtztype = "M"
|
|
56
|
-
|
|
57
|
-
def is_friedel_dtype(self):
|
|
58
|
-
return True
|
|
59
|
-
|
|
60
|
-
@classmethod
|
|
61
|
-
def construct_array_type(cls):
|
|
62
|
-
return StandardDeviationFriedelIArray
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class StandardDeviationFriedelIArray(MTZFloatArray):
|
|
66
|
-
"""ExtensionArray for supporting StandardDeviationFriedelIDtype"""
|
|
67
|
-
|
|
68
|
-
_dtype = StandardDeviationFriedelIDtype()
|
|
69
|
-
pass
|