ChessAnalysisPipeline 0.0.15__tar.gz → 0.0.16__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 ChessAnalysisPipeline might be problematic. Click here for more details.
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/__init__.py +1 -1
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/__init__.py +4 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/models/integration.py +29 -26
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/models/map.py +186 -255
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/processor.py +956 -160
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/reader.py +93 -27
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/writer.py +15 -5
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/__init__.py +2 -2
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/models.py +299 -449
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/processor.py +639 -448
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/reader.py +232 -15
- chessanalysispipeline-0.0.16/CHAP/giwaxs/__init__.py +8 -0
- chessanalysispipeline-0.0.16/CHAP/giwaxs/models.py +100 -0
- chessanalysispipeline-0.0.16/CHAP/giwaxs/processor.py +520 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/pipeline.py +47 -9
- chessanalysispipeline-0.0.16/CHAP/runner.py +311 -0
- chessanalysispipeline-0.0.16/CHAP/sin2psi/reader.py +5 -0
- chessanalysispipeline-0.0.16/CHAP/sin2psi/writer.py +5 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/tomo/models.py +25 -25
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/tomo/processor.py +51 -79
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/general.py +18 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/models.py +76 -49
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/parfile.py +10 -2
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/PKG-INFO +1 -1
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/SOURCES.txt +5 -1
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/PKG-INFO +1 -1
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/setup.py +3 -1
- chessanalysispipeline-0.0.15/CHAP/runner.py +0 -222
- chessanalysispipeline-0.0.15/CHAP/utils/scanparsers.py +0 -1544
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/TaskManager.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/models/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/utils.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/edd/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/foxden/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/foxden/processor.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/foxden/writer.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/inference → chessanalysispipeline-0.0.16/CHAP/giwaxs}/reader.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/inference → chessanalysispipeline-0.0.16/CHAP/giwaxs}/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/inference/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/inference/processor.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/saxswaxs → chessanalysispipeline-0.0.16/CHAP/inference}/reader.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/saxswaxs → chessanalysispipeline-0.0.16/CHAP/inference}/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/processor.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/reader.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/saxswaxs/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/saxswaxs/processor.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/sin2psi → chessanalysispipeline-0.0.16/CHAP/saxswaxs}/reader.py +0 -0
- {chessanalysispipeline-0.0.15/CHAP/sin2psi → chessanalysispipeline-0.0.16/CHAP/saxswaxs}/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/server.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/sin2psi/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/sin2psi/processor.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/tomo/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/tomo/reader.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/tomo/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/fit.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/utils/material.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/writer.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/dependency_links.txt +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/entry_points.txt +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/requires.txt +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/ChessAnalysisPipeline.egg-info/top_level.txt +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/LICENSE +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/MLaaS/__init__.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/MLaaS/ktrain.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/MLaaS/mnist_img.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/MLaaS/tfaas_client.py +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/README.md +0 -0
- {chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/setup.cfg +0 -0
|
@@ -27,6 +27,9 @@ from CHAP.common.processor import (
|
|
|
27
27
|
IntegrationProcessor,
|
|
28
28
|
IntegrateMapProcessor,
|
|
29
29
|
MapProcessor,
|
|
30
|
+
MPICollectProcessor,
|
|
31
|
+
MPIMapProcessor,
|
|
32
|
+
MPISpawnMapProcessor,
|
|
30
33
|
NexusToNumpyProcessor,
|
|
31
34
|
NexusToXarrayProcessor,
|
|
32
35
|
PrintProcessor,
|
|
@@ -38,6 +41,7 @@ from CHAP.common.processor import (
|
|
|
38
41
|
NXdataToDataPointsProcessor,
|
|
39
42
|
XarrayToNexusProcessor,
|
|
40
43
|
XarrayToNumpyProcessor,
|
|
44
|
+
SumProcessor,
|
|
41
45
|
)
|
|
42
46
|
from CHAP.common.writer import (
|
|
43
47
|
ExtractArchiveWriter,
|
{chessanalysispipeline-0.0.15 → chessanalysispipeline-0.0.16}/CHAP/common/models/integration.py
RENAMED
|
@@ -6,13 +6,15 @@ from typing import Literal, Optional
|
|
|
6
6
|
|
|
7
7
|
# Third party modules
|
|
8
8
|
import numpy as np
|
|
9
|
-
from pydantic import (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
from pydantic import (
|
|
10
|
+
BaseModel,
|
|
11
|
+
FilePath,
|
|
12
|
+
confloat,
|
|
13
|
+
conint,
|
|
14
|
+
conlist,
|
|
15
|
+
constr,
|
|
16
|
+
field_validator,
|
|
17
|
+
)
|
|
16
18
|
from pyFAI import load as pyfai_load
|
|
17
19
|
from pyFAI.multi_geometry import MultiGeometry
|
|
18
20
|
from pyFAI.units import AZIMUTHAL_UNITS, RADIAL_UNITS
|
|
@@ -31,9 +33,10 @@ class Detector(BaseModel):
|
|
|
31
33
|
"""
|
|
32
34
|
prefix: constr(strip_whitespace=True, min_length=1)
|
|
33
35
|
poni_file: FilePath
|
|
34
|
-
mask_file: Optional[FilePath]
|
|
36
|
+
mask_file: Optional[FilePath] = None
|
|
35
37
|
|
|
36
|
-
@
|
|
38
|
+
@field_validator('poni_file')
|
|
39
|
+
@classmethod
|
|
37
40
|
def validate_poni_file(cls, poni_file):
|
|
38
41
|
"""Validate the poni file by checking if it's a valid PONI
|
|
39
42
|
file.
|
|
@@ -51,7 +54,8 @@ class Detector(BaseModel):
|
|
|
51
54
|
raise ValueError(f'{poni_file} is not a valid PONI file') from exc
|
|
52
55
|
return poni_file
|
|
53
56
|
|
|
54
|
-
@
|
|
57
|
+
@field_validator('mask_file')
|
|
58
|
+
@classmethod
|
|
55
59
|
def validate_mask_file(cls, mask_file, values):
|
|
56
60
|
"""Validate the mask file. If a mask file is provided, it
|
|
57
61
|
checks if it's a valid TIFF file.
|
|
@@ -176,7 +180,7 @@ class IntegrationConfig(BaseModel):
|
|
|
176
180
|
tool_type: Literal['integration'] = 'integration'
|
|
177
181
|
title: constr(strip_whitespace=True, min_length=1)
|
|
178
182
|
integration_type: Literal['azimuthal', 'radial', 'cake']
|
|
179
|
-
detectors: conlist(item_type=Detector,
|
|
183
|
+
detectors: conlist(item_type=Detector, min_length=1)
|
|
180
184
|
radial_units: str = 'q_A^-1'
|
|
181
185
|
radial_min: confloat(ge=0)
|
|
182
186
|
radial_max: confloat(gt=0)
|
|
@@ -185,10 +189,11 @@ class IntegrationConfig(BaseModel):
|
|
|
185
189
|
azimuthal_min: confloat(ge=-180) = -180
|
|
186
190
|
azimuthal_max: confloat(le=360) = 180
|
|
187
191
|
azimuthal_npt: conint(gt=0) = 3600
|
|
188
|
-
error_model: Optional[Literal['poisson', 'azimuthal']]
|
|
189
|
-
sequence_index: Optional[conint(gt=0)]
|
|
192
|
+
error_model: Optional[Literal['poisson', 'azimuthal']] = None
|
|
193
|
+
sequence_index: Optional[conint(gt=0)] = None
|
|
190
194
|
|
|
191
|
-
@
|
|
195
|
+
@field_validator('radial_units')
|
|
196
|
+
@classmethod
|
|
192
197
|
def validate_radial_units(cls, radial_units):
|
|
193
198
|
"""Validate the radial units for the integration.
|
|
194
199
|
|
|
@@ -206,7 +211,8 @@ class IntegrationConfig(BaseModel):
|
|
|
206
211
|
f'Invalid radial units: {radial_units}. '
|
|
207
212
|
f'Must be one of {", ".join(RADIAL_UNITS.keys())}')
|
|
208
213
|
|
|
209
|
-
@
|
|
214
|
+
@field_validator('azimuthal_units')
|
|
215
|
+
@classmethod
|
|
210
216
|
def validate_azimuthal_units(cls, azimuthal_units):
|
|
211
217
|
"""Validate that `azimuthal_units` is one of the keys in the
|
|
212
218
|
`pyFAI.units.AZIMUTHAL_UNITS` dictionary.
|
|
@@ -235,23 +241,22 @@ class IntegrationConfig(BaseModel):
|
|
|
235
241
|
:return: The callable that performs the validation.
|
|
236
242
|
:rtype: callable
|
|
237
243
|
"""
|
|
238
|
-
def _validate_range_max(cls, range_max,
|
|
244
|
+
def _validate_range_max(cls, range_max, info):
|
|
239
245
|
"""Check if the maximum value of the integration range is
|
|
240
246
|
greater than its minimum value.
|
|
241
247
|
|
|
242
248
|
:param range_max: The maximum value of the integration
|
|
243
249
|
range.
|
|
244
250
|
:type range_max: float
|
|
245
|
-
:param
|
|
246
|
-
|
|
247
|
-
:type values: dict
|
|
251
|
+
:param info: Pydantic validator info object.
|
|
252
|
+
:type info: pydantic_core._pydantic_core.ValidationInfo
|
|
248
253
|
:raises ValueError: If the maximum value of the
|
|
249
254
|
integration range is not greater than its minimum
|
|
250
255
|
value.
|
|
251
256
|
:return: The validated maximum range value
|
|
252
257
|
:rtype: float
|
|
253
258
|
"""
|
|
254
|
-
range_min =
|
|
259
|
+
range_min = info.data.get(f'{range_name}_min')
|
|
255
260
|
if range_min < range_max:
|
|
256
261
|
return range_max
|
|
257
262
|
raise ValueError(
|
|
@@ -260,12 +265,10 @@ class IntegrationConfig(BaseModel):
|
|
|
260
265
|
f'({range_name}_min={range_min}).')
|
|
261
266
|
return _validate_range_max
|
|
262
267
|
|
|
263
|
-
_validate_radial_max =
|
|
264
|
-
'radial_max'
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
'azimuthal_max',
|
|
268
|
-
allow_reuse=True)(validate_range_max('azimuthal'))
|
|
268
|
+
_validate_radial_max = field_validator(
|
|
269
|
+
'radial_max')(validate_range_max('radial'))
|
|
270
|
+
_validate_azimuthal_max = field_validator(
|
|
271
|
+
'azimuthal_max')(validate_range_max('azimuthal'))
|
|
269
272
|
|
|
270
273
|
def validate_for_map_config(self, map_config:BaseModel):
|
|
271
274
|
"""Validate the existence of the detector data file for all
|