reciprocalspaceship 1.0.0__tar.gz → 1.0.2__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.
Potentially problematic release.
This version of reciprocalspaceship might be problematic. Click here for more details.
- {reciprocalspaceship-1.0.0/reciprocalspaceship.egg-info → reciprocalspaceship-1.0.2}/PKG-INFO +2 -5
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/README.md +2 -2
- reciprocalspaceship-1.0.2/reciprocalspaceship/VERSION +1 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/__init__.py +1 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/algorithms/scale_merged_intensities.py +8 -7
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/commandline/mtzdump.py +0 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dataset.py +7 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/decorators.py +2 -2
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dtypes/__init__.py +16 -14
- reciprocalspaceship-1.0.2/reciprocalspaceship/dtypes/base.py +37 -0
- reciprocalspaceship-1.0.2/reciprocalspaceship/dtypes/floating.py +691 -0
- reciprocalspaceship-1.0.2/reciprocalspaceship/dtypes/integer.py +537 -0
- reciprocalspaceship-1.0.2/reciprocalspaceship/dtypes/internals.py +1365 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/__init__.py +7 -1
- reciprocalspaceship-1.0.2/reciprocalspaceship/io/crystfel.py +604 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/mtz.py +25 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/stats/completeness.py +0 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/__init__.py +6 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/asu.py +6 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/cell.py +5 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/stats.py +5 -7
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/structurefactors.py +5 -0
- reciprocalspaceship-1.0.2/reciprocalspaceship/utils/units.py +19 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2/reciprocalspaceship.egg-info}/PKG-INFO +2 -5
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship.egg-info/SOURCES.txt +3 -11
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship.egg-info/entry_points.txt +0 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship.egg-info/requires.txt +4 -3
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/setup.py +5 -5
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataseries.py +1 -1
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_preserve_attributes.py +3 -9
- reciprocalspaceship-1.0.0/reciprocalspaceship/VERSION +0 -1
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/anomalousdifference.py +0 -25
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/base.py +0 -282
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/batch.py +0 -25
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/hklindex.py +0 -23
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/intensity.py +0 -47
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/m_isym.py +0 -25
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/mtzint.py +0 -23
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/mtzreal.py +0 -25
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/phase.py +0 -50
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/stddev.py +0 -69
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/structurefactor.py +0 -72
- reciprocalspaceship-1.0.0/reciprocalspaceship/dtypes/weight.py +0 -25
- reciprocalspaceship-1.0.0/reciprocalspaceship/io/crystfel.py +0 -270
- reciprocalspaceship-1.0.0/reciprocalspaceship/utils/units.py +0 -9
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/LICENSE +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/MANIFEST.in +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/algorithms/__init__.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/algorithms/intensity.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/algorithms/merge.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/commandline/__init__.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/concat.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dataseries.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dtypes/inference.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dtypes/summarize.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/ccp4map.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/csv.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/pickle.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/io/precognition.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/stats/__init__.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/binning.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/grid.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/math.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/phases.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/rfree.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/utils/symmetry.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship.egg-info/dependency_links.txt +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship.egg-info/top_level.txt +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/setup.cfg +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/__init__.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/conftest.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_anomalous.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_binning.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_grid.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_index.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_dataset_symops.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_decorators.py +0 -0
- {reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/tests/test_summarize_mtz_dtypes.py +0 -0
{reciprocalspaceship-1.0.0/reciprocalspaceship.egg-info → reciprocalspaceship-1.0.2}/PKG-INFO
RENAMED
|
@@ -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,7 +17,7 @@ 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
|
Provides-Extra: dev
|
|
23
22
|
Provides-Extra: examples
|
|
24
23
|
License-File: LICENSE
|
|
@@ -42,5 +41,3 @@ Features of this library include:
|
|
|
42
41
|
use space groups, unit cell parameters, and crystallographic symmetry
|
|
43
42
|
operations.
|
|
44
43
|
- Support for reading and writing MTZ reflection files.
|
|
45
|
-
|
|
46
|
-
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# 1
|
|
1
|
+
# 1 / 🚀 = reciprocalspaceship
|
|
2
2
|

|
|
3
3
|
[](https://rs-station.github.io/reciprocalspaceship)
|
|
4
4
|
[](https://pypi.org/project/reciprocalspaceship/)
|
|
5
5
|
[](https://anaconda.org/conda-forge/reciprocalspaceship)
|
|
6
6
|
[](https://codecov.io/gh/rs-station/reciprocalspaceship)
|
|
7
|
-
[](https://github.com/rs-station/reciprocalspaceship/blob/main/LICENSE)
|
|
8
8
|
[](https://mybinder.org/v2/gh/rs-station/reciprocalspaceship/main?filepath=docs%2Fexamples)
|
|
9
9
|
[](https://doi.org/10.1107/S160057672100755X)
|
|
10
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.2
|
|
@@ -37,6 +37,7 @@ from reciprocalspaceship.dtypes import StructureFactorAmplitudeDtype # F
|
|
|
37
37
|
from reciprocalspaceship.dtypes import WeightDtype # W
|
|
38
38
|
from reciprocalspaceship.dtypes import summarize_mtz_dtypes
|
|
39
39
|
from reciprocalspaceship.io import (
|
|
40
|
+
read_cif,
|
|
40
41
|
read_crystfel,
|
|
41
42
|
read_csv,
|
|
42
43
|
read_mtz,
|
|
@@ -185,6 +185,7 @@ def scale_merged_intensities(
|
|
|
185
185
|
mean_intensity_method="isotropic",
|
|
186
186
|
bins=100,
|
|
187
187
|
bw=2.0,
|
|
188
|
+
minimum_sigma=-np.inf,
|
|
188
189
|
):
|
|
189
190
|
"""
|
|
190
191
|
Scales merged intensities using Bayesian statistics in order to
|
|
@@ -240,6 +241,9 @@ def scale_merged_intensities(
|
|
|
240
241
|
parameter controls the distance that each reflection impacts in
|
|
241
242
|
reciprocal space. Only affects output if mean_intensity_method is
|
|
242
243
|
\"anisotropic\".
|
|
244
|
+
minimum_sigma : float
|
|
245
|
+
Minimum value imposed on Sigma (default: -np.inf, that is: no minimum).
|
|
246
|
+
|
|
243
247
|
|
|
244
248
|
Returns
|
|
245
249
|
-------
|
|
@@ -281,14 +285,11 @@ def scale_merged_intensities(
|
|
|
281
285
|
I, Sig = ds[intensity_key].to_numpy(), ds[sigma_key].to_numpy()
|
|
282
286
|
if mean_intensity_method == "isotropic":
|
|
283
287
|
dHKL = ds["dHKL"].to_numpy(dtype=np.float64)
|
|
284
|
-
Sigma = (
|
|
285
|
-
mean_intensity_by_resolution(I / multiplicity, dHKL, bins) * multiplicity
|
|
286
|
-
)
|
|
288
|
+
Sigma = mean_intensity_by_resolution(I / multiplicity, dHKL, bins)
|
|
287
289
|
elif mean_intensity_method == "anisotropic":
|
|
288
|
-
Sigma = (
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
)
|
|
290
|
+
Sigma = mean_intensity_by_miller_index(I / multiplicity, ds.get_hkls(), bw)
|
|
291
|
+
Sigma = np.clip(Sigma, a_min=minimum_sigma, a_max=np.inf)
|
|
292
|
+
Sigma = Sigma * multiplicity
|
|
292
293
|
|
|
293
294
|
# Initialize outputs
|
|
294
295
|
ds[outputI] = 0.0
|
|
@@ -12,7 +12,8 @@ from reciprocalspaceship.decorators import (
|
|
|
12
12
|
range_indexed,
|
|
13
13
|
spacegroupify,
|
|
14
14
|
)
|
|
15
|
-
from reciprocalspaceship.dtypes.base import MTZDtype
|
|
15
|
+
from reciprocalspaceship.dtypes.base import MTZDtype
|
|
16
|
+
from reciprocalspaceship.dtypes.integer import MTZInt32Dtype
|
|
16
17
|
from reciprocalspaceship.utils import (
|
|
17
18
|
apply_to_hkl,
|
|
18
19
|
assign_with_binedges,
|
|
@@ -1233,6 +1234,11 @@ class DataSet(pd.DataFrame):
|
|
|
1233
1234
|
# Compute new HKLs and phase shifts
|
|
1234
1235
|
hkls = dataset.get_hkls()
|
|
1235
1236
|
compressed_hkls, inverse = np.unique(hkls, axis=0, return_inverse=True)
|
|
1237
|
+
|
|
1238
|
+
# The behavior of np.unique changed with v2.0. This block maintains v1 compatibility
|
|
1239
|
+
if inverse.shape[-1] == 1:
|
|
1240
|
+
inverse = inverse.squeeze(-1)
|
|
1241
|
+
|
|
1236
1242
|
asu_hkls, isym, phi_coeff, phi_shift = hkl_to_asu(
|
|
1237
1243
|
compressed_hkls, dataset.spacegroup, return_phase_shifts=True
|
|
1238
1244
|
)
|
|
@@ -100,7 +100,7 @@ def spacegroupify(func=None, *sg_args):
|
|
|
100
100
|
for arg in sg_args:
|
|
101
101
|
if arg in bargs.arguments:
|
|
102
102
|
bargs.arguments[arg] = _convert_spacegroup(bargs.arguments[arg])
|
|
103
|
-
return f(**bargs.
|
|
103
|
+
return f(*bargs.args, **bargs.kwargs)
|
|
104
104
|
|
|
105
105
|
return wrapped
|
|
106
106
|
|
|
@@ -155,7 +155,7 @@ def cellify(func=None, *cell_args):
|
|
|
155
155
|
for arg in cell_args:
|
|
156
156
|
if arg in bargs.arguments:
|
|
157
157
|
bargs.arguments[arg] = _convert_unitcell(bargs.arguments[arg])
|
|
158
|
-
return f(**bargs.
|
|
158
|
+
return f(*bargs.args, **bargs.kwargs)
|
|
159
159
|
|
|
160
160
|
return wrapped
|
|
161
161
|
|
{reciprocalspaceship-1.0.0 → reciprocalspaceship-1.0.2}/reciprocalspaceship/dtypes/__init__.py
RENAMED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
from reciprocalspaceship.dtypes.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
from reciprocalspaceship.dtypes.floating import (
|
|
2
|
+
AnomalousDifferenceDtype,
|
|
3
|
+
FriedelIntensityDtype,
|
|
4
|
+
FriedelStructureFactorAmplitudeDtype,
|
|
5
|
+
HendricksonLattmanDtype,
|
|
6
|
+
IntensityDtype,
|
|
7
|
+
MTZRealDtype,
|
|
8
|
+
NormalizedStructureFactorAmplitudeDtype,
|
|
9
|
+
PhaseDtype,
|
|
10
10
|
StandardDeviationDtype,
|
|
11
11
|
StandardDeviationFriedelIDtype,
|
|
12
12
|
StandardDeviationFriedelSFDtype,
|
|
13
|
-
)
|
|
14
|
-
from reciprocalspaceship.dtypes.structurefactor import (
|
|
15
|
-
FriedelStructureFactorAmplitudeDtype,
|
|
16
|
-
NormalizedStructureFactorAmplitudeDtype,
|
|
17
13
|
StructureFactorAmplitudeDtype,
|
|
14
|
+
WeightDtype,
|
|
15
|
+
)
|
|
16
|
+
from reciprocalspaceship.dtypes.integer import (
|
|
17
|
+
BatchDtype,
|
|
18
|
+
HKLIndexDtype,
|
|
19
|
+
M_IsymDtype,
|
|
20
|
+
MTZIntDtype,
|
|
18
21
|
)
|
|
19
|
-
from reciprocalspaceship.dtypes.weight import WeightDtype
|
|
20
22
|
|
|
21
23
|
# ExtensionDtypes are appended to the end of the Dtype registry.
|
|
22
24
|
# Since we want to overwrite a few of the one-letter strings, we need
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from reciprocalspaceship.dtypes.internals import NumericArray, NumericDtype
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MTZDtype(NumericDtype):
|
|
5
|
+
"""Base ExtensionDtype for implementing persistent MTZ data types"""
|
|
6
|
+
|
|
7
|
+
def __repr__(self) -> str:
|
|
8
|
+
return f"{self.name}"
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def _is_numeric(self) -> bool:
|
|
12
|
+
return True
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def construct_array_type(cls):
|
|
16
|
+
"""
|
|
17
|
+
Return the array type associated with this dtype.
|
|
18
|
+
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
type
|
|
22
|
+
"""
|
|
23
|
+
return NotImplementedError
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def construct_from_string(cls, string):
|
|
27
|
+
if not isinstance(string, str):
|
|
28
|
+
raise TypeError(
|
|
29
|
+
f"'construct_from_string' expects a string, got {type(string)}"
|
|
30
|
+
)
|
|
31
|
+
elif string != cls.name and string != cls.mtztype:
|
|
32
|
+
raise TypeError(f"Cannot construct a '{cls.__name__}' from '{string}'")
|
|
33
|
+
return cls()
|
|
34
|
+
|
|
35
|
+
def is_friedel_dtype(self):
|
|
36
|
+
"""Returns whether MTZ dtype represents a Friedel dtype"""
|
|
37
|
+
raise NotImplementedError
|