ChessAnalysisPipeline 0.0.4__py3-none-any.whl → 0.0.6__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 ChessAnalysisPipeline might be problematic. Click here for more details.
- CHAP/TaskManager.py +214 -0
- CHAP/common/models/__init__.py +0 -2
- CHAP/common/models/integration.py +392 -249
- CHAP/common/models/map.py +350 -198
- CHAP/common/processor.py +229 -191
- CHAP/common/reader.py +52 -39
- CHAP/common/utils/__init__.py +0 -37
- CHAP/common/utils/fit.py +1197 -991
- CHAP/common/utils/general.py +629 -372
- CHAP/common/utils/material.py +158 -121
- CHAP/common/utils/scanparsers.py +735 -339
- CHAP/common/writer.py +31 -25
- CHAP/edd/models.py +65 -51
- CHAP/edd/processor.py +136 -113
- CHAP/edd/reader.py +1 -1
- CHAP/edd/writer.py +1 -1
- CHAP/inference/processor.py +35 -28
- CHAP/inference/reader.py +1 -1
- CHAP/inference/writer.py +1 -1
- CHAP/pipeline.py +14 -28
- CHAP/processor.py +44 -75
- CHAP/reader.py +49 -40
- CHAP/runner.py +73 -32
- CHAP/saxswaxs/processor.py +1 -1
- CHAP/saxswaxs/reader.py +1 -1
- CHAP/saxswaxs/writer.py +1 -1
- CHAP/server.py +130 -0
- CHAP/sin2psi/processor.py +1 -1
- CHAP/sin2psi/reader.py +1 -1
- CHAP/sin2psi/writer.py +1 -1
- CHAP/tomo/__init__.py +1 -4
- CHAP/tomo/models.py +53 -31
- CHAP/tomo/processor.py +1326 -902
- CHAP/tomo/reader.py +4 -2
- CHAP/tomo/writer.py +4 -2
- CHAP/writer.py +47 -41
- {ChessAnalysisPipeline-0.0.4.dist-info → ChessAnalysisPipeline-0.0.6.dist-info}/METADATA +1 -1
- ChessAnalysisPipeline-0.0.6.dist-info/RECORD +52 -0
- ChessAnalysisPipeline-0.0.4.dist-info/RECORD +0 -50
- {ChessAnalysisPipeline-0.0.4.dist-info → ChessAnalysisPipeline-0.0.6.dist-info}/LICENSE +0 -0
- {ChessAnalysisPipeline-0.0.4.dist-info → ChessAnalysisPipeline-0.0.6.dist-info}/WHEEL +0 -0
- {ChessAnalysisPipeline-0.0.4.dist-info → ChessAnalysisPipeline-0.0.6.dist-info}/entry_points.txt +0 -0
- {ChessAnalysisPipeline-0.0.4.dist-info → ChessAnalysisPipeline-0.0.6.dist-info}/top_level.txt +0 -0
CHAP/tomo/models.py
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"""Tomography Pydantic model classes"""
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Third party imports
|
|
4
|
+
from typing import (
|
|
5
|
+
Literal,
|
|
6
|
+
Optional,
|
|
7
|
+
)
|
|
4
8
|
from pydantic import (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
BaseModel,
|
|
10
|
+
StrictBool,
|
|
11
|
+
conint,
|
|
12
|
+
conlist,
|
|
13
|
+
confloat,
|
|
14
|
+
constr,
|
|
11
15
|
)
|
|
12
|
-
from typing import Literal, Optional
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
class Detector(BaseModel):
|
|
16
19
|
"""
|
|
17
20
|
Detector class to represent the detector used in the experiment.
|
|
18
|
-
|
|
21
|
+
|
|
19
22
|
:ivar prefix: Prefix of the detector in the SPEC file.
|
|
20
23
|
:type prefix: str
|
|
21
24
|
:ivar rows: Number of pixel rows on the detector
|
|
@@ -25,21 +28,27 @@ class Detector(BaseModel):
|
|
|
25
28
|
:ivar pixel_size: Pixel size of the detector in mm
|
|
26
29
|
:type pixel_size: int or list[int]
|
|
27
30
|
:ivar lens_magnification: Lens magnification for the detector
|
|
28
|
-
:type lens_magnification: float, optional
|
|
31
|
+
:type lens_magnification: float, optional [1.0]
|
|
29
32
|
"""
|
|
30
33
|
prefix: constr(strip_whitespace=True, min_length=1)
|
|
31
34
|
rows: conint(gt=0)
|
|
32
35
|
columns: conint(gt=0)
|
|
33
|
-
pixel_size: conlist(
|
|
36
|
+
pixel_size: conlist(
|
|
37
|
+
item_type=confloat(gt=0, allow_inf_nan=False),
|
|
38
|
+
min_items=1, max_items=2)
|
|
34
39
|
lens_magnification: confloat(gt=0, allow_inf_nan=False) = 1.0
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
class TomoSetupConfig(BaseModel):
|
|
38
43
|
"""
|
|
39
|
-
Class representing the configuration for the tomography
|
|
44
|
+
Class representing the configuration for the tomography
|
|
45
|
+
reconstruction setup.
|
|
40
46
|
|
|
41
47
|
:ivar detectors: Detector used in the tomography experiment
|
|
42
48
|
:type detectors: Detector
|
|
49
|
+
:ivar include_raw_data: Flag to designate whether raw data will be
|
|
50
|
+
included (True) or not (False)
|
|
51
|
+
:type include_raw_data: bool, optional [False]
|
|
43
52
|
"""
|
|
44
53
|
detector: Detector.construct()
|
|
45
54
|
include_raw_data: Optional[StrictBool] = False
|
|
@@ -47,9 +56,11 @@ class TomoSetupConfig(BaseModel):
|
|
|
47
56
|
|
|
48
57
|
class TomoReduceConfig(BaseModel):
|
|
49
58
|
"""
|
|
50
|
-
Class representing the configuration for tomography image
|
|
59
|
+
Class representing the configuration for tomography image
|
|
60
|
+
reductions.
|
|
51
61
|
|
|
52
|
-
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
62
|
+
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
63
|
+
to "reduce_data"
|
|
53
64
|
:type tool_type: str, optional
|
|
54
65
|
:ivar detectors: Detector used in the tomography experiment
|
|
55
66
|
:type detectors: Detector
|
|
@@ -58,16 +69,19 @@ class TomoReduceConfig(BaseModel):
|
|
|
58
69
|
"""
|
|
59
70
|
tool_type: Literal['reduce_data'] = 'reduce_data'
|
|
60
71
|
detector: Detector = Detector.construct()
|
|
61
|
-
img_x_bounds: Optional[
|
|
72
|
+
img_x_bounds: Optional[
|
|
73
|
+
conlist(item_type=conint(ge=0), min_items=2, max_items=2)]
|
|
62
74
|
|
|
63
75
|
|
|
64
76
|
class TomoFindCenterConfig(BaseModel):
|
|
65
77
|
"""
|
|
66
78
|
Class representing the configuration for tomography find center axis.
|
|
67
79
|
|
|
68
|
-
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
80
|
+
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
81
|
+
to "find_center"
|
|
69
82
|
:type tool_type: str, optional
|
|
70
|
-
:ivar center_stack_index: Stack index of tomography set to find
|
|
83
|
+
:ivar center_stack_index: Stack index of tomography set to find
|
|
84
|
+
center axis (offset 1)
|
|
71
85
|
:type center_stack_index: int, optional
|
|
72
86
|
:ivar lower_row: Lower row index for center finding
|
|
73
87
|
:type lower_row: int, optional
|
|
@@ -88,9 +102,11 @@ class TomoFindCenterConfig(BaseModel):
|
|
|
88
102
|
|
|
89
103
|
class TomoReconstructConfig(BaseModel):
|
|
90
104
|
"""
|
|
91
|
-
Class representing the configuration for tomography image
|
|
105
|
+
Class representing the configuration for tomography image
|
|
106
|
+
reconstruction.
|
|
92
107
|
|
|
93
|
-
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
108
|
+
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
109
|
+
to "reconstruct_data"
|
|
94
110
|
:type tool_type: str, optional
|
|
95
111
|
:ivar x_bounds: Reconstructed image bounds in the x-direction
|
|
96
112
|
:type x_bounds: list[int], optional
|
|
@@ -100,26 +116,32 @@ class TomoReconstructConfig(BaseModel):
|
|
|
100
116
|
:type z_bounds: list[int], optional
|
|
101
117
|
"""
|
|
102
118
|
tool_type: Literal['reconstruct_data'] = 'reconstruct_data'
|
|
103
|
-
x_bounds: Optional[
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
x_bounds: Optional[
|
|
120
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|
|
121
|
+
y_bounds: Optional[
|
|
122
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|
|
123
|
+
z_bounds: Optional[
|
|
124
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|
|
106
125
|
|
|
107
126
|
|
|
108
127
|
class TomoCombineConfig(BaseModel):
|
|
109
128
|
"""
|
|
110
129
|
Class representing the configuration for combined tomography stacks.
|
|
111
130
|
|
|
112
|
-
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
131
|
+
:ivar tool_type: Type of tomography reconstruction tool; always set
|
|
132
|
+
to "combine_data"
|
|
113
133
|
:type tool_type: str, optional
|
|
114
|
-
:ivar x_bounds:
|
|
134
|
+
:ivar x_bounds: Combined image bounds in the x-direction
|
|
115
135
|
:type x_bounds: list[int], optional
|
|
116
|
-
:ivar y_bounds:
|
|
136
|
+
:ivar y_bounds: Combined image bounds in the y-direction
|
|
117
137
|
:type y_bounds: list[int], optional
|
|
118
|
-
:ivar z_bounds:
|
|
138
|
+
:ivar z_bounds: Combined image bounds in the z-direction
|
|
119
139
|
:type z_bounds: list[int], optional
|
|
120
140
|
"""
|
|
121
141
|
tool_type: Literal['combine_data'] = 'combine_data'
|
|
122
|
-
x_bounds: Optional[
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
x_bounds: Optional[
|
|
143
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|
|
144
|
+
y_bounds: Optional[
|
|
145
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|
|
146
|
+
z_bounds: Optional[
|
|
147
|
+
conlist(item_type=conint(ge=-1), min_items=2, max_items=2)]
|