ChessAnalysisPipeline 0.0.17.dev6__tar.gz → 0.0.17.dev8__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.
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/__init__.py +1 -2
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/utils.py +7 -5
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/models.py +2 -1
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/select_material_params_gui.py +2 -1
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/models.py +9 -11
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/processor.py +74 -67
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/server.py +36 -31
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/models.py +4 -1
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/models.py +47 -13
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/ChessAnalysisPipeline.egg-info/PKG-INFO +4 -4
- chessanalysispipeline-0.0.17.dev8/ChessAnalysisPipeline.egg-info/requires.txt +3 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/PKG-INFO +4 -4
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/setup.py +4 -5
- chessanalysispipeline-0.0.17.dev6/ChessAnalysisPipeline.egg-info/requires.txt +0 -3
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/TaskManager.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/common.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/integration.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/map.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/utils.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/utils.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/models.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/models.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/pipeline.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/runner.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/processor.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/reader.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/converters.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/fit.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/general.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/material.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/parfile.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/writer.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/ChessAnalysisPipeline.egg-info/SOURCES.txt +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/ChessAnalysisPipeline.egg-info/dependency_links.txt +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/ChessAnalysisPipeline.egg-info/entry_points.txt +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/ChessAnalysisPipeline.egg-info/top_level.txt +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/LICENSE +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/MLaaS/__init__.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/MLaaS/ktrain.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/MLaaS/mnist_img.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/MLaaS/tfaas_client.py +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/README.md +0 -0
- {chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/setup.cfg +0 -0
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/utils.py
RENAMED
|
@@ -14,7 +14,7 @@ import subprocess
|
|
|
14
14
|
import json
|
|
15
15
|
|
|
16
16
|
# Third party modules
|
|
17
|
-
import
|
|
17
|
+
from importlib.metadata import distributions
|
|
18
18
|
|
|
19
19
|
def osinfo():
|
|
20
20
|
"""Helper function to provide osinfo."""
|
|
@@ -58,8 +58,9 @@ def environments():
|
|
|
58
58
|
# Check for Virtualenv (excluding Conda)
|
|
59
59
|
elif hasattr(sys, 'real_prefix') or os.getenv('VIRTUAL_ENV'):
|
|
60
60
|
venv_name = os.path.basename(os.getenv('VIRTUAL_ENV', 'unknown-venv'))
|
|
61
|
-
packages = [{'name': pkg.
|
|
62
|
-
|
|
61
|
+
packages = [{'name': pkg.metadata['Name'],
|
|
62
|
+
'version': pkg.version}
|
|
63
|
+
for pkg in distributions()]
|
|
63
64
|
environments_.append({
|
|
64
65
|
'name': venv_name,
|
|
65
66
|
'version': sys.version.split()[0],
|
|
@@ -71,8 +72,9 @@ def environments():
|
|
|
71
72
|
|
|
72
73
|
# System Python (not inside Conda or Virtualenv)
|
|
73
74
|
else:
|
|
74
|
-
packages = [{'name': pkg.
|
|
75
|
-
|
|
75
|
+
packages = [{'name': pkg.metadata['Name'],
|
|
76
|
+
'version': pkg.version}
|
|
77
|
+
for pkg in distributions()]
|
|
76
78
|
environments_.append({
|
|
77
79
|
'name': 'system-python',
|
|
78
80
|
'version': sys.version.split()[0],
|
|
@@ -718,7 +718,8 @@ class MCAEnergyCalibrationConfig(MCACalibrationConfig):
|
|
|
718
718
|
"""
|
|
719
719
|
if self.peak_energies is None:
|
|
720
720
|
raise ValueError('peak_energies is required')
|
|
721
|
-
if
|
|
721
|
+
if (self.max_peak_index is not None
|
|
722
|
+
and not 0 <= self.max_peak_index < len(self.peak_energies)):
|
|
722
723
|
raise ValueError('max_peak_index out of bounds')
|
|
723
724
|
return self
|
|
724
725
|
|
|
@@ -145,7 +145,8 @@ class MaterialParamSelector:
|
|
|
145
145
|
# pos=['4a', '8c'])
|
|
146
146
|
# #pos=[(0,0,0), (1/4, 1/4, 1/4), (3/4, 3/4, 3/4)])
|
|
147
147
|
self.material_name, sgnum=self.sgnum,
|
|
148
|
-
lattice_parameters_angstroms=
|
|
148
|
+
# lattice_parameters_angstroms = lattice_parameters FIX?
|
|
149
|
+
lattice_parameters_angstroms = self.lattice_parameters
|
|
149
150
|
material.material_name = name
|
|
150
151
|
material.sgnum = _material.sgnum
|
|
151
152
|
material.lattice_parameters = [
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/models.py
RENAMED
|
@@ -20,25 +20,23 @@ from CHAP import CHAPBaseModel
|
|
|
20
20
|
class FoxdenRequestConfig(CHAPBaseModel):
|
|
21
21
|
"""FOXDEN HTTP request base configuration class.
|
|
22
22
|
|
|
23
|
-
:param url: URL of service.
|
|
24
|
-
:type url: str
|
|
25
23
|
:param did: FOXDEN dataset identifier (did).
|
|
26
24
|
:type did: string, optional
|
|
27
|
-
:param query: FOXDEN query.
|
|
28
|
-
:type query: string, optional
|
|
29
|
-
:param method: HTTP request method (not case sensitive),
|
|
30
|
-
defaults to `'POST'`.
|
|
31
|
-
:type method: Literal['DELETE', 'GET', 'POST', 'PUT'], optional
|
|
32
|
-
# :param scope: FOXDEN scope (not case sensitive).
|
|
33
|
-
# :type scope: Literal['read', 'write'], optional
|
|
34
|
-
# :param idx: Ask Valentin, currently it's ignored
|
|
35
|
-
# :type idx: int, optional
|
|
36
25
|
:param limit: Maximum number of returned records,
|
|
37
26
|
defaults to `10`.
|
|
38
27
|
:type limit: int, optional
|
|
28
|
+
:param query: FOXDEN query.
|
|
29
|
+
:type query: string, optional
|
|
39
30
|
:param verbose: Verbose output flag, defaults to `False`.
|
|
40
31
|
:type verbose: bool, optional
|
|
41
32
|
"""
|
|
33
|
+
# :param method: HTTP request method (not case sensitive),
|
|
34
|
+
# defaults to `'POST'`.
|
|
35
|
+
# :type method: Literal['DELETE', 'GET', 'POST', 'PUT'], optional
|
|
36
|
+
# :param scope: FOXDEN scope (not case sensitive).
|
|
37
|
+
# :type scope: Literal['read', 'write'], optional
|
|
38
|
+
# :param idx: Ask Valentin, currently it's ignored
|
|
39
|
+
# :type idx: int, optional
|
|
42
40
|
# Mimics golib.services.data.ServiceQuery
|
|
43
41
|
did: Optional[constr(
|
|
44
42
|
strict=True, strip_whitespace=True, to_lower=True)] = None
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/processor.py
RENAMED
|
@@ -254,76 +254,83 @@ class GiwaxsConversionProcessor(Processor):
|
|
|
254
254
|
data_curved, q_par, q_perp, q_par_rect, q_perp_rect,
|
|
255
255
|
return_maps=False, normalize=True):
|
|
256
256
|
"""
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
::
|
|
258
|
+
|
|
259
|
+
data_rect = curved_to_rect(...):
|
|
260
|
+
distributes counts from a curvilinear grid
|
|
261
|
+
(data_curved), e.g. x-ray data collected in angular
|
|
262
|
+
space, into a rectilinear grid (reciprocal space).
|
|
261
263
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
data_rect, norm, xmap, ymap, xwid, ywid =
|
|
265
|
+
curved_to_rect(..., return_maps=True):
|
|
266
|
+
distributes counts from a curvilinear grid
|
|
267
|
+
(data_curved), e.g. x-ray data collected in angular
|
|
268
|
+
space, into a rectilinear grid (reciprocal space).
|
|
267
269
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
270
|
+
q_par, q_perp, and data_curved are M x N following the
|
|
271
|
+
normal convention where the the first & second index
|
|
272
|
+
corrspond to the vertical (y) and horizontal (x)
|
|
273
|
+
locations of the scattering pattern.
|
|
274
|
+
q_par, q_perp represent the q coordinates of the center of
|
|
275
|
+
pixels whose intensities are stored in data_curved.
|
|
276
|
+
Reiterating the convention above, q_par and q_perp vary
|
|
277
|
+
primarilly along the 2nd and 1st index, respectively.
|
|
278
|
+
q_par_rect and q_perp_rect are evenly-spaced, monotonically
|
|
279
|
+
increasing, arrays determining the new grid.
|
|
278
280
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
281
|
+
data_rect : the new matrix with intensity from data_curved
|
|
282
|
+
disctributed into a regular grid defined by
|
|
283
|
+
q_par_rect, q_perp_rect.
|
|
284
|
+
norm : a matrix with the same shape of data_rect
|
|
285
|
+
representing the area of the pixel in the original
|
|
286
|
+
angular units. It should be used to normalize the
|
|
287
|
+
resulting array as norm_z = data_rect / norm.
|
|
288
|
+
|
|
289
|
+
Algorithm:
|
|
290
|
+
Step 1 : Compute xmap, ymap, which containt the values
|
|
291
|
+
of q_par and q_perp, but represented in pixel
|
|
292
|
+
units of the target coordinates q_par_rect,
|
|
293
|
+
q_perp_rect.
|
|
294
|
+
In other words, xmap(i,j) = 3.4 means that
|
|
295
|
+
q_par(i,j) lands 2/5 of the q_distance between
|
|
296
|
+
q_par_rect(3) and q_par_rect(4). Intensity in
|
|
297
|
+
qpar(i,j) should thus be distributed in a 2:3
|
|
298
|
+
ratio among neighboring mini-columns of pixels
|
|
299
|
+
3 and 4.
|
|
300
|
+
Step 2 : Use the procedure described by Barna et al
|
|
301
|
+
(RSI v.70, p. 2927, 1999) to distribute
|
|
302
|
+
intensity from each source pixel i,j into each
|
|
303
|
+
of 9 destination pixels around the xmap(i,j)
|
|
304
|
+
and ymap(i,j). Keep track of how many source
|
|
305
|
+
"pixels" are placed into each bin in the
|
|
306
|
+
variable, "norm". Note also that if
|
|
307
|
+
xmap(i,j)-floor(xmap(i,j)) > 0.5,
|
|
308
|
+
the "center" pixel of the 9 destination pixels
|
|
309
|
+
is floor(xmap+0.5).
|
|
310
|
+
(Outside this function): The normalized intensity in
|
|
311
|
+
each new pixel can be obtained as
|
|
312
|
+
I = data_rect./norm, but with the caveat that zero
|
|
313
|
+
values of "norm" should be changed to ones first,
|
|
314
|
+
norm(data_rect == 0) = 1.0.
|
|
315
|
+
|
|
316
|
+
Example Usage:
|
|
317
|
+
1. Compute the values of q_par and q_perp for each
|
|
318
|
+
pixel in the image z (according to scattering
|
|
319
|
+
geometry).
|
|
320
|
+
2. Set or determing a good target grid, e.g.:
|
|
321
|
+
min_qpar, max_qpar = q_par.mix(), q_par.max()
|
|
322
|
+
min_qperp, max_qperp = q_perp.mix(), q_perp.max()
|
|
323
|
+
q_par_rect, q_par_step = np.linspace(min_qpar ,
|
|
324
|
+
max_qpar, image_dim[1], retstep=True)
|
|
325
|
+
q_perp_rect, q_perp_step = np.linspace(min_qperp,
|
|
326
|
+
max_qperp, image_dim[0], retstep=True)
|
|
327
|
+
3. data_rect = curved_to_rect(data_curved, q_par,
|
|
328
|
+
q_perp, q_par_rect, q_perp_rect)
|
|
329
|
+
4. plt.imshow(data_rect, extent = [
|
|
330
|
+
q_par_rect[0], q_par_rect[-1],
|
|
331
|
+
q_perp_rect[-1], q_perp_rect[0]])
|
|
332
|
+
xlabel(r'q$_\parallel$'' [\u212b$^{-1}$]')
|
|
333
|
+
ylabel(r'q$_\perp$'' [\u212b$^{-1}$]')
|
|
327
334
|
"""
|
|
328
335
|
out_width, out_height = q_par_rect.size, q_perp_rect.size
|
|
329
336
|
|
|
@@ -5,48 +5,53 @@ File : server.py
|
|
|
5
5
|
Author : Valentin Kuznetsov <vkuznet AT gmail dot com>
|
|
6
6
|
Description: Python server with thread pool and CHAP pipeline
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
===========
|
|
9
|
+
Client side
|
|
10
|
+
===========
|
|
9
11
|
cat /tmp/chap.json
|
|
10
12
|
{"pipeline": [{"common.PrintProcessor": {}}], "input": 1}
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
==========================================
|
|
15
|
+
Curl call to the server with CHAP pipeline
|
|
16
|
+
==========================================
|
|
13
17
|
curl -X POST -H "Content-type: application/json" -d@/tmp/chap.json http://localhost:5000/pipeline
|
|
14
18
|
{"pipeline": [{"common.PrintProcessor":{}}], "status":"ok"}
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
===========
|
|
21
|
+
Server side
|
|
22
|
+
===========
|
|
17
23
|
flask --app server run
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
* Serving Flask app 'server'
|
|
26
|
+
* Debug mode: off
|
|
27
|
+
|
|
20
28
|
WARNING: This is a development server. Do not use it in a production
|
|
21
29
|
deployment. Use a production WSGI server instead.
|
|
22
|
-
|
|
30
|
+
|
|
31
|
+
* Running on http://127.0.0.1:5000
|
|
32
|
+
|
|
23
33
|
Press CTRL+C to quit
|
|
24
|
-
...
|
|
25
|
-
|
|
26
|
-
CHAP.server : Call pipeline args=()
|
|
27
|
-
kwds={'pipeline': [{'common.PrintProcessor': {}}]}
|
|
28
|
-
CHAP.server : pipeline [{'common.PrintProcessor': {}}]
|
|
29
|
-
CHAP.server : Loaded
|
|
30
|
-
<CHAP.common.processor.PrintProcessor object at 0x10e0f1ed0>
|
|
31
|
-
CHAP.server : Loaded
|
|
32
|
-
<CHAP.pipeline.Pipeline object at 0x10e0f1f10> with 1 items
|
|
33
|
-
|
|
34
|
-
CHAP.server : Calling "execute" on <CHAP.pipeline.Pipeline
|
|
35
|
-
object at 0x10e0f1f10>
|
|
36
|
-
Pipeline : Executing "execute"
|
|
37
|
-
|
|
38
|
-
Pipeline : Calling "process" on
|
|
39
|
-
<CHAP.common.processor.PrintProcessor object at 0x10e0f1ed0>
|
|
40
|
-
PrintProcessor : Executing "process" with
|
|
41
|
-
type(data)=<class 'NoneType'>
|
|
42
|
-
PrintProcessor data :
|
|
43
|
-
None
|
|
44
|
-
PrintProcessor : Finished "process" in 0.000 seconds
|
|
45
|
-
|
|
46
|
-
Pipeline : Executed "execute" in 0.000 seconds
|
|
47
|
-
127.0.0.1 - - [07/Apr/2023 09:11:22] "POST /pipeline HTTP/1.1" 200 -
|
|
48
|
-
"""
|
|
49
34
|
|
|
35
|
+
CHAP output::
|
|
36
|
+
|
|
37
|
+
CHAP.server : Call pipeline args=()
|
|
38
|
+
kwds={'pipeline': [{'common.PrintProcessor': {}}]}
|
|
39
|
+
CHAP.server : pipeline [{'common.PrintProcessor': {}}]
|
|
40
|
+
CHAP.server : Loaded
|
|
41
|
+
<CHAP.common.processor.PrintProcessor object at 0x10e0f1ed0>
|
|
42
|
+
CHAP.server : Loaded
|
|
43
|
+
<CHAP.pipeline.Pipeline object at 0x10e0f1f10> with 1 items
|
|
44
|
+
CHAP.server : Calling "execute" on <CHAP.pipeline.Pipeline
|
|
45
|
+
object at 0x10e0f1f10>
|
|
46
|
+
Pipeline : Executing "execute"
|
|
47
|
+
Pipeline : Calling "process" on
|
|
48
|
+
<CHAP.common.processor.PrintProcessor object at 0x10e0f1ed0>
|
|
49
|
+
PrintProcessor : Executing "process" with
|
|
50
|
+
type(data)=<class 'NoneType'>
|
|
51
|
+
PrintProcessor data : None
|
|
52
|
+
PrintProcessor : Finished "process" in 0.000 seconds
|
|
53
|
+
Pipeline : Executed "execute" in 0.000 seconds
|
|
54
|
+
"""
|
|
50
55
|
# System modules
|
|
51
56
|
import time
|
|
52
57
|
from queue import Queue
|
|
@@ -6,6 +6,7 @@ from typing import (
|
|
|
6
6
|
Optional,
|
|
7
7
|
)
|
|
8
8
|
from pydantic import (
|
|
9
|
+
ConfigDict,
|
|
9
10
|
conint,
|
|
10
11
|
conlist,
|
|
11
12
|
confloat,
|
|
@@ -40,7 +41,7 @@ class Detector(CHAPBaseModel):
|
|
|
40
41
|
pixel_size: conlist(
|
|
41
42
|
item_type=confloat(gt=0, allow_inf_nan=False),
|
|
42
43
|
min_length=1, max_length=2)
|
|
43
|
-
lens_magnification: confloat(gt=0, allow_inf_nan=False) = 1.0
|
|
44
|
+
lens_magnification: Optional[confloat(gt=0, allow_inf_nan=False)] = 1.0
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
class TomoReduceConfig(CHAPBaseModel):
|
|
@@ -208,3 +209,5 @@ class TomoSimConfig(CHAPBaseModel):
|
|
|
208
209
|
beam_intensity: Optional[confloat(gt=0, allow_inf_nan=False)] = 1.e9
|
|
209
210
|
background_intensity: Optional[confloat(gt=0, allow_inf_nan=False)] = 20
|
|
210
211
|
slit_size: Optional[confloat(gt=0, allow_inf_nan=False)] = 1.0
|
|
212
|
+
|
|
213
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/models.py
RENAMED
|
@@ -91,19 +91,53 @@ def lorentzian(x, amplitude=1.0, center=0.0, sigma=1.0):
|
|
|
91
91
|
def rectangle(
|
|
92
92
|
x, amplitude=1.0, center1=0.0, sigma1=1.0, center2=1.0,
|
|
93
93
|
sigma2=1.0, form='linear'):
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
with
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
r"""
|
|
95
|
+
Return a rectangle function.
|
|
96
|
+
|
|
97
|
+
Starts at 0.0, rises to ``amplitude`` (at ``center1`` with width
|
|
98
|
+
``sigma1``), then drops to 0.0 (at ``center2`` with width
|
|
99
|
+
``sigma2``)
|
|
100
|
+
|
|
101
|
+
:param x: Input values where the function is evaluated.
|
|
102
|
+
:type x: float or numpy.ndarray
|
|
103
|
+
:param amplitude: Maximum height of the rectangle, defaults to 1.0.
|
|
104
|
+
:type amplitude: float, optional
|
|
105
|
+
:param center1: Location of the rising edge, defaults to 0.0.
|
|
106
|
+
:type center1: float, optional
|
|
107
|
+
:param sigma1: Width or smoothness of the rising edge,
|
|
108
|
+
defaults to 1.0.
|
|
109
|
+
:type sigma1: float, optional
|
|
110
|
+
:param center2: Location of the falling edge, defaults to 1.0.
|
|
111
|
+
:type center2: float, optional
|
|
112
|
+
:param sigma2: Width or smoothness of the falling edge,
|
|
113
|
+
defaults to 1.0.
|
|
114
|
+
:type sigma2: float, optional
|
|
115
|
+
:param form: Shape type of the transition edges:
|
|
116
|
+
|
|
117
|
+
- ``'linear'``: Simple ramp-up and ramp-down.
|
|
118
|
+
- ``'atan'`` or ``'arctan'``: Inverse tangent transitions.
|
|
119
|
+
- ``'erf'``: Error function (Gaussian-like) transitions.
|
|
120
|
+
- ``'logistic'``: Sigmoidal (logistic function) transitions.
|
|
121
|
+
:type form: str, optional
|
|
122
|
+
|
|
123
|
+
:returns: The evaluated rectangle function values.
|
|
124
|
+
:rtype: float or numpy.ndarray
|
|
125
|
+
|
|
126
|
+
.. note::
|
|
127
|
+
The output is calculated based on the selected ``form``:
|
|
128
|
+
|
|
129
|
+
- **atan**: $\frac{A}{\pi} [ \arctan(arg_1) + \arctan(arg_2) ]$
|
|
130
|
+
- **erf**:
|
|
131
|
+
$\frac{1}{2} A [ \text{erf}(arg_1) + \text{erf}(arg_2) ]$
|
|
132
|
+
- **logistic**:
|
|
133
|
+
$A [ \frac{1}{1 + \exp(-arg_1)} +
|
|
134
|
+
\frac{1}{1 + \exp(-arg_2)} - 1 ]$
|
|
135
|
+
|
|
136
|
+
The function is constructed using normalized arguments for the
|
|
137
|
+
rising and falling edges:
|
|
138
|
+
$arg_1 = \frac{x - center_1}{\sigma_1}$
|
|
139
|
+
and
|
|
140
|
+
$arg_2 = \frac{center_2 - x}{\sigma_2}$
|
|
107
141
|
"""
|
|
108
142
|
arg1 = (x - center1)/max(tiny, sigma1)
|
|
109
143
|
arg2 = (center2 - x)/max(tiny, sigma2)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ChessAnalysisPipeline
|
|
3
|
-
Version: 0.0.17.
|
|
3
|
+
Version: 0.0.17.dev8
|
|
4
4
|
Summary: CHESS analysis pipeline framework
|
|
5
5
|
Home-page: https://github.com/CHESSComputing/ChessAnalysisPipeline
|
|
6
6
|
Author: Keara Soloway, Rolf Verberg, Valentin Kuznetsov
|
|
@@ -11,9 +11,9 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: pydantic
|
|
16
|
-
Requires-Dist: pyyaml
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: pydantic
|
|
16
|
+
Requires-Dist: pyyaml
|
|
17
17
|
|
|
18
18
|
[](https://zenodo.org/badge/latestdoi/600053436)
|
|
19
19
|

|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ChessAnalysisPipeline
|
|
3
|
-
Version: 0.0.17.
|
|
3
|
+
Version: 0.0.17.dev8
|
|
4
4
|
Summary: CHESS analysis pipeline framework
|
|
5
5
|
Home-page: https://github.com/CHESSComputing/ChessAnalysisPipeline
|
|
6
6
|
Author: Keara Soloway, Rolf Verberg, Valentin Kuznetsov
|
|
@@ -11,9 +11,9 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: pydantic
|
|
16
|
-
Requires-Dist: pyyaml
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: pydantic
|
|
16
|
+
Requires-Dist: pyyaml
|
|
17
17
|
|
|
18
18
|
[](https://zenodo.org/badge/latestdoi/600053436)
|
|
19
19
|

|
|
@@ -12,8 +12,7 @@ import os
|
|
|
12
12
|
import setuptools
|
|
13
13
|
|
|
14
14
|
# [set version]
|
|
15
|
-
version = 'v0.0.17.
|
|
16
|
-
#version = 'v0.0.17'
|
|
15
|
+
version = 'v0.0.17.dev8'
|
|
17
16
|
# [version set]
|
|
18
17
|
|
|
19
18
|
def datafiles(idir, pattern=None):
|
|
@@ -86,8 +85,8 @@ setuptools.setup(
|
|
|
86
85
|
],
|
|
87
86
|
python_requires='>=3.10',
|
|
88
87
|
install_requires=[
|
|
89
|
-
'numpy
|
|
90
|
-
'pydantic
|
|
91
|
-
'pyyaml
|
|
88
|
+
'numpy',
|
|
89
|
+
'pydantic',
|
|
90
|
+
'pyyaml',
|
|
92
91
|
],
|
|
93
92
|
)
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/models/map.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/processor.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/common/writer.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/edd/processor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/processor.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/utils.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/foxden/writer.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/models.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/giwaxs/writer.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/processor.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/inference/writer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/processor.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/saxswaxs/writer.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/processor.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/reader.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/sin2psi/writer.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/tomo/processor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/__init__.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/converters.py
RENAMED
|
File without changes
|
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/general.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/material.py
RENAMED
|
File without changes
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/CHAP/utils/parfile.py
RENAMED
|
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
|
{chessanalysispipeline-0.0.17.dev6 → chessanalysispipeline-0.0.17.dev8}/MLaaS/tfaas_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|