picometer 0.3.0__tar.gz → 0.3.1__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.
- {picometer-0.3.0 → picometer-0.3.1}/PKG-INFO +1 -1
- {picometer-0.3.0 → picometer-0.3.1}/picometer/atom.py +27 -24
- picometer-0.3.1/picometer/utility.py +13 -0
- {picometer-0.3.0 → picometer-0.3.1}/pyproject.toml +1 -1
- picometer-0.3.0/picometer/utility.py +0 -5
- {picometer-0.3.0 → picometer-0.3.1}/LICENSE +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/README.md +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/__init__.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/__main__.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/instructions.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/logging.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/models.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/process.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/settings.py +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/settings.yaml +0 -0
- {picometer-0.3.0 → picometer-0.3.1}/picometer/shapes.py +0 -0
|
@@ -9,7 +9,7 @@ import pandas as pd
|
|
|
9
9
|
|
|
10
10
|
from picometer.shapes import (are_synparallel, degrees_between, Line,
|
|
11
11
|
Plane, Shape, Vector3)
|
|
12
|
-
from picometer.utility import ustr2float
|
|
12
|
+
from picometer.utility import ustr2float, ustr2floats
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
try:
|
|
@@ -83,29 +83,32 @@ class AtomSet(Shape):
|
|
|
83
83
|
al=ustr2float(cb['_cell_angle_alpha']),
|
|
84
84
|
be=ustr2float(cb['_cell_angle_beta']),
|
|
85
85
|
ga=ustr2float(cb['_cell_angle_gamma']))
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
atoms =
|
|
86
|
+
|
|
87
|
+
atoms = pd.DataFrame()
|
|
88
|
+
|
|
89
|
+
atom_labels = cb.get('_atom_site_label', [])
|
|
90
|
+
atom_xs = ustr2floats(cb.get('_atom_site_fract_x', []))
|
|
91
|
+
atom_ys = ustr2floats(cb.get('_atom_site_fract_y', []))
|
|
92
|
+
atom_zs = ustr2floats(cb.get('_atom_site_fract_z', []))
|
|
93
|
+
atom_u_isos = ustr2floats(cb.get('_atom_site_U_iso_or_equiv', []))
|
|
94
|
+
for label, x, y, z in zip(atom_labels, atom_xs, atom_ys, atom_zs):
|
|
95
|
+
atoms.loc[label, ['fract_x', 'fract_y', 'fract_z']] = [x, y, z]
|
|
96
|
+
for label, u_iso in zip(atom_labels, atom_u_isos):
|
|
97
|
+
atoms.loc[label, 'Uiso'] = u_iso
|
|
98
|
+
|
|
99
|
+
atom_labels = cb.get('_atom_site_aniso_label', [])
|
|
100
|
+
atom_u11s = ustr2floats(cb.get('_atom_site_aniso_U_11', []))
|
|
101
|
+
atom_u22s = ustr2floats(cb.get('_atom_site_aniso_U_22', []))
|
|
102
|
+
atom_u33s = ustr2floats(cb.get('_atom_site_aniso_U_33', []))
|
|
103
|
+
atom_u12s = ustr2floats(cb.get('_atom_site_aniso_U_12', []))
|
|
104
|
+
atom_u13s = ustr2floats(cb.get('_atom_site_aniso_U_13', []))
|
|
105
|
+
atom_u23s = ustr2floats(cb.get('_atom_site_aniso_U_23', []))
|
|
106
|
+
atom_us = zip(atom_u11s, atom_u22s, atom_u33s, atom_u12s, atom_u13s, atom_u23s)
|
|
107
|
+
for label, us in zip(atom_labels, atom_us):
|
|
108
|
+
atoms.loc[label, ['U11', 'U22', 'U33', 'U12', 'U13', 'U23']] = list(us)
|
|
109
|
+
|
|
110
|
+
for col in atoms.columns:
|
|
111
|
+
atoms[col] = pd.to_numeric(atoms[col], errors='coerce')
|
|
109
112
|
return AtomSet(bf, atoms)
|
|
110
113
|
|
|
111
114
|
@property
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from typing import Iterable, List
|
|
2
|
+
|
|
3
|
+
import uncertainties as uc
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def ustr2float(s: str) -> float:
|
|
7
|
+
"""Convert a string "1.23(4)" to float `1.23`, stripping uncertainty."""
|
|
8
|
+
return uc.ufloat_fromstr(s).nominal_value
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def ustr2floats(s: Iterable[str]) -> List[float]:
|
|
12
|
+
"""Convenience function to convert an iterable of u-strings to floats."""
|
|
13
|
+
return [ustr2float(s) for s in s]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|