fakecbed 0.1.0__py3-none-any.whl → 0.2.1__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.
- fakecbed/discretized.py +50 -63
- fakecbed/shapes.py +146 -137
- fakecbed/tds.py +12 -15
- fakecbed/version.py +2 -2
- {fakecbed-0.1.0.dist-info → fakecbed-0.2.1.dist-info}/METADATA +3 -3
- fakecbed-0.2.1.dist-info/RECORD +10 -0
- {fakecbed-0.1.0.dist-info → fakecbed-0.2.1.dist-info}/WHEEL +1 -1
- fakecbed-0.1.0.dist-info/RECORD +0 -10
- {fakecbed-0.1.0.dist-info → fakecbed-0.2.1.dist-info}/LICENSE +0 -0
- {fakecbed-0.1.0.dist-info → fakecbed-0.2.1.dist-info}/top_level.txt +0 -0
fakecbed/discretized.py
CHANGED
|
@@ -21,12 +21,6 @@
|
|
|
21
21
|
## Load libraries/packages/modules ##
|
|
22
22
|
#####################################
|
|
23
23
|
|
|
24
|
-
# For accessing attributes of functions.
|
|
25
|
-
import inspect
|
|
26
|
-
|
|
27
|
-
# For randomly selecting items in dictionaries.
|
|
28
|
-
import random
|
|
29
|
-
|
|
30
24
|
# For performing deep copies.
|
|
31
25
|
import copy
|
|
32
26
|
|
|
@@ -74,9 +68,7 @@ __all__ = ["CBEDPattern"]
|
|
|
74
68
|
|
|
75
69
|
|
|
76
70
|
def _check_and_convert_undistorted_tds_model(params):
|
|
77
|
-
|
|
78
|
-
char_idx = 19
|
|
79
|
-
obj_name = current_func_name[char_idx:]
|
|
71
|
+
obj_name = "undistorted_tds_model"
|
|
80
72
|
obj = params[obj_name]
|
|
81
73
|
|
|
82
74
|
accepted_types = (fakecbed.tds.Model, type(None))
|
|
@@ -95,7 +87,7 @@ def _check_and_convert_undistorted_tds_model(params):
|
|
|
95
87
|
|
|
96
88
|
|
|
97
89
|
def _pre_serialize_undistorted_tds_model(undistorted_tds_model):
|
|
98
|
-
obj_to_pre_serialize =
|
|
90
|
+
obj_to_pre_serialize = undistorted_tds_model
|
|
99
91
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
100
92
|
|
|
101
93
|
return serializable_rep
|
|
@@ -111,11 +103,11 @@ def _de_pre_serialize_undistorted_tds_model(serializable_rep):
|
|
|
111
103
|
|
|
112
104
|
|
|
113
105
|
def _check_and_convert_undistorted_disks(params):
|
|
114
|
-
|
|
115
|
-
char_idx = 19
|
|
116
|
-
obj_name = current_func_name[char_idx:]
|
|
106
|
+
obj_name = "undistorted_disks"
|
|
117
107
|
obj = params[obj_name]
|
|
118
108
|
|
|
109
|
+
current_func_name = "_check_and_convert_undistorted_disks"
|
|
110
|
+
|
|
119
111
|
try:
|
|
120
112
|
for undistorted_disk in obj:
|
|
121
113
|
accepted_types = (fakecbed.shapes.NonuniformBoundedShape,)
|
|
@@ -147,7 +139,7 @@ def _check_and_convert_undistorted_disks(params):
|
|
|
147
139
|
|
|
148
140
|
|
|
149
141
|
def _pre_serialize_undistorted_disks(undistorted_disks):
|
|
150
|
-
obj_to_pre_serialize =
|
|
142
|
+
obj_to_pre_serialize = undistorted_disks
|
|
151
143
|
serializable_rep = tuple()
|
|
152
144
|
for elem in obj_to_pre_serialize:
|
|
153
145
|
serializable_rep += (elem.pre_serialize(),)
|
|
@@ -172,9 +164,7 @@ def _de_pre_serialize_undistorted_disks(serializable_rep):
|
|
|
172
164
|
|
|
173
165
|
|
|
174
166
|
def _check_and_convert_undistorted_misc_shapes(params):
|
|
175
|
-
|
|
176
|
-
char_idx = 19
|
|
177
|
-
obj_name = current_func_name[char_idx:]
|
|
167
|
+
obj_name = "undistorted_misc_shapes"
|
|
178
168
|
obj = params[obj_name]
|
|
179
169
|
|
|
180
170
|
accepted_types = (fakecbed.shapes.Circle,
|
|
@@ -188,6 +178,8 @@ def _check_and_convert_undistorted_misc_shapes(params):
|
|
|
188
178
|
fakecbed.shapes.Lune,
|
|
189
179
|
fakecbed.shapes.NonuniformBoundedShape)
|
|
190
180
|
|
|
181
|
+
current_func_name = "_check_and_convert_undistorted_misc_shapes"
|
|
182
|
+
|
|
191
183
|
try:
|
|
192
184
|
for undistorted_misc_shape in obj:
|
|
193
185
|
kwargs = {"obj": undistorted_misc_shape,
|
|
@@ -205,7 +197,7 @@ def _check_and_convert_undistorted_misc_shapes(params):
|
|
|
205
197
|
|
|
206
198
|
|
|
207
199
|
def _pre_serialize_undistorted_misc_shapes(undistorted_misc_shapes):
|
|
208
|
-
obj_to_pre_serialize =
|
|
200
|
+
obj_to_pre_serialize = undistorted_misc_shapes
|
|
209
201
|
serializable_rep = tuple()
|
|
210
202
|
for elem in obj_to_pre_serialize:
|
|
211
203
|
serializable_rep += (elem.pre_serialize(),)
|
|
@@ -249,9 +241,7 @@ def _de_pre_serialize_undistorted_misc_shapes(serializable_rep):
|
|
|
249
241
|
|
|
250
242
|
|
|
251
243
|
def _check_and_convert_undistorted_outer_illumination_shape(params):
|
|
252
|
-
|
|
253
|
-
char_idx = 19
|
|
254
|
-
obj_name = current_func_name[char_idx:]
|
|
244
|
+
obj_name = "undistorted_outer_illumination_shape"
|
|
255
245
|
obj = params[obj_name]
|
|
256
246
|
|
|
257
247
|
accepted_types = (fakecbed.shapes.Circle,
|
|
@@ -275,7 +265,7 @@ def _check_and_convert_undistorted_outer_illumination_shape(params):
|
|
|
275
265
|
|
|
276
266
|
def _pre_serialize_undistorted_outer_illumination_shape(
|
|
277
267
|
undistorted_outer_illumination_shape):
|
|
278
|
-
obj_to_pre_serialize =
|
|
268
|
+
obj_to_pre_serialize = undistorted_outer_illumination_shape
|
|
279
269
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
280
270
|
|
|
281
271
|
return serializable_rep
|
|
@@ -298,8 +288,7 @@ def _de_pre_serialize_undistorted_outer_illumination_shape(serializable_rep):
|
|
|
298
288
|
|
|
299
289
|
|
|
300
290
|
def _check_and_convert_gaussian_filter_std_dev(params):
|
|
301
|
-
|
|
302
|
-
obj_name = current_func_name[19:]
|
|
291
|
+
obj_name = "gaussian_filter_std_dev"
|
|
303
292
|
func_alias = czekitout.convert.to_nonnegative_float
|
|
304
293
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
305
294
|
gaussian_filter_std_dev = func_alias(**kwargs)
|
|
@@ -308,9 +297,8 @@ def _check_and_convert_gaussian_filter_std_dev(params):
|
|
|
308
297
|
|
|
309
298
|
|
|
310
299
|
|
|
311
|
-
def _pre_serialize_gaussian_filter_std_dev(
|
|
312
|
-
|
|
313
|
-
obj_to_pre_serialize = random.choice(list(locals().values()))
|
|
300
|
+
def _pre_serialize_gaussian_filter_std_dev(gaussian_filter_std_dev):
|
|
301
|
+
obj_to_pre_serialize = gaussian_filter_std_dev
|
|
314
302
|
serializable_rep = obj_to_pre_serialize
|
|
315
303
|
|
|
316
304
|
return serializable_rep
|
|
@@ -325,9 +313,7 @@ def _de_pre_serialize_gaussian_filter_std_dev(serializable_rep):
|
|
|
325
313
|
|
|
326
314
|
|
|
327
315
|
def _check_and_convert_distortion_model(params):
|
|
328
|
-
|
|
329
|
-
char_idx = 19
|
|
330
|
-
obj_name = current_func_name[char_idx:]
|
|
316
|
+
obj_name = "distortion_model"
|
|
331
317
|
obj = params[obj_name]
|
|
332
318
|
|
|
333
319
|
num_pixels_across_pattern = \
|
|
@@ -351,6 +337,8 @@ def _check_and_convert_distortion_model(params):
|
|
|
351
337
|
sampling_grid_dims_in_pixels = \
|
|
352
338
|
distortion_model_core_attrs["sampling_grid_dims_in_pixels"]
|
|
353
339
|
|
|
340
|
+
current_func_name = "_check_and_convert_distortion_model"
|
|
341
|
+
|
|
354
342
|
if ((sampling_grid_dims_in_pixels[0]%num_pixels_across_pattern != 0)
|
|
355
343
|
or (sampling_grid_dims_in_pixels[1]%num_pixels_across_pattern != 0)):
|
|
356
344
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
@@ -361,7 +349,7 @@ def _check_and_convert_distortion_model(params):
|
|
|
361
349
|
|
|
362
350
|
|
|
363
351
|
def _pre_serialize_distortion_model(distortion_model):
|
|
364
|
-
obj_to_pre_serialize =
|
|
352
|
+
obj_to_pre_serialize = distortion_model
|
|
365
353
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
366
354
|
|
|
367
355
|
return serializable_rep
|
|
@@ -377,8 +365,7 @@ def _de_pre_serialize_distortion_model(serializable_rep):
|
|
|
377
365
|
|
|
378
366
|
|
|
379
367
|
def _check_and_convert_num_pixels_across_pattern(params):
|
|
380
|
-
|
|
381
|
-
obj_name = current_func_name[19:]
|
|
368
|
+
obj_name = "num_pixels_across_pattern"
|
|
382
369
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
383
370
|
num_pixels_across_pattern = czekitout.convert.to_positive_int(**kwargs)
|
|
384
371
|
|
|
@@ -387,7 +374,7 @@ def _check_and_convert_num_pixels_across_pattern(params):
|
|
|
387
374
|
|
|
388
375
|
|
|
389
376
|
def _pre_serialize_num_pixels_across_pattern(num_pixels_across_pattern):
|
|
390
|
-
obj_to_pre_serialize =
|
|
377
|
+
obj_to_pre_serialize = num_pixels_across_pattern
|
|
391
378
|
serializable_rep = obj_to_pre_serialize
|
|
392
379
|
|
|
393
380
|
return serializable_rep
|
|
@@ -402,8 +389,7 @@ def _de_pre_serialize_num_pixels_across_pattern(serializable_rep):
|
|
|
402
389
|
|
|
403
390
|
|
|
404
391
|
def _check_and_convert_apply_shot_noise(params):
|
|
405
|
-
|
|
406
|
-
obj_name = current_func_name[19:]
|
|
392
|
+
obj_name = "apply_shot_noise"
|
|
407
393
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
408
394
|
apply_shot_noise = czekitout.convert.to_bool(**kwargs)
|
|
409
395
|
|
|
@@ -412,7 +398,7 @@ def _check_and_convert_apply_shot_noise(params):
|
|
|
412
398
|
|
|
413
399
|
|
|
414
400
|
def _pre_serialize_apply_shot_noise(apply_shot_noise):
|
|
415
|
-
obj_to_pre_serialize =
|
|
401
|
+
obj_to_pre_serialize = apply_shot_noise
|
|
416
402
|
serializable_rep = obj_to_pre_serialize
|
|
417
403
|
|
|
418
404
|
return serializable_rep
|
|
@@ -427,8 +413,7 @@ def _de_pre_serialize_apply_shot_noise(serializable_rep):
|
|
|
427
413
|
|
|
428
414
|
|
|
429
415
|
def _check_and_convert_detector_partition_width_in_pixels(params):
|
|
430
|
-
|
|
431
|
-
obj_name = current_func_name[19:]
|
|
416
|
+
obj_name = "detector_partition_width_in_pixels"
|
|
432
417
|
func_alias = czekitout.convert.to_nonnegative_int
|
|
433
418
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
434
419
|
detector_partition_width_in_pixels = func_alias(**kwargs)
|
|
@@ -439,7 +424,7 @@ def _check_and_convert_detector_partition_width_in_pixels(params):
|
|
|
439
424
|
|
|
440
425
|
def _pre_serialize_detector_partition_width_in_pixels(
|
|
441
426
|
detector_partition_width_in_pixels):
|
|
442
|
-
obj_to_pre_serialize =
|
|
427
|
+
obj_to_pre_serialize = detector_partition_width_in_pixels
|
|
443
428
|
serializable_rep = obj_to_pre_serialize
|
|
444
429
|
|
|
445
430
|
return serializable_rep
|
|
@@ -454,14 +439,15 @@ def _de_pre_serialize_detector_partition_width_in_pixels(serializable_rep):
|
|
|
454
439
|
|
|
455
440
|
|
|
456
441
|
def _check_and_convert_cold_pixels(params):
|
|
457
|
-
|
|
458
|
-
obj_name = current_func_name[19:]
|
|
442
|
+
obj_name = "cold_pixels"
|
|
459
443
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
460
444
|
cold_pixels = czekitout.convert.to_pairs_of_ints(**kwargs)
|
|
461
445
|
|
|
462
446
|
num_pixels_across_pattern = \
|
|
463
447
|
_check_and_convert_num_pixels_across_pattern(params)
|
|
464
448
|
|
|
449
|
+
current_func_name = "_check_and_convert_cold_pixels"
|
|
450
|
+
|
|
465
451
|
coords_of_cold_pixels = cold_pixels
|
|
466
452
|
for coords_of_cold_pixel in coords_of_cold_pixels:
|
|
467
453
|
row, col = coords_of_cold_pixel
|
|
@@ -491,8 +477,7 @@ def _de_pre_serialize_cold_pixels(serializable_rep):
|
|
|
491
477
|
|
|
492
478
|
|
|
493
479
|
def _check_and_convert_mask_frame(params):
|
|
494
|
-
|
|
495
|
-
obj_name = current_func_name[19:]
|
|
480
|
+
obj_name = "mask_frame"
|
|
496
481
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
497
482
|
mask_frame = czekitout.convert.to_quadruplet_of_nonnegative_ints(**kwargs)
|
|
498
483
|
|
|
@@ -501,7 +486,7 @@ def _check_and_convert_mask_frame(params):
|
|
|
501
486
|
|
|
502
487
|
|
|
503
488
|
def _pre_serialize_mask_frame(mask_frame):
|
|
504
|
-
obj_to_pre_serialize =
|
|
489
|
+
obj_to_pre_serialize = mask_frame
|
|
505
490
|
serializable_rep = obj_to_pre_serialize
|
|
506
491
|
|
|
507
492
|
return serializable_rep
|
|
@@ -516,8 +501,7 @@ def _de_pre_serialize_mask_frame(serializable_rep):
|
|
|
516
501
|
|
|
517
502
|
|
|
518
503
|
def _check_and_convert_deep_copy(params):
|
|
519
|
-
|
|
520
|
-
obj_name = current_func_name[19:]
|
|
504
|
+
obj_name = "deep_copy"
|
|
521
505
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
522
506
|
deep_copy = czekitout.convert.to_bool(**kwargs)
|
|
523
507
|
|
|
@@ -526,9 +510,7 @@ def _check_and_convert_deep_copy(params):
|
|
|
526
510
|
|
|
527
511
|
|
|
528
512
|
def _check_and_convert_overriding_image(params):
|
|
529
|
-
|
|
530
|
-
char_idx = 19
|
|
531
|
-
obj_name = current_func_name[char_idx:]
|
|
513
|
+
obj_name = "overriding_image"
|
|
532
514
|
obj = params[obj_name]
|
|
533
515
|
|
|
534
516
|
func_alias = fakecbed.shapes._check_and_convert_real_torch_matrix
|
|
@@ -542,6 +524,8 @@ def _check_and_convert_overriding_image(params):
|
|
|
542
524
|
num_pixels_across_pattern = params["num_pixels_across_pattern"]
|
|
543
525
|
expected_image_dims_in_pixels = 2*(num_pixels_across_pattern,)
|
|
544
526
|
|
|
527
|
+
current_func_name = "_check_and_convert_overriding_image"
|
|
528
|
+
|
|
545
529
|
if overriding_image.shape != expected_image_dims_in_pixels:
|
|
546
530
|
unformatted_err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
547
531
|
args = expected_image_dims_in_pixels
|
|
@@ -908,7 +892,7 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
|
|
|
908
892
|
\text{det}\left(\mathbf{J}_{\square}\left(
|
|
909
893
|
q_{\mathring{\mathcal{I}};x;j},
|
|
910
894
|
q_{\mathring{\mathcal{I}};y;i}\right)\right)
|
|
911
|
-
\mathring{\mathcal{I}}_{\text{CBED};⌑;i,j}
|
|
895
|
+
\left|\mathring{\mathcal{I}}_{\text{CBED};⌑;i,j}\right|.
|
|
912
896
|
:label: HD_I_CBED__3
|
|
913
897
|
|
|
914
898
|
8. Apply average pooling to
|
|
@@ -1178,8 +1162,12 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
|
|
|
1178
1162
|
|
|
1179
1163
|
|
|
1180
1164
|
|
|
1181
|
-
def update(self,
|
|
1182
|
-
|
|
1165
|
+
def update(self,
|
|
1166
|
+
new_core_attr_subset_candidate,
|
|
1167
|
+
skip_validation_and_conversion=\
|
|
1168
|
+
_default_skip_validation_and_conversion):
|
|
1169
|
+
super().update(new_core_attr_subset_candidate,
|
|
1170
|
+
skip_validation_and_conversion)
|
|
1183
1171
|
self.execute_post_core_attrs_update_actions()
|
|
1184
1172
|
|
|
1185
1173
|
return None
|
|
@@ -1666,21 +1654,20 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
|
|
|
1666
1654
|
method_name = ("_calc_maskless_and_noiseless_image"
|
|
1667
1655
|
"_and_cache_select_intermediates")
|
|
1668
1656
|
method_alias = getattr(self, method_name)
|
|
1669
|
-
|
|
1657
|
+
image = method_alias(u_x, u_y)
|
|
1658
|
+
|
|
1659
|
+
apply_shot_noise = self._apply_shot_noise
|
|
1660
|
+
image = torch.poisson(image) if (apply_shot_noise == True) else image
|
|
1670
1661
|
|
|
1662
|
+
image = self._apply_detector_partition_inpainting(input_image=image)
|
|
1663
|
+
|
|
1671
1664
|
if self._illumination_support is None:
|
|
1672
1665
|
method_name = "_calc_illumination_support"
|
|
1673
1666
|
method_alias = getattr(self, method_name)
|
|
1674
1667
|
self._illumination_support = method_alias(u_x, u_y)
|
|
1675
1668
|
illumination_support = self._illumination_support
|
|
1676
1669
|
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
apply_shot_noise = self._apply_shot_noise
|
|
1680
|
-
|
|
1681
|
-
image = (torch.poisson(noiseless_image)
|
|
1682
|
-
if (apply_shot_noise == True)
|
|
1683
|
-
else noiseless_image)
|
|
1670
|
+
image = image*illumination_support
|
|
1684
1671
|
|
|
1685
1672
|
coords_of_cold_pixels = self._cold_pixels
|
|
1686
1673
|
L, R, B, T = self._mask_frame
|
|
@@ -1694,8 +1681,6 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
|
|
|
1694
1681
|
for coords_of_cold_pixel in coords_of_cold_pixels:
|
|
1695
1682
|
image[coords_of_cold_pixel] = 0
|
|
1696
1683
|
|
|
1697
|
-
image = self._apply_detector_partition_inpainting(input_image=image)
|
|
1698
|
-
|
|
1699
1684
|
image = self._normalize_matrix(input_matrix=image)
|
|
1700
1685
|
|
|
1701
1686
|
image = torch.clip(image, min=0)
|
|
@@ -1728,6 +1713,8 @@ class CBEDPattern(fancytypes.PreSerializableAndUpdatable):
|
|
|
1728
1713
|
+ (disk_supports
|
|
1729
1714
|
* intra_disk_shapes).sum(dim=0))
|
|
1730
1715
|
|
|
1716
|
+
maskless_and_noiseless_image = torch.abs(maskless_and_noiseless_image)
|
|
1717
|
+
|
|
1731
1718
|
kwargs = {"input_matrix": maskless_and_noiseless_image,
|
|
1732
1719
|
"truncate": 4}
|
|
1733
1720
|
maskless_and_noiseless_image = self._apply_2d_guassian_filter(**kwargs)
|
fakecbed/shapes.py
CHANGED
|
@@ -58,12 +58,6 @@ coordinate transformation that maps a coordinate pair
|
|
|
58
58
|
## Load libraries/packages/modules ##
|
|
59
59
|
#####################################
|
|
60
60
|
|
|
61
|
-
# For accessing attributes of functions.
|
|
62
|
-
import inspect
|
|
63
|
-
|
|
64
|
-
# For randomly selecting items in dictionaries.
|
|
65
|
-
import random
|
|
66
|
-
|
|
67
61
|
# For performing deep copies.
|
|
68
62
|
import copy
|
|
69
63
|
|
|
@@ -109,9 +103,7 @@ __all__ = ["BaseShape",
|
|
|
109
103
|
|
|
110
104
|
|
|
111
105
|
def _check_and_convert_cartesian_coords(params):
|
|
112
|
-
|
|
113
|
-
char_idx = 19
|
|
114
|
-
obj_name = current_func_name[char_idx:]
|
|
106
|
+
obj_name = "cartesian_coords"
|
|
115
107
|
obj = params[obj_name]
|
|
116
108
|
|
|
117
109
|
u_x, u_y = obj
|
|
@@ -127,6 +119,8 @@ def _check_and_convert_cartesian_coords(params):
|
|
|
127
119
|
del params["real_torch_matrix"]
|
|
128
120
|
del params["name_of_alias_of_real_torch_matrix"]
|
|
129
121
|
|
|
122
|
+
current_func_name = "_check_and_convert_cartesian_coords"
|
|
123
|
+
|
|
130
124
|
if u_x.shape != u_y.shape:
|
|
131
125
|
unformatted_err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
132
126
|
err_msg = unformatted_err_msg.format("u_x", "u_y")
|
|
@@ -139,14 +133,14 @@ def _check_and_convert_cartesian_coords(params):
|
|
|
139
133
|
|
|
140
134
|
|
|
141
135
|
def _check_and_convert_real_torch_matrix(params):
|
|
142
|
-
|
|
143
|
-
char_idx = 19
|
|
144
|
-
obj_name = current_func_name[char_idx:]
|
|
136
|
+
obj_name = "real_torch_matrix"
|
|
145
137
|
obj = params[obj_name]
|
|
146
138
|
|
|
147
139
|
name_of_alias_of_real_torch_matrix = \
|
|
148
140
|
params["name_of_alias_of_real_torch_matrix"]
|
|
149
141
|
|
|
142
|
+
current_func_name = "_check_and_convert_real_torch_matrix"
|
|
143
|
+
|
|
150
144
|
try:
|
|
151
145
|
if not isinstance(obj, torch.Tensor):
|
|
152
146
|
kwargs = {"obj": obj,
|
|
@@ -201,8 +195,7 @@ def _check_and_convert_torch_device_obj(params):
|
|
|
201
195
|
|
|
202
196
|
|
|
203
197
|
def _check_and_convert_skip_validation_and_conversion(params):
|
|
204
|
-
|
|
205
|
-
obj_name = current_func_name[19:]
|
|
198
|
+
obj_name = "skip_validation_and_conversion"
|
|
206
199
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
207
200
|
skip_validation_and_conversion = czekitout.convert.to_bool(**kwargs)
|
|
208
201
|
|
|
@@ -346,8 +339,7 @@ class BaseShape(fancytypes.PreSerializableAndUpdatable):
|
|
|
346
339
|
|
|
347
340
|
|
|
348
341
|
def _check_and_convert_center(params):
|
|
349
|
-
|
|
350
|
-
obj_name = current_func_name[19:]
|
|
342
|
+
obj_name = "center"
|
|
351
343
|
|
|
352
344
|
cls_alias = \
|
|
353
345
|
distoptica.CoordTransformParams
|
|
@@ -363,9 +355,8 @@ def _check_and_convert_center(params):
|
|
|
363
355
|
|
|
364
356
|
|
|
365
357
|
def _pre_serialize_center(center):
|
|
366
|
-
obj_to_pre_serialize =
|
|
367
|
-
|
|
368
|
-
obj_name = current_func_name[15:]
|
|
358
|
+
obj_to_pre_serialize = center
|
|
359
|
+
obj_name = "center"
|
|
369
360
|
|
|
370
361
|
cls_alias = \
|
|
371
362
|
distoptica.CoordTransformParams
|
|
@@ -381,8 +372,7 @@ def _pre_serialize_center(center):
|
|
|
381
372
|
|
|
382
373
|
|
|
383
374
|
def _de_pre_serialize_center(serializable_rep):
|
|
384
|
-
|
|
385
|
-
obj_name = current_func_name[18:]
|
|
375
|
+
obj_name = "center"
|
|
386
376
|
|
|
387
377
|
cls_alias = \
|
|
388
378
|
distoptica.CoordTransformParams
|
|
@@ -398,8 +388,7 @@ def _de_pre_serialize_center(serializable_rep):
|
|
|
398
388
|
|
|
399
389
|
|
|
400
390
|
def _check_and_convert_radius(params):
|
|
401
|
-
|
|
402
|
-
obj_name = current_func_name[19:]
|
|
391
|
+
obj_name = "radius"
|
|
403
392
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
404
393
|
radius = czekitout.convert.to_positive_float(**kwargs)
|
|
405
394
|
|
|
@@ -408,7 +397,7 @@ def _check_and_convert_radius(params):
|
|
|
408
397
|
|
|
409
398
|
|
|
410
399
|
def _pre_serialize_radius(radius):
|
|
411
|
-
obj_to_pre_serialize =
|
|
400
|
+
obj_to_pre_serialize = radius
|
|
412
401
|
serializable_rep = obj_to_pre_serialize
|
|
413
402
|
|
|
414
403
|
return serializable_rep
|
|
@@ -423,8 +412,7 @@ def _de_pre_serialize_radius(serializable_rep):
|
|
|
423
412
|
|
|
424
413
|
|
|
425
414
|
def _check_and_convert_intra_shape_val(params):
|
|
426
|
-
|
|
427
|
-
obj_name = current_func_name[19:]
|
|
415
|
+
obj_name = "intra_shape_val"
|
|
428
416
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
429
417
|
intra_shape_val = czekitout.convert.to_float(**kwargs)
|
|
430
418
|
|
|
@@ -433,7 +421,7 @@ def _check_and_convert_intra_shape_val(params):
|
|
|
433
421
|
|
|
434
422
|
|
|
435
423
|
def _pre_serialize_intra_shape_val(intra_shape_val):
|
|
436
|
-
obj_to_pre_serialize =
|
|
424
|
+
obj_to_pre_serialize = intra_shape_val
|
|
437
425
|
serializable_rep = obj_to_pre_serialize
|
|
438
426
|
|
|
439
427
|
return serializable_rep
|
|
@@ -558,8 +546,12 @@ class Circle(BaseShape):
|
|
|
558
546
|
|
|
559
547
|
|
|
560
548
|
|
|
561
|
-
def update(self,
|
|
562
|
-
|
|
549
|
+
def update(self,
|
|
550
|
+
new_core_attr_subset_candidate,
|
|
551
|
+
skip_validation_and_conversion=\
|
|
552
|
+
_default_skip_validation_and_conversion):
|
|
553
|
+
super().update(new_core_attr_subset_candidate,
|
|
554
|
+
skip_validation_and_conversion)
|
|
563
555
|
self.execute_post_core_attrs_update_actions()
|
|
564
556
|
|
|
565
557
|
return None
|
|
@@ -583,8 +575,7 @@ class Circle(BaseShape):
|
|
|
583
575
|
|
|
584
576
|
|
|
585
577
|
def _check_and_convert_semi_major_axis(params):
|
|
586
|
-
|
|
587
|
-
obj_name = current_func_name[19:]
|
|
578
|
+
obj_name = "semi_major_axis"
|
|
588
579
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
589
580
|
semi_major_axis = czekitout.convert.to_positive_float(**kwargs)
|
|
590
581
|
|
|
@@ -593,7 +584,7 @@ def _check_and_convert_semi_major_axis(params):
|
|
|
593
584
|
|
|
594
585
|
|
|
595
586
|
def _pre_serialize_semi_major_axis(semi_major_axis):
|
|
596
|
-
obj_to_pre_serialize =
|
|
587
|
+
obj_to_pre_serialize = semi_major_axis
|
|
597
588
|
serializable_rep = obj_to_pre_serialize
|
|
598
589
|
|
|
599
590
|
return serializable_rep
|
|
@@ -608,11 +599,12 @@ def _de_pre_serialize_semi_major_axis(serializable_rep):
|
|
|
608
599
|
|
|
609
600
|
|
|
610
601
|
def _check_and_convert_eccentricity(params):
|
|
611
|
-
|
|
612
|
-
obj_name = current_func_name[19:]
|
|
602
|
+
obj_name = "eccentricity"
|
|
613
603
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
614
604
|
eccentricity = czekitout.convert.to_nonnegative_float(**kwargs)
|
|
615
605
|
|
|
606
|
+
current_func_name = "_check_and_convert_eccentricity"
|
|
607
|
+
|
|
616
608
|
if eccentricity > 1:
|
|
617
609
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
618
610
|
raise ValueError(err_msg)
|
|
@@ -622,7 +614,7 @@ def _check_and_convert_eccentricity(params):
|
|
|
622
614
|
|
|
623
615
|
|
|
624
616
|
def _pre_serialize_eccentricity(eccentricity):
|
|
625
|
-
obj_to_pre_serialize =
|
|
617
|
+
obj_to_pre_serialize = eccentricity
|
|
626
618
|
serializable_rep = obj_to_pre_serialize
|
|
627
619
|
|
|
628
620
|
return serializable_rep
|
|
@@ -637,8 +629,7 @@ def _de_pre_serialize_eccentricity(serializable_rep):
|
|
|
637
629
|
|
|
638
630
|
|
|
639
631
|
def _check_and_convert_rotation_angle(params):
|
|
640
|
-
|
|
641
|
-
obj_name = current_func_name[19:]
|
|
632
|
+
obj_name = "rotation_angle"
|
|
642
633
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
643
634
|
rotation_angle = czekitout.convert.to_float(**kwargs) % (2*np.pi)
|
|
644
635
|
|
|
@@ -647,7 +638,7 @@ def _check_and_convert_rotation_angle(params):
|
|
|
647
638
|
|
|
648
639
|
|
|
649
640
|
def _pre_serialize_rotation_angle(rotation_angle):
|
|
650
|
-
obj_to_pre_serialize =
|
|
641
|
+
obj_to_pre_serialize = rotation_angle
|
|
651
642
|
serializable_rep = obj_to_pre_serialize
|
|
652
643
|
|
|
653
644
|
return serializable_rep
|
|
@@ -798,8 +789,12 @@ class Ellipse(BaseShape):
|
|
|
798
789
|
|
|
799
790
|
|
|
800
791
|
|
|
801
|
-
def update(self,
|
|
802
|
-
|
|
792
|
+
def update(self,
|
|
793
|
+
new_core_attr_subset_candidate,
|
|
794
|
+
skip_validation_and_conversion=\
|
|
795
|
+
_default_skip_validation_and_conversion):
|
|
796
|
+
super().update(new_core_attr_subset_candidate,
|
|
797
|
+
skip_validation_and_conversion)
|
|
803
798
|
self.execute_post_core_attrs_update_actions()
|
|
804
799
|
|
|
805
800
|
return None
|
|
@@ -847,8 +842,7 @@ class Ellipse(BaseShape):
|
|
|
847
842
|
|
|
848
843
|
|
|
849
844
|
def _check_and_convert_widths(params):
|
|
850
|
-
|
|
851
|
-
obj_name = current_func_name[19:]
|
|
845
|
+
obj_name = "widths"
|
|
852
846
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
853
847
|
widths = czekitout.convert.to_quadruplet_of_positive_floats(**kwargs)
|
|
854
848
|
|
|
@@ -857,7 +851,7 @@ def _check_and_convert_widths(params):
|
|
|
857
851
|
|
|
858
852
|
|
|
859
853
|
def _pre_serialize_widths(widths):
|
|
860
|
-
obj_to_pre_serialize =
|
|
854
|
+
obj_to_pre_serialize = widths
|
|
861
855
|
serializable_rep = obj_to_pre_serialize
|
|
862
856
|
|
|
863
857
|
return serializable_rep
|
|
@@ -872,8 +866,7 @@ def _de_pre_serialize_widths(serializable_rep):
|
|
|
872
866
|
|
|
873
867
|
|
|
874
868
|
def _check_and_convert_val_at_center(params):
|
|
875
|
-
|
|
876
|
-
obj_name = current_func_name[19:]
|
|
869
|
+
obj_name = "val_at_center"
|
|
877
870
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
878
871
|
val_at_center = czekitout.convert.to_float(**kwargs)
|
|
879
872
|
|
|
@@ -882,7 +875,7 @@ def _check_and_convert_val_at_center(params):
|
|
|
882
875
|
|
|
883
876
|
|
|
884
877
|
def _pre_serialize_val_at_center(val_at_center):
|
|
885
|
-
obj_to_pre_serialize =
|
|
878
|
+
obj_to_pre_serialize = val_at_center
|
|
886
879
|
serializable_rep = obj_to_pre_serialize
|
|
887
880
|
|
|
888
881
|
return serializable_rep
|
|
@@ -897,8 +890,7 @@ def _de_pre_serialize_val_at_center(serializable_rep):
|
|
|
897
890
|
|
|
898
891
|
|
|
899
892
|
def _check_and_convert_functional_form(params):
|
|
900
|
-
|
|
901
|
-
obj_name = current_func_name[19:]
|
|
893
|
+
obj_name = "functional_form"
|
|
902
894
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
903
895
|
functional_form = czekitout.convert.to_str_from_str_like(**kwargs)
|
|
904
896
|
|
|
@@ -913,7 +905,7 @@ def _check_and_convert_functional_form(params):
|
|
|
913
905
|
|
|
914
906
|
|
|
915
907
|
def _pre_serialize_functional_form(functional_form):
|
|
916
|
-
obj_to_pre_serialize =
|
|
908
|
+
obj_to_pre_serialize = functional_form
|
|
917
909
|
serializable_rep = obj_to_pre_serialize
|
|
918
910
|
|
|
919
911
|
return serializable_rep
|
|
@@ -1110,8 +1102,12 @@ class Peak(BaseShape):
|
|
|
1110
1102
|
|
|
1111
1103
|
|
|
1112
1104
|
|
|
1113
|
-
def update(self,
|
|
1114
|
-
|
|
1105
|
+
def update(self,
|
|
1106
|
+
new_core_attr_subset_candidate,
|
|
1107
|
+
skip_validation_and_conversion=\
|
|
1108
|
+
_default_skip_validation_and_conversion):
|
|
1109
|
+
super().update(new_core_attr_subset_candidate,
|
|
1110
|
+
skip_validation_and_conversion)
|
|
1115
1111
|
self.execute_post_core_attrs_update_actions()
|
|
1116
1112
|
|
|
1117
1113
|
return None
|
|
@@ -1206,8 +1202,7 @@ class Peak(BaseShape):
|
|
|
1206
1202
|
|
|
1207
1203
|
|
|
1208
1204
|
def _check_and_convert_end_pt_1(params):
|
|
1209
|
-
|
|
1210
|
-
obj_name = current_func_name[19:]
|
|
1205
|
+
obj_name = "end_pt_1"
|
|
1211
1206
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1212
1207
|
end_pt_1 = czekitout.convert.to_pair_of_floats(**kwargs)
|
|
1213
1208
|
|
|
@@ -1216,7 +1211,7 @@ def _check_and_convert_end_pt_1(params):
|
|
|
1216
1211
|
|
|
1217
1212
|
|
|
1218
1213
|
def _pre_serialize_end_pt_1(end_pt_1):
|
|
1219
|
-
obj_to_pre_serialize =
|
|
1214
|
+
obj_to_pre_serialize = end_pt_1
|
|
1220
1215
|
serializable_rep = obj_to_pre_serialize
|
|
1221
1216
|
|
|
1222
1217
|
return serializable_rep
|
|
@@ -1231,8 +1226,7 @@ def _de_pre_serialize_end_pt_1(serializable_rep):
|
|
|
1231
1226
|
|
|
1232
1227
|
|
|
1233
1228
|
def _check_and_convert_end_pt_2(params):
|
|
1234
|
-
|
|
1235
|
-
obj_name = current_func_name[19:]
|
|
1229
|
+
obj_name = "end_pt_2"
|
|
1236
1230
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1237
1231
|
end_pt_2 = czekitout.convert.to_pair_of_floats(**kwargs)
|
|
1238
1232
|
|
|
@@ -1241,7 +1235,7 @@ def _check_and_convert_end_pt_2(params):
|
|
|
1241
1235
|
|
|
1242
1236
|
|
|
1243
1237
|
def _pre_serialize_end_pt_2(end_pt_2):
|
|
1244
|
-
obj_to_pre_serialize =
|
|
1238
|
+
obj_to_pre_serialize = end_pt_2
|
|
1245
1239
|
serializable_rep = obj_to_pre_serialize
|
|
1246
1240
|
|
|
1247
1241
|
return serializable_rep
|
|
@@ -1256,8 +1250,7 @@ def _de_pre_serialize_end_pt_2(serializable_rep):
|
|
|
1256
1250
|
|
|
1257
1251
|
|
|
1258
1252
|
def _check_and_convert_width(params):
|
|
1259
|
-
|
|
1260
|
-
obj_name = current_func_name[19:]
|
|
1253
|
+
obj_name = "width"
|
|
1261
1254
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1262
1255
|
width = czekitout.convert.to_positive_float(**kwargs)
|
|
1263
1256
|
|
|
@@ -1266,7 +1259,7 @@ def _check_and_convert_width(params):
|
|
|
1266
1259
|
|
|
1267
1260
|
|
|
1268
1261
|
def _pre_serialize_width(width):
|
|
1269
|
-
obj_to_pre_serialize =
|
|
1262
|
+
obj_to_pre_serialize = width
|
|
1270
1263
|
serializable_rep = obj_to_pre_serialize
|
|
1271
1264
|
|
|
1272
1265
|
return serializable_rep
|
|
@@ -1530,8 +1523,12 @@ class Band(BaseShape):
|
|
|
1530
1523
|
|
|
1531
1524
|
|
|
1532
1525
|
|
|
1533
|
-
def update(self,
|
|
1534
|
-
|
|
1526
|
+
def update(self,
|
|
1527
|
+
new_core_attr_subset_candidate,
|
|
1528
|
+
skip_validation_and_conversion=\
|
|
1529
|
+
_default_skip_validation_and_conversion):
|
|
1530
|
+
super().update(new_core_attr_subset_candidate,
|
|
1531
|
+
skip_validation_and_conversion)
|
|
1535
1532
|
self.execute_post_core_attrs_update_actions()
|
|
1536
1533
|
|
|
1537
1534
|
return None
|
|
@@ -1581,8 +1578,7 @@ class Band(BaseShape):
|
|
|
1581
1578
|
|
|
1582
1579
|
|
|
1583
1580
|
def _check_and_convert_amplitude(params):
|
|
1584
|
-
|
|
1585
|
-
obj_name = current_func_name[19:]
|
|
1581
|
+
obj_name = "amplitude"
|
|
1586
1582
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1587
1583
|
amplitude = czekitout.convert.to_float(**kwargs)
|
|
1588
1584
|
|
|
@@ -1591,7 +1587,7 @@ def _check_and_convert_amplitude(params):
|
|
|
1591
1587
|
|
|
1592
1588
|
|
|
1593
1589
|
def _pre_serialize_amplitude(amplitude):
|
|
1594
|
-
obj_to_pre_serialize =
|
|
1590
|
+
obj_to_pre_serialize = amplitude
|
|
1595
1591
|
serializable_rep = obj_to_pre_serialize
|
|
1596
1592
|
|
|
1597
1593
|
return serializable_rep
|
|
@@ -1606,8 +1602,7 @@ def _de_pre_serialize_amplitude(serializable_rep):
|
|
|
1606
1602
|
|
|
1607
1603
|
|
|
1608
1604
|
def _check_and_convert_wavelength(params):
|
|
1609
|
-
|
|
1610
|
-
obj_name = current_func_name[19:]
|
|
1605
|
+
obj_name = "wavelength"
|
|
1611
1606
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1612
1607
|
wavelength = czekitout.convert.to_positive_float(**kwargs)
|
|
1613
1608
|
|
|
@@ -1616,7 +1611,7 @@ def _check_and_convert_wavelength(params):
|
|
|
1616
1611
|
|
|
1617
1612
|
|
|
1618
1613
|
def _pre_serialize_wavelength(wavelength):
|
|
1619
|
-
obj_to_pre_serialize =
|
|
1614
|
+
obj_to_pre_serialize = wavelength
|
|
1620
1615
|
serializable_rep = obj_to_pre_serialize
|
|
1621
1616
|
|
|
1622
1617
|
return serializable_rep
|
|
@@ -1631,8 +1626,7 @@ def _de_pre_serialize_wavelength(serializable_rep):
|
|
|
1631
1626
|
|
|
1632
1627
|
|
|
1633
1628
|
def _check_and_convert_propagation_direction(params):
|
|
1634
|
-
|
|
1635
|
-
obj_name = current_func_name[19:]
|
|
1629
|
+
obj_name = "propagation_direction"
|
|
1636
1630
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1637
1631
|
propagation_direction = czekitout.convert.to_float(**kwargs) % (2*np.pi)
|
|
1638
1632
|
|
|
@@ -1641,7 +1635,7 @@ def _check_and_convert_propagation_direction(params):
|
|
|
1641
1635
|
|
|
1642
1636
|
|
|
1643
1637
|
def _pre_serialize_propagation_direction(propagation_direction):
|
|
1644
|
-
obj_to_pre_serialize =
|
|
1638
|
+
obj_to_pre_serialize = propagation_direction
|
|
1645
1639
|
serializable_rep = obj_to_pre_serialize
|
|
1646
1640
|
|
|
1647
1641
|
return serializable_rep
|
|
@@ -1656,8 +1650,7 @@ def _de_pre_serialize_propagation_direction(serializable_rep):
|
|
|
1656
1650
|
|
|
1657
1651
|
|
|
1658
1652
|
def _check_and_convert_phase(params):
|
|
1659
|
-
|
|
1660
|
-
obj_name = current_func_name[19:]
|
|
1653
|
+
obj_name = "phase"
|
|
1661
1654
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1662
1655
|
phase = czekitout.convert.to_float(**kwargs)
|
|
1663
1656
|
|
|
@@ -1666,7 +1659,7 @@ def _check_and_convert_phase(params):
|
|
|
1666
1659
|
|
|
1667
1660
|
|
|
1668
1661
|
def _pre_serialize_phase(phase):
|
|
1669
|
-
obj_to_pre_serialize =
|
|
1662
|
+
obj_to_pre_serialize = phase
|
|
1670
1663
|
serializable_rep = obj_to_pre_serialize
|
|
1671
1664
|
|
|
1672
1665
|
return serializable_rep
|
|
@@ -1814,8 +1807,12 @@ class PlaneWave(BaseShape):
|
|
|
1814
1807
|
|
|
1815
1808
|
|
|
1816
1809
|
|
|
1817
|
-
def update(self,
|
|
1818
|
-
|
|
1810
|
+
def update(self,
|
|
1811
|
+
new_core_attr_subset_candidate,
|
|
1812
|
+
skip_validation_and_conversion=\
|
|
1813
|
+
_default_skip_validation_and_conversion):
|
|
1814
|
+
super().update(new_core_attr_subset_candidate,
|
|
1815
|
+
skip_validation_and_conversion)
|
|
1819
1816
|
self.execute_post_core_attrs_update_actions()
|
|
1820
1817
|
|
|
1821
1818
|
return None
|
|
@@ -1835,8 +1832,7 @@ class PlaneWave(BaseShape):
|
|
|
1835
1832
|
|
|
1836
1833
|
|
|
1837
1834
|
def _check_and_convert_midpoint_angle(params):
|
|
1838
|
-
|
|
1839
|
-
obj_name = current_func_name[19:]
|
|
1835
|
+
obj_name = "midpoint_angle"
|
|
1840
1836
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1841
1837
|
midpoint_angle = czekitout.convert.to_float(**kwargs) % (2*np.pi)
|
|
1842
1838
|
|
|
@@ -1845,7 +1841,7 @@ def _check_and_convert_midpoint_angle(params):
|
|
|
1845
1841
|
|
|
1846
1842
|
|
|
1847
1843
|
def _pre_serialize_midpoint_angle(midpoint_angle):
|
|
1848
|
-
obj_to_pre_serialize =
|
|
1844
|
+
obj_to_pre_serialize = midpoint_angle
|
|
1849
1845
|
serializable_rep = obj_to_pre_serialize
|
|
1850
1846
|
|
|
1851
1847
|
return serializable_rep
|
|
@@ -1860,8 +1856,7 @@ def _de_pre_serialize_midpoint_angle(serializable_rep):
|
|
|
1860
1856
|
|
|
1861
1857
|
|
|
1862
1858
|
def _check_and_convert_subtending_angle(params):
|
|
1863
|
-
|
|
1864
|
-
obj_name = current_func_name[19:]
|
|
1859
|
+
obj_name = "subtending_angle"
|
|
1865
1860
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
1866
1861
|
subtending_angle = min(abs(czekitout.convert.to_float(**kwargs)), (2*np.pi))
|
|
1867
1862
|
|
|
@@ -1870,7 +1865,7 @@ def _check_and_convert_subtending_angle(params):
|
|
|
1870
1865
|
|
|
1871
1866
|
|
|
1872
1867
|
def _pre_serialize_subtending_angle(subtending_angle):
|
|
1873
|
-
obj_to_pre_serialize =
|
|
1868
|
+
obj_to_pre_serialize = subtending_angle
|
|
1874
1869
|
serializable_rep = obj_to_pre_serialize
|
|
1875
1870
|
|
|
1876
1871
|
return serializable_rep
|
|
@@ -1885,15 +1880,15 @@ def _de_pre_serialize_subtending_angle(serializable_rep):
|
|
|
1885
1880
|
|
|
1886
1881
|
|
|
1887
1882
|
def _check_and_convert_radial_range(params):
|
|
1888
|
-
|
|
1889
|
-
char_idx = 19
|
|
1890
|
-
obj_name = current_func_name[char_idx:]
|
|
1883
|
+
obj_name = "radial_range"
|
|
1891
1884
|
obj = params[obj_name]
|
|
1892
1885
|
|
|
1893
1886
|
func_alias = czekitout.convert.to_pair_of_positive_floats
|
|
1894
1887
|
kwargs = {"obj": obj, "obj_name": obj_name}
|
|
1895
1888
|
radial_range = func_alias(**kwargs)
|
|
1896
1889
|
|
|
1890
|
+
current_func_name = "_check_and_convert_radial_range"
|
|
1891
|
+
|
|
1897
1892
|
if radial_range[0] >= radial_range[1]:
|
|
1898
1893
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
1899
1894
|
raise ValueError(err_msg)
|
|
@@ -1903,7 +1898,7 @@ def _check_and_convert_radial_range(params):
|
|
|
1903
1898
|
|
|
1904
1899
|
|
|
1905
1900
|
def _pre_serialize_radial_range(radial_range):
|
|
1906
|
-
obj_to_pre_serialize =
|
|
1901
|
+
obj_to_pre_serialize = radial_range
|
|
1907
1902
|
serializable_rep = obj_to_pre_serialize
|
|
1908
1903
|
|
|
1909
1904
|
return serializable_rep
|
|
@@ -2064,8 +2059,12 @@ class Arc(BaseShape):
|
|
|
2064
2059
|
|
|
2065
2060
|
|
|
2066
2061
|
|
|
2067
|
-
def update(self,
|
|
2068
|
-
|
|
2062
|
+
def update(self,
|
|
2063
|
+
new_core_attr_subset_candidate,
|
|
2064
|
+
skip_validation_and_conversion=\
|
|
2065
|
+
_default_skip_validation_and_conversion):
|
|
2066
|
+
super().update(new_core_attr_subset_candidate,
|
|
2067
|
+
skip_validation_and_conversion)
|
|
2069
2068
|
self.execute_post_core_attrs_update_actions()
|
|
2070
2069
|
|
|
2071
2070
|
return None
|
|
@@ -2100,8 +2099,7 @@ class Arc(BaseShape):
|
|
|
2100
2099
|
|
|
2101
2100
|
|
|
2102
2101
|
def _check_and_convert_radial_reference_pt(params):
|
|
2103
|
-
|
|
2104
|
-
obj_name = current_func_name[19:]
|
|
2102
|
+
obj_name = "radial_reference_pt"
|
|
2105
2103
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2106
2104
|
radial_reference_pt = czekitout.convert.to_pair_of_floats(**kwargs)
|
|
2107
2105
|
|
|
@@ -2110,7 +2108,7 @@ def _check_and_convert_radial_reference_pt(params):
|
|
|
2110
2108
|
|
|
2111
2109
|
|
|
2112
2110
|
def _pre_serialize_radial_reference_pt(radial_reference_pt):
|
|
2113
|
-
obj_to_pre_serialize =
|
|
2111
|
+
obj_to_pre_serialize = radial_reference_pt
|
|
2114
2112
|
serializable_rep = obj_to_pre_serialize
|
|
2115
2113
|
|
|
2116
2114
|
return serializable_rep
|
|
@@ -2125,12 +2123,13 @@ def _de_pre_serialize_radial_reference_pt(serializable_rep):
|
|
|
2125
2123
|
|
|
2126
2124
|
|
|
2127
2125
|
def _check_and_convert_radial_amplitudes(params):
|
|
2128
|
-
|
|
2129
|
-
obj_name = current_func_name[19:]
|
|
2126
|
+
obj_name = "radial_amplitudes"
|
|
2130
2127
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2131
2128
|
func_alias = czekitout.convert.to_tuple_of_nonnegative_floats
|
|
2132
2129
|
radial_amplitudes = func_alias(**kwargs)
|
|
2133
2130
|
|
|
2131
|
+
current_func_name = "_check_and_convert_radial_amplitudes"
|
|
2132
|
+
|
|
2134
2133
|
num_radial_amplitudes = len(radial_amplitudes)
|
|
2135
2134
|
if num_radial_amplitudes == 0:
|
|
2136
2135
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
@@ -2146,7 +2145,7 @@ def _check_and_convert_radial_amplitudes(params):
|
|
|
2146
2145
|
|
|
2147
2146
|
|
|
2148
2147
|
def _pre_serialize_radial_amplitudes(radial_amplitudes):
|
|
2149
|
-
obj_to_pre_serialize =
|
|
2148
|
+
obj_to_pre_serialize = radial_amplitudes
|
|
2150
2149
|
serializable_rep = obj_to_pre_serialize
|
|
2151
2150
|
|
|
2152
2151
|
return serializable_rep
|
|
@@ -2161,8 +2160,7 @@ def _de_pre_serialize_radial_amplitudes(serializable_rep):
|
|
|
2161
2160
|
|
|
2162
2161
|
|
|
2163
2162
|
def _check_and_convert_radial_phases(params):
|
|
2164
|
-
|
|
2165
|
-
obj_name = current_func_name[19:]
|
|
2163
|
+
obj_name = "radial_phases"
|
|
2166
2164
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2167
2165
|
radial_phases = czekitout.convert.to_tuple_of_floats(**kwargs)
|
|
2168
2166
|
radial_phases = tuple(radial_phase%(2*np.pi)
|
|
@@ -2174,6 +2172,8 @@ def _check_and_convert_radial_phases(params):
|
|
|
2174
2172
|
num_radial_phases = len(radial_phases)
|
|
2175
2173
|
num_radial_amplitudes = len(radial_amplitudes)
|
|
2176
2174
|
|
|
2175
|
+
current_func_name = "_check_and_convert_radial_phases"
|
|
2176
|
+
|
|
2177
2177
|
if num_radial_phases+1 != num_radial_amplitudes:
|
|
2178
2178
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
2179
2179
|
raise ValueError(err_msg)
|
|
@@ -2183,7 +2183,7 @@ def _check_and_convert_radial_phases(params):
|
|
|
2183
2183
|
|
|
2184
2184
|
|
|
2185
2185
|
def _pre_serialize_radial_phases(radial_phases):
|
|
2186
|
-
obj_to_pre_serialize =
|
|
2186
|
+
obj_to_pre_serialize = radial_phases
|
|
2187
2187
|
serializable_rep = obj_to_pre_serialize
|
|
2188
2188
|
|
|
2189
2189
|
return serializable_rep
|
|
@@ -2264,7 +2264,7 @@ class GenericBlob(BaseShape):
|
|
|
2264
2264
|
radial_reference_pt : `array_like` (`float`, shape=(``2``,)), optional
|
|
2265
2265
|
The radial reference point, :math:`\left(u_{x;c;\text{GB}},
|
|
2266
2266
|
u_{y;c;\text{GB}}\right)`.
|
|
2267
|
-
radial_amplitudes : `array_like` (`float`,
|
|
2267
|
+
radial_amplitudes : `array_like` (`float`, ndim=1), optional
|
|
2268
2268
|
The radial amplitudes,
|
|
2269
2269
|
:math:`\left\{ D_{\text{GB};n}\right\} _{n=0}^{N_{\text{GB}}}`.
|
|
2270
2270
|
radial_phases : `array_like` (`float`, shape=(``len(radial_amplitudes)-1``,)), optional
|
|
@@ -2351,8 +2351,12 @@ class GenericBlob(BaseShape):
|
|
|
2351
2351
|
|
|
2352
2352
|
|
|
2353
2353
|
|
|
2354
|
-
def update(self,
|
|
2355
|
-
|
|
2354
|
+
def update(self,
|
|
2355
|
+
new_core_attr_subset_candidate,
|
|
2356
|
+
skip_validation_and_conversion=\
|
|
2357
|
+
_default_skip_validation_and_conversion):
|
|
2358
|
+
super().update(new_core_attr_subset_candidate,
|
|
2359
|
+
skip_validation_and_conversion)
|
|
2356
2360
|
self.execute_post_core_attrs_update_actions()
|
|
2357
2361
|
|
|
2358
2362
|
return None
|
|
@@ -2386,8 +2390,7 @@ class GenericBlob(BaseShape):
|
|
|
2386
2390
|
|
|
2387
2391
|
|
|
2388
2392
|
def _check_and_convert_principal_quantum_number(params):
|
|
2389
|
-
|
|
2390
|
-
obj_name = current_func_name[19:]
|
|
2393
|
+
obj_name = "principal_quantum_number"
|
|
2391
2394
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2392
2395
|
principal_quantum_number = czekitout.convert.to_positive_int(**kwargs)
|
|
2393
2396
|
|
|
@@ -2396,7 +2399,7 @@ def _check_and_convert_principal_quantum_number(params):
|
|
|
2396
2399
|
|
|
2397
2400
|
|
|
2398
2401
|
def _pre_serialize_principal_quantum_number(principal_quantum_number):
|
|
2399
|
-
obj_to_pre_serialize =
|
|
2402
|
+
obj_to_pre_serialize = principal_quantum_number
|
|
2400
2403
|
serializable_rep = obj_to_pre_serialize
|
|
2401
2404
|
|
|
2402
2405
|
return serializable_rep
|
|
@@ -2411,14 +2414,15 @@ def _de_pre_serialize_principal_quantum_number(serializable_rep):
|
|
|
2411
2414
|
|
|
2412
2415
|
|
|
2413
2416
|
def _check_and_convert_azimuthal_quantum_number(params):
|
|
2414
|
-
|
|
2415
|
-
obj_name = current_func_name[19:]
|
|
2417
|
+
obj_name = "azimuthal_quantum_number"
|
|
2416
2418
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2417
2419
|
azimuthal_quantum_number = czekitout.convert.to_nonnegative_int(**kwargs)
|
|
2418
2420
|
|
|
2419
2421
|
principal_quantum_number = \
|
|
2420
2422
|
_check_and_convert_principal_quantum_number(params)
|
|
2421
2423
|
|
|
2424
|
+
current_func_name = "_check_and_convert_azimuthal_quantum_number"
|
|
2425
|
+
|
|
2422
2426
|
if azimuthal_quantum_number >= principal_quantum_number:
|
|
2423
2427
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
2424
2428
|
raise ValueError(err_msg)
|
|
@@ -2428,7 +2432,7 @@ def _check_and_convert_azimuthal_quantum_number(params):
|
|
|
2428
2432
|
|
|
2429
2433
|
|
|
2430
2434
|
def _pre_serialize_azimuthal_quantum_number(azimuthal_quantum_number):
|
|
2431
|
-
obj_to_pre_serialize =
|
|
2435
|
+
obj_to_pre_serialize = azimuthal_quantum_number
|
|
2432
2436
|
serializable_rep = obj_to_pre_serialize
|
|
2433
2437
|
|
|
2434
2438
|
return serializable_rep
|
|
@@ -2443,14 +2447,15 @@ def _de_pre_serialize_azimuthal_quantum_number(serializable_rep):
|
|
|
2443
2447
|
|
|
2444
2448
|
|
|
2445
2449
|
def _check_and_convert_magnetic_quantum_number(params):
|
|
2446
|
-
|
|
2447
|
-
obj_name = current_func_name[19:]
|
|
2450
|
+
obj_name = "magnetic_quantum_number"
|
|
2448
2451
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2449
2452
|
magnetic_quantum_number = czekitout.convert.to_int(**kwargs)
|
|
2450
2453
|
|
|
2451
2454
|
azimuthal_quantum_number = \
|
|
2452
2455
|
_check_and_convert_azimuthal_quantum_number(params)
|
|
2453
2456
|
|
|
2457
|
+
current_func_name = "_check_and_convert_magnetic_quantum_number"
|
|
2458
|
+
|
|
2454
2459
|
if abs(magnetic_quantum_number) > azimuthal_quantum_number:
|
|
2455
2460
|
err_msg = globals()[current_func_name+"_err_msg_1"]
|
|
2456
2461
|
raise ValueError(err_msg)
|
|
@@ -2460,7 +2465,7 @@ def _check_and_convert_magnetic_quantum_number(params):
|
|
|
2460
2465
|
|
|
2461
2466
|
|
|
2462
2467
|
def _pre_serialize_magnetic_quantum_number(magnetic_quantum_number):
|
|
2463
|
-
obj_to_pre_serialize =
|
|
2468
|
+
obj_to_pre_serialize = magnetic_quantum_number
|
|
2464
2469
|
serializable_rep = obj_to_pre_serialize
|
|
2465
2470
|
|
|
2466
2471
|
return serializable_rep
|
|
@@ -2475,8 +2480,7 @@ def _de_pre_serialize_magnetic_quantum_number(serializable_rep):
|
|
|
2475
2480
|
|
|
2476
2481
|
|
|
2477
2482
|
def _check_and_convert_effective_size(params):
|
|
2478
|
-
|
|
2479
|
-
obj_name = current_func_name[19:]
|
|
2483
|
+
obj_name = "effective_size"
|
|
2480
2484
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2481
2485
|
effective_size = czekitout.convert.to_positive_float(**kwargs)
|
|
2482
2486
|
|
|
@@ -2485,7 +2489,7 @@ def _check_and_convert_effective_size(params):
|
|
|
2485
2489
|
|
|
2486
2490
|
|
|
2487
2491
|
def _pre_serialize_effective_size(effective_size):
|
|
2488
|
-
obj_to_pre_serialize =
|
|
2492
|
+
obj_to_pre_serialize = effective_size
|
|
2489
2493
|
serializable_rep = obj_to_pre_serialize
|
|
2490
2494
|
|
|
2491
2495
|
return serializable_rep
|
|
@@ -2500,8 +2504,7 @@ def _de_pre_serialize_effective_size(serializable_rep):
|
|
|
2500
2504
|
|
|
2501
2505
|
|
|
2502
2506
|
def _check_and_convert_renormalization_factor(params):
|
|
2503
|
-
|
|
2504
|
-
obj_name = current_func_name[19:]
|
|
2507
|
+
obj_name = "renormalization_factor"
|
|
2505
2508
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
2506
2509
|
renormalization_factor = czekitout.convert.to_float(**kwargs)
|
|
2507
2510
|
|
|
@@ -2510,7 +2513,7 @@ def _check_and_convert_renormalization_factor(params):
|
|
|
2510
2513
|
|
|
2511
2514
|
|
|
2512
2515
|
def _pre_serialize_renormalization_factor(renormalization_factor):
|
|
2513
|
-
obj_to_pre_serialize =
|
|
2516
|
+
obj_to_pre_serialize = renormalization_factor
|
|
2514
2517
|
serializable_rep = obj_to_pre_serialize
|
|
2515
2518
|
|
|
2516
2519
|
return serializable_rep
|
|
@@ -2809,8 +2812,12 @@ class Orbital(BaseShape):
|
|
|
2809
2812
|
|
|
2810
2813
|
|
|
2811
2814
|
|
|
2812
|
-
def update(self,
|
|
2813
|
-
|
|
2815
|
+
def update(self,
|
|
2816
|
+
new_core_attr_subset_candidate,
|
|
2817
|
+
skip_validation_and_conversion=\
|
|
2818
|
+
_default_skip_validation_and_conversion):
|
|
2819
|
+
super().update(new_core_attr_subset_candidate,
|
|
2820
|
+
skip_validation_and_conversion)
|
|
2814
2821
|
self.execute_post_core_attrs_update_actions()
|
|
2815
2822
|
|
|
2816
2823
|
return None
|
|
@@ -2932,9 +2939,7 @@ class Orbital(BaseShape):
|
|
|
2932
2939
|
|
|
2933
2940
|
|
|
2934
2941
|
def _check_and_convert_bg_ellipse(params):
|
|
2935
|
-
|
|
2936
|
-
char_idx = 19
|
|
2937
|
-
obj_name = current_func_name[char_idx:]
|
|
2942
|
+
obj_name = "bg_ellipse"
|
|
2938
2943
|
obj = params[obj_name]
|
|
2939
2944
|
|
|
2940
2945
|
accepted_types = (Ellipse, Circle, type(None))
|
|
@@ -2953,7 +2958,7 @@ def _check_and_convert_bg_ellipse(params):
|
|
|
2953
2958
|
|
|
2954
2959
|
|
|
2955
2960
|
def _pre_serialize_bg_ellipse(bg_ellipse):
|
|
2956
|
-
obj_to_pre_serialize =
|
|
2961
|
+
obj_to_pre_serialize = bg_ellipse
|
|
2957
2962
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
2958
2963
|
|
|
2959
2964
|
return serializable_rep
|
|
@@ -2971,9 +2976,7 @@ def _de_pre_serialize_bg_ellipse(serializable_rep):
|
|
|
2971
2976
|
|
|
2972
2977
|
|
|
2973
2978
|
def _check_and_convert_fg_ellipse(params):
|
|
2974
|
-
|
|
2975
|
-
char_idx = 19
|
|
2976
|
-
obj_name = current_func_name[char_idx:]
|
|
2979
|
+
obj_name = "fg_ellipse"
|
|
2977
2980
|
obj = params[obj_name]
|
|
2978
2981
|
|
|
2979
2982
|
accepted_types = (Ellipse, Circle, type(None))
|
|
@@ -2992,7 +2995,7 @@ def _check_and_convert_fg_ellipse(params):
|
|
|
2992
2995
|
|
|
2993
2996
|
|
|
2994
2997
|
def _pre_serialize_fg_ellipse(fg_ellipse):
|
|
2995
|
-
obj_to_pre_serialize =
|
|
2998
|
+
obj_to_pre_serialize = fg_ellipse
|
|
2996
2999
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
2997
3000
|
|
|
2998
3001
|
return serializable_rep
|
|
@@ -3119,8 +3122,12 @@ class Lune(BaseShape):
|
|
|
3119
3122
|
|
|
3120
3123
|
|
|
3121
3124
|
|
|
3122
|
-
def update(self,
|
|
3123
|
-
|
|
3125
|
+
def update(self,
|
|
3126
|
+
new_core_attr_subset_candidate,
|
|
3127
|
+
skip_validation_and_conversion=\
|
|
3128
|
+
_default_skip_validation_and_conversion):
|
|
3129
|
+
super().update(new_core_attr_subset_candidate,
|
|
3130
|
+
skip_validation_and_conversion)
|
|
3124
3131
|
self.execute_post_core_attrs_update_actions()
|
|
3125
3132
|
|
|
3126
3133
|
return None
|
|
@@ -3137,9 +3144,7 @@ class Lune(BaseShape):
|
|
|
3137
3144
|
|
|
3138
3145
|
|
|
3139
3146
|
def _check_and_convert_support(params):
|
|
3140
|
-
|
|
3141
|
-
char_idx = 19
|
|
3142
|
-
obj_name = current_func_name[char_idx:]
|
|
3147
|
+
obj_name = "support"
|
|
3143
3148
|
obj = params[obj_name]
|
|
3144
3149
|
|
|
3145
3150
|
accepted_types = (Circle, Ellipse, Band, Arc, GenericBlob, Lune, type(None))
|
|
@@ -3158,7 +3163,7 @@ def _check_and_convert_support(params):
|
|
|
3158
3163
|
|
|
3159
3164
|
|
|
3160
3165
|
def _pre_serialize_support(support):
|
|
3161
|
-
obj_to_pre_serialize =
|
|
3166
|
+
obj_to_pre_serialize = support
|
|
3162
3167
|
serializable_rep = obj_to_pre_serialize.pre_serialize()
|
|
3163
3168
|
|
|
3164
3169
|
return serializable_rep
|
|
@@ -3184,9 +3189,7 @@ def _de_pre_serialize_support(serializable_rep):
|
|
|
3184
3189
|
|
|
3185
3190
|
|
|
3186
3191
|
def _check_and_convert_intra_support_shapes(params):
|
|
3187
|
-
|
|
3188
|
-
char_idx = 19
|
|
3189
|
-
obj_name = current_func_name[char_idx:]
|
|
3192
|
+
obj_name = "intra_support_shapes"
|
|
3190
3193
|
obj = params[obj_name]
|
|
3191
3194
|
|
|
3192
3195
|
accepted_types = (Circle,
|
|
@@ -3200,6 +3203,8 @@ def _check_and_convert_intra_support_shapes(params):
|
|
|
3200
3203
|
Lune,
|
|
3201
3204
|
NonuniformBoundedShape)
|
|
3202
3205
|
|
|
3206
|
+
current_func_name = "_check_and_convert_intra_support_shapes"
|
|
3207
|
+
|
|
3203
3208
|
try:
|
|
3204
3209
|
for intra_support_shape in obj:
|
|
3205
3210
|
kwargs = {"obj": intra_support_shape,
|
|
@@ -3217,7 +3222,7 @@ def _check_and_convert_intra_support_shapes(params):
|
|
|
3217
3222
|
|
|
3218
3223
|
|
|
3219
3224
|
def _pre_serialize_intra_support_shapes(intra_support_shapes):
|
|
3220
|
-
obj_to_pre_serialize =
|
|
3225
|
+
obj_to_pre_serialize = intra_support_shapes
|
|
3221
3226
|
serializable_rep = tuple()
|
|
3222
3227
|
for elem in obj_to_pre_serialize:
|
|
3223
3228
|
serializable_rep += (elem.pre_serialize(),)
|
|
@@ -3375,8 +3380,12 @@ class NonuniformBoundedShape(BaseShape):
|
|
|
3375
3380
|
|
|
3376
3381
|
|
|
3377
3382
|
|
|
3378
|
-
def update(self,
|
|
3379
|
-
|
|
3383
|
+
def update(self,
|
|
3384
|
+
new_core_attr_subset_candidate,
|
|
3385
|
+
skip_validation_and_conversion=\
|
|
3386
|
+
_default_skip_validation_and_conversion):
|
|
3387
|
+
super().update(new_core_attr_subset_candidate,
|
|
3388
|
+
skip_validation_and_conversion)
|
|
3380
3389
|
self.execute_post_core_attrs_update_actions()
|
|
3381
3390
|
|
|
3382
3391
|
return None
|
fakecbed/tds.py
CHANGED
|
@@ -8,12 +8,6 @@
|
|
|
8
8
|
## Load libraries/packages/modules ##
|
|
9
9
|
#####################################
|
|
10
10
|
|
|
11
|
-
# For accessing attributes of functions.
|
|
12
|
-
import inspect
|
|
13
|
-
|
|
14
|
-
# For randomly selecting items in dictionaries.
|
|
15
|
-
import random
|
|
16
|
-
|
|
17
11
|
# For performing deep copies.
|
|
18
12
|
import copy
|
|
19
13
|
|
|
@@ -50,13 +44,13 @@ __all__ = ["Model"]
|
|
|
50
44
|
|
|
51
45
|
|
|
52
46
|
def _check_and_convert_peaks(params):
|
|
53
|
-
|
|
54
|
-
char_idx = 19
|
|
55
|
-
obj_name = current_func_name[char_idx:]
|
|
47
|
+
obj_name = "peaks"
|
|
56
48
|
obj = params[obj_name]
|
|
57
49
|
|
|
58
50
|
accepted_types = (fakecbed.shapes.Peak,)
|
|
59
51
|
|
|
52
|
+
current_func_name = "_check_and_convert_peaks"
|
|
53
|
+
|
|
60
54
|
try:
|
|
61
55
|
for peak in obj:
|
|
62
56
|
kwargs = {"obj": peak,
|
|
@@ -74,7 +68,7 @@ def _check_and_convert_peaks(params):
|
|
|
74
68
|
|
|
75
69
|
|
|
76
70
|
def _pre_serialize_peaks(peaks):
|
|
77
|
-
obj_to_pre_serialize =
|
|
71
|
+
obj_to_pre_serialize = peaks
|
|
78
72
|
serializable_rep = tuple()
|
|
79
73
|
for elem in obj_to_pre_serialize:
|
|
80
74
|
serializable_rep += (elem.pre_serialize(),)
|
|
@@ -94,8 +88,7 @@ def _de_pre_serialize_peaks(serializable_rep):
|
|
|
94
88
|
|
|
95
89
|
|
|
96
90
|
def _check_and_convert_constant_bg(params):
|
|
97
|
-
|
|
98
|
-
obj_name = current_func_name[19:]
|
|
91
|
+
obj_name = "constant_bg"
|
|
99
92
|
kwargs = {"obj": params[obj_name], "obj_name": obj_name}
|
|
100
93
|
constant_bg = czekitout.convert.to_nonnegative_float(**kwargs)
|
|
101
94
|
|
|
@@ -104,7 +97,7 @@ def _check_and_convert_constant_bg(params):
|
|
|
104
97
|
|
|
105
98
|
|
|
106
99
|
def _pre_serialize_constant_bg(constant_bg):
|
|
107
|
-
obj_to_pre_serialize =
|
|
100
|
+
obj_to_pre_serialize = constant_bg
|
|
108
101
|
serializable_rep = obj_to_pre_serialize
|
|
109
102
|
|
|
110
103
|
return serializable_rep
|
|
@@ -234,8 +227,12 @@ class Model(fakecbed.shapes.BaseShape):
|
|
|
234
227
|
|
|
235
228
|
|
|
236
229
|
|
|
237
|
-
def update(self,
|
|
238
|
-
|
|
230
|
+
def update(self,
|
|
231
|
+
new_core_attr_subset_candidate,
|
|
232
|
+
skip_validation_and_conversion=\
|
|
233
|
+
_default_skip_validation_and_conversion):
|
|
234
|
+
super().update(new_core_attr_subset_candidate,
|
|
235
|
+
skip_validation_and_conversion)
|
|
239
236
|
self.execute_post_core_attrs_update_actions()
|
|
240
237
|
|
|
241
238
|
return None
|
fakecbed/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: fakecbed
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A Python library for generating quickly images that imitate convergent beam electron diffraction patterns.
|
|
5
5
|
Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://mrfitzpa.github.io/fakecbed
|
|
@@ -21,7 +21,7 @@ Classifier: Natural Language :: English
|
|
|
21
21
|
Requires-Python: >=3.8
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: distoptica>=0.
|
|
24
|
+
Requires-Dist: distoptica>=0.3.0
|
|
25
25
|
Requires-Dist: hyperspy[all]
|
|
26
26
|
Provides-Extra: tests
|
|
27
27
|
Requires-Dist: pytest-cov; extra == "tests"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
|
|
2
|
+
fakecbed/discretized.py,sha256=bM_K0VJtSTxlIUdbsbPl2eiC6jJjoLn2y2iYy1XvBZE,97939
|
|
3
|
+
fakecbed/shapes.py,sha256=TiqJBZI4JZib0Q6zfO0e-dh7ACjYhvAYUvEtIedoo74,116471
|
|
4
|
+
fakecbed/tds.py,sha256=mk5359ErIhdpCoTdHq9r1-foKb8t3qCOHqNoabx3bQw,8066
|
|
5
|
+
fakecbed/version.py,sha256=MxUhzLJIZQfEpDTTcKSxciTGrMLd5v2VmMlHa2HGeo0,411
|
|
6
|
+
fakecbed-0.2.1.dist-info/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
|
|
7
|
+
fakecbed-0.2.1.dist-info/METADATA,sha256=Oee7NOEdAU8tX0G00o0EiVf-ldtnubLkivCBYCq_2RY,3006
|
|
8
|
+
fakecbed-0.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
fakecbed-0.2.1.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
|
|
10
|
+
fakecbed-0.2.1.dist-info/RECORD,,
|
fakecbed-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
fakecbed/__init__.py,sha256=iP73WNV_HZgxiVUVdesbJqlrhDGESooh1hlBs8kox9M,1342
|
|
2
|
-
fakecbed/discretized.py,sha256=h2V_TtBIIvLMi7mp1uNKym3Dzuu8a-_tM0TJGB_-sng,98492
|
|
3
|
-
fakecbed/shapes.py,sha256=T7XXbEDR7k9ue0pZmruEjDVHjR6jR28bOyg_BrxtK_I,117095
|
|
4
|
-
fakecbed/tds.py,sha256=YlY0GPp-LlosZprs4S7YW1VJVpuJRPkDsCjDSv5julI,8160
|
|
5
|
-
fakecbed/version.py,sha256=IMl2Pr_Sy4LVRKy_Sm4CdwUl1Gryous6ncL96EMYsnM,411
|
|
6
|
-
fakecbed-0.1.0.dist-info/LICENSE,sha256=N0P3pKtRMvfb64jmgJdlerg3TnS0a2QC776AzPsbZIg,35128
|
|
7
|
-
fakecbed-0.1.0.dist-info/METADATA,sha256=wMET77_MGYFIKmn-lgxE88x9K8npvVqLxXjx18rlH7I,3006
|
|
8
|
-
fakecbed-0.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
9
|
-
fakecbed-0.1.0.dist-info/top_level.txt,sha256=l0jL8P0CjRiCSznYLnq7riaAnOmYaV3zjjjIJx9vjSQ,9
|
|
10
|
-
fakecbed-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|