ararpy 0.2.3__tar.gz → 0.2.5__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.
- {ararpy-0.2.3 → ararpy-0.2.5}/PKG-INFO +1 -1
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/__init__.py +2 -20
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/arr.py +5 -2
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/arr_file.py +1 -1
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/raw_file.py +37 -34
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/basic.py +11 -5
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/corr.py +8 -5
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/initial.py +27 -8
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/plots.py +248 -203
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/sample.py +3 -2
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/style.py +10 -4
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/table.py +66 -32
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy.egg-info/PKG-INFO +1 -1
- {ararpy-0.2.3 → ararpy-0.2.5}/setup.py +1 -1
- {ararpy-0.2.3 → ararpy-0.2.5}/LICENSE +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/README.md +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Check arr.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Granite Cooling History.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Plot temperature calibration.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Show MDD results.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Show all Kfs age spectra.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Show random walk results.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/Example - Tc calculation.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/__init__.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/age.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/basic.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/corr.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/err.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/histogram.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/isochron.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/jvalue.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/plot.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/raw_funcs.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/regression.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/calc/spectra.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/022_VU124-M11a.ahd +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/20WHA0103.age +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/22WHA0078.xls +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/22WHA0433.age +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/22WHA0433.arr +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/22WHA0433.full.xls +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/AHD.input-filter +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/ArAr.calc +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/ArArCALC.age +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/NGX-600.TXT +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/NGX-XLS.input-filter +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/S01-239.csv +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/WH01.irra +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/WHA.pdf +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/raw_example.xls +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/examples/sample-default.smp +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/__init__.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/basic.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/calc_file.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/new_file.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/files/xls.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/__init__.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/calculation.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/consts.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/diffusion_funcs.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/export.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/info.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/json.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/smp/raw.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/test.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/thermo/__init__.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/thermo/arrhenius.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/thermo/atomic_level_random_walk.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy/thermo/basic.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy.egg-info/SOURCES.txt +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy.egg-info/dependency_links.txt +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy.egg-info/requires.txt +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/ararpy.egg-info/top_level.txt +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/setup.cfg +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/tests/test.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/tests/test2.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/tests/test_error_correlation.py +0 -0
- {ararpy-0.2.3 → ararpy-0.2.5}/tests/test_regression_methods.py +0 -0
|
@@ -16,10 +16,10 @@ from . import calc, smp, files, thermo, test
|
|
|
16
16
|
""" Information """
|
|
17
17
|
|
|
18
18
|
name = 'ararpy'
|
|
19
|
-
version = '0.2.
|
|
19
|
+
version = '0.2.5'
|
|
20
20
|
__version__ = version
|
|
21
21
|
full_version = version
|
|
22
|
-
last_update = '2026-01-
|
|
22
|
+
last_update = '2026-01-08'
|
|
23
23
|
|
|
24
24
|
""" ArArPy Functions """
|
|
25
25
|
|
|
@@ -97,24 +97,6 @@ Sample.set_params = smp.basic.set_params
|
|
|
97
97
|
Sample.set_info = lambda _smp, info: setattr(_smp, 'Info', smp.basic.update_plot_from_dict(_smp.Info, info))
|
|
98
98
|
|
|
99
99
|
Sample.recalculate = lambda _smp, *args, **kwargs: smp.calculation.recalculate(_smp, *args, **kwargs)
|
|
100
|
-
Sample.plot_init = lambda _smp: smp.calculation.recalculate(
|
|
101
|
-
_smp, re_plot=True, isIsochron=False, isInit=True, isPlateau=False)
|
|
102
|
-
Sample.plot_isochron = lambda _smp, **kwargs: smp.calculation.recalculate(
|
|
103
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, **kwargs)
|
|
104
|
-
Sample.plot_age_plateau = lambda _smp: smp.calculation.recalculate(
|
|
105
|
-
_smp, re_plot=True, isIsochron=False, isInit=False, isPlateau=True)
|
|
106
|
-
Sample.plot_normal = lambda _smp: smp.calculation.recalculate(
|
|
107
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_2'])
|
|
108
|
-
Sample.plot_inverse = lambda _smp: smp.calculation.recalculate(
|
|
109
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_3'])
|
|
110
|
-
Sample.plot_cl_1 = lambda _smp: smp.calculation.recalculate(
|
|
111
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_4'])
|
|
112
|
-
Sample.plot_cl_2 = lambda _smp: smp.calculation.recalculate(
|
|
113
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_5'])
|
|
114
|
-
Sample.plot_cl_3 = lambda _smp: smp.calculation.recalculate(
|
|
115
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_6'])
|
|
116
|
-
Sample.plot_3D = lambda _smp: smp.calculation.recalculate(
|
|
117
|
-
_smp, re_plot=True, isIsochron=True, isInit=False, isPlateau=False, figures=['figure_7'])
|
|
118
100
|
|
|
119
101
|
Sample.to_excel = lambda _smp, file_path, *args, **kwargs: smp.export.to_excel(_smp, file_path=file_path, *args, **kwargs)
|
|
120
102
|
|
|
@@ -311,7 +311,10 @@ def multi_append(a, *args):
|
|
|
311
311
|
|
|
312
312
|
"""
|
|
313
313
|
for arg in args:
|
|
314
|
-
a
|
|
314
|
+
if isinstance(a, list):
|
|
315
|
+
a.append(arg)
|
|
316
|
+
if isinstance(a, np.ndarray):
|
|
317
|
+
a = np.append(a, arg)
|
|
315
318
|
return a
|
|
316
319
|
|
|
317
320
|
|
|
@@ -351,7 +354,7 @@ def create_arr(shape: tuple):
|
|
|
351
354
|
|
|
352
355
|
"""
|
|
353
356
|
if len(shape) == 1:
|
|
354
|
-
return []
|
|
357
|
+
return [0 for i in range(shape[0])]
|
|
355
358
|
return [create_arr(shape[1:]) for i in range(shape[0])]
|
|
356
359
|
|
|
357
360
|
|
|
@@ -27,7 +27,7 @@ def save(file_path, sample):
|
|
|
27
27
|
str, file name
|
|
28
28
|
"""
|
|
29
29
|
if not file_path.endswith(".arr"):
|
|
30
|
-
file_path = os.path.join(file_path, f"{sample.Info.
|
|
30
|
+
file_path = os.path.join(file_path, f"{sample.Info.experiment.name}.arr")
|
|
31
31
|
with open(file_path, 'wb') as f:
|
|
32
32
|
f.write(pickle.dumps(sample))
|
|
33
33
|
# with open(file_path, 'w') as f:
|
|
@@ -411,39 +411,42 @@ def get_sample_info(file_contents: list, index_list: list, default="", base: Uni
|
|
|
411
411
|
"""
|
|
412
412
|
sample_info = DEFAULT_SAMPLE_INFO.copy()
|
|
413
413
|
sample_info.update({
|
|
414
|
-
"ExpName": get_item(file_contents, index_list[0:3], default=default, base=base)
|
|
415
|
-
"StepName": get_item(file_contents, index_list[3:6], default=default, base=base)
|
|
416
|
-
"StepType": get_item(file_contents, index_list[6:9], default=default, base=base)
|
|
417
|
-
"StepLabel": get_item(file_contents, index_list[9:12], default=default, base=base)
|
|
418
|
-
"ZeroYear": get_item(file_contents, index_list[12:15], default=default, base=base)
|
|
419
|
-
"ZeroHour": get_item(file_contents, index_list[15:18], default=default, base=base)
|
|
420
|
-
"ZeroMon": get_item(file_contents, index_list[18:21], default=default, base=base)
|
|
421
|
-
"ZeroMin": get_item(file_contents, index_list[21:24], default=default, base=base)
|
|
422
|
-
"ZeroDay": get_item(file_contents, index_list[24:27], default=default, base=base)
|
|
423
|
-
"ZeroSec": get_item(file_contents, index_list[27:30], default=default, base=base)
|
|
424
|
-
"SmpName": get_item(file_contents, index_list[30:33], default=default, base=base)
|
|
425
|
-
"SmpLoc": get_item(file_contents, index_list[33:36], default=default, base=base)
|
|
426
|
-
"SmpMatr": get_item(file_contents, index_list[36:39], default=default, base=base)
|
|
427
|
-
"ExpType": get_item(file_contents, index_list[39:42], default=default, base=base)
|
|
428
|
-
"SmpWeight": get_item(file_contents, index_list[42:45], default=default, base=base)
|
|
429
|
-
"Stepunit": get_item(file_contents, index_list[45:48], default=default, base=base)
|
|
430
|
-
"HeatingTime": get_item(file_contents, index_list[48:51], default=default, base=base)
|
|
431
|
-
"InstrName": get_item(file_contents, index_list[51:54], default=default, base=base)
|
|
432
|
-
"Researcher": get_item(file_contents, index_list[54:57], default=default, base=base)
|
|
433
|
-
"Analyst": get_item(file_contents, index_list[57:60], default=default, base=base)
|
|
434
|
-
"Lab": get_item(file_contents, index_list[60:63], default=default, base=base)
|
|
435
|
-
"Jv": get_item(file_contents, index_list[63:66], default=default, base=base)
|
|
436
|
-
"Jsig": get_item(file_contents, index_list[66:69], default=default, base=base)
|
|
437
|
-
"MDF": get_item(file_contents, index_list[69:72], default=default, base=base)
|
|
438
|
-
"MDFSig": get_item(file_contents, index_list[72:75], default=default, base=base)
|
|
439
|
-
"CalcName": get_item(file_contents, index_list[75:78], default=default, base=base)
|
|
440
|
-
"IrraName": get_item(file_contents, index_list[78:81], default=default, base=base)
|
|
441
|
-
"IrraLabel": get_item(file_contents, index_list[81:84], default=default, base=base)
|
|
442
|
-
"IrraPosH": get_item(file_contents, index_list[84:87], default=default, base=base)
|
|
443
|
-
"IrraPosX": get_item(file_contents, index_list[87:90], default=default, base=base)
|
|
444
|
-
"IrraPosY": get_item(file_contents, index_list[90:93], default=default, base=base)
|
|
445
|
-
"StdName": get_item(file_contents, index_list[93:96], default=default, base=base)
|
|
446
|
-
"StdAge": get_item(file_contents, index_list[96:99], default=default, base=base)
|
|
447
|
-
"StdAgeSig": get_item(file_contents, index_list[99:102], default=default, base=base)
|
|
414
|
+
"ExpName": get_item(file_contents, index_list[0:3], default=default, base=base),
|
|
415
|
+
"StepName": get_item(file_contents, index_list[3:6], default=default, base=base),
|
|
416
|
+
"StepType": get_item(file_contents, index_list[6:9], default=default, base=base),
|
|
417
|
+
"StepLabel": get_item(file_contents, index_list[9:12], default=default, base=base),
|
|
418
|
+
"ZeroYear": get_item(file_contents, index_list[12:15], default=default, base=base),
|
|
419
|
+
"ZeroHour": get_item(file_contents, index_list[15:18], default=default, base=base),
|
|
420
|
+
"ZeroMon": get_item(file_contents, index_list[18:21], default=default, base=base),
|
|
421
|
+
"ZeroMin": get_item(file_contents, index_list[21:24], default=default, base=base),
|
|
422
|
+
"ZeroDay": get_item(file_contents, index_list[24:27], default=default, base=base),
|
|
423
|
+
"ZeroSec": get_item(file_contents, index_list[27:30], default=default, base=base),
|
|
424
|
+
"SmpName": get_item(file_contents, index_list[30:33], default=default, base=base),
|
|
425
|
+
"SmpLoc": get_item(file_contents, index_list[33:36], default=default, base=base),
|
|
426
|
+
"SmpMatr": get_item(file_contents, index_list[36:39], default=default, base=base),
|
|
427
|
+
"ExpType": get_item(file_contents, index_list[39:42], default=default, base=base),
|
|
428
|
+
"SmpWeight": get_item(file_contents, index_list[42:45], default=default, base=base),
|
|
429
|
+
"Stepunit": get_item(file_contents, index_list[45:48], default=default, base=base),
|
|
430
|
+
"HeatingTime": get_item(file_contents, index_list[48:51], default=default, base=base),
|
|
431
|
+
"InstrName": get_item(file_contents, index_list[51:54], default=default, base=base),
|
|
432
|
+
"Researcher": get_item(file_contents, index_list[54:57], default=default, base=base),
|
|
433
|
+
"Analyst": get_item(file_contents, index_list[57:60], default=default, base=base),
|
|
434
|
+
"Lab": get_item(file_contents, index_list[60:63], default=default, base=base),
|
|
435
|
+
"Jv": get_item(file_contents, index_list[63:66], default=default, base=base),
|
|
436
|
+
"Jsig": get_item(file_contents, index_list[66:69], default=default, base=base),
|
|
437
|
+
"MDF": get_item(file_contents, index_list[69:72], default=default, base=base),
|
|
438
|
+
"MDFSig": get_item(file_contents, index_list[72:75], default=default, base=base),
|
|
439
|
+
"CalcName": get_item(file_contents, index_list[75:78], default=default, base=base),
|
|
440
|
+
"IrraName": get_item(file_contents, index_list[78:81], default=default, base=base),
|
|
441
|
+
"IrraLabel": get_item(file_contents, index_list[81:84], default=default, base=base),
|
|
442
|
+
"IrraPosH": get_item(file_contents, index_list[84:87], default=default, base=base),
|
|
443
|
+
"IrraPosX": get_item(file_contents, index_list[87:90], default=default, base=base),
|
|
444
|
+
"IrraPosY": get_item(file_contents, index_list[90:93], default=default, base=base),
|
|
445
|
+
"StdName": get_item(file_contents, index_list[93:96], default=default, base=base),
|
|
446
|
+
"StdAge": get_item(file_contents, index_list[96:99], default=default, base=base),
|
|
447
|
+
"StdAgeSig": get_item(file_contents, index_list[99:102], default=default, base=base),
|
|
448
448
|
})
|
|
449
|
+
for key, val in sample_info.items():
|
|
450
|
+
if isinstance(val, str):
|
|
451
|
+
sample_info[key] = val.strip()
|
|
449
452
|
return sample_info
|
|
@@ -35,15 +35,16 @@ pd.options.mode.chained_assignment = None # default='warn'
|
|
|
35
35
|
# =======================
|
|
36
36
|
class ParamsInvalid(Exception):
|
|
37
37
|
""" """
|
|
38
|
-
def __init__(self, code, message, context=None):
|
|
38
|
+
def __init__(self, code=400, message="", context=None, fatal=True):
|
|
39
39
|
self.code = code
|
|
40
40
|
self.message = message
|
|
41
41
|
self.context = context or {}
|
|
42
|
+
self.fatal = fatal
|
|
42
43
|
# 调用父类构造函数,确保异常能正常抛出
|
|
43
44
|
super().__init__(f"{self.message}")
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
def validate_params(**kwargs):
|
|
47
|
+
def validate_params(fatal=True, **kwargs):
|
|
47
48
|
|
|
48
49
|
def check(data, dtype, **kwargs):
|
|
49
50
|
k = np.array(data, dtype=dtype)
|
|
@@ -65,7 +66,7 @@ def validate_params(**kwargs):
|
|
|
65
66
|
if not kwargs.get('func')(each):
|
|
66
67
|
raise ValueError
|
|
67
68
|
except (Exception, BaseException) as e:
|
|
68
|
-
raise ValueError(f"
|
|
69
|
+
raise ValueError(f"invalid value, {each}")
|
|
69
70
|
|
|
70
71
|
context = {'names': [], 'classnames': [], 'messages': []}
|
|
71
72
|
for index, (name, content) in enumerate(kwargs.items(), 1):
|
|
@@ -83,7 +84,7 @@ def validate_params(**kwargs):
|
|
|
83
84
|
if not context['names']:
|
|
84
85
|
return True
|
|
85
86
|
else:
|
|
86
|
-
raise ParamsInvalid(400, '. '.join(context['messages']), context)
|
|
87
|
+
raise ParamsInvalid(400, '. '.join(context['messages']), context, fatal=fatal)
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
# =======================
|
|
@@ -268,7 +269,7 @@ def calc_age(ar40ar39=None, params: dict = None, smp: Sample = None, index: list
|
|
|
268
269
|
age_unit_factor = 1
|
|
269
270
|
|
|
270
271
|
# check if using Min equation
|
|
271
|
-
params['Min'] = [
|
|
272
|
+
params['Min'] = [bool(i) for i in params['Min']]
|
|
272
273
|
|
|
273
274
|
idx1 = np.flatnonzero(np.where(params['Min'], True, False)) # True, using Min equation
|
|
274
275
|
idx2 = np.flatnonzero(np.where(params['Min'], False, True)) # False
|
|
@@ -668,6 +669,10 @@ def set_params(smp: Sample, params: Union[List, str], flag: Optional[str] = None
|
|
|
668
669
|
else:
|
|
669
670
|
smp.TotalParam[32] = [item / (3600 * 24 * 365.242) if index in rows else smp.TotalParam[32][index] for index, item in enumerate(stand_time_second)] # stand year
|
|
670
671
|
|
|
672
|
+
smp.Info.irradiation.label = params[-3]
|
|
673
|
+
smp.Info.irradiation.location = params[-2]
|
|
674
|
+
smp.Info.irradiation.info = params[-1]
|
|
675
|
+
|
|
671
676
|
elif flag == 'smp':
|
|
672
677
|
smp.TotalParam[67:71] = remove_none(smp.TotalParam[67:71], params[0:4], rows, n)
|
|
673
678
|
smp.TotalParam[58:67] = remove_none(smp.TotalParam[58:67], params[4:13], rows, n)
|
|
@@ -702,6 +707,7 @@ def get_sequence(smp: Sample):
|
|
|
702
707
|
smp.Info.results.selection[0]['data'] = smp.SelectedSequence1
|
|
703
708
|
smp.Info.results.selection[1]['data'] = smp.SelectedSequence2
|
|
704
709
|
smp.Info.results.selection[2]['data'] = smp.UnselectedSequence
|
|
710
|
+
smp.Info.experiment.step_num = len(smp.SequenceName)
|
|
705
711
|
return ArArBasic(
|
|
706
712
|
size=len(smp.SequenceName), name=smp.SequenceName, value=smp.SequenceValue, unit=smp.SequenceUnit,
|
|
707
713
|
mark=ArArBasic(
|
|
@@ -153,10 +153,13 @@ def corr_decay(sample: Sample):
|
|
|
153
153
|
corrDecay37 = sample.TotalParam[104]
|
|
154
154
|
corrDecay39 = sample.TotalParam[105]
|
|
155
155
|
sample.CorrectedValues = copy.deepcopy(sample.MassDiscrCorrected)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
for idx in range(sample.Info.experiment.step_num):
|
|
157
|
+
if corrDecay37[idx]:
|
|
158
|
+
sample.CorrectedValues[2][idx] = decay_corrected[2][idx]
|
|
159
|
+
sample.CorrectedValues[3][idx] = decay_corrected[3][idx]
|
|
160
|
+
if corrDecay39[idx]:
|
|
161
|
+
sample.CorrectedValues[6][idx] = decay_corrected[6][idx]
|
|
162
|
+
sample.CorrectedValues[7][idx] = decay_corrected[7][idx]
|
|
160
163
|
|
|
161
164
|
data = np.array(sample.CorrectedValues)
|
|
162
165
|
data[1:10:2] = data[1:10:2] = np.abs(np.divide(data[1:10:2], data[0:10:2])) * 100
|
|
@@ -769,7 +772,7 @@ def monte_carlo_f(sample: Sample):
|
|
|
769
772
|
blank_gain_corr=sample.TotalParam[111][i],
|
|
770
773
|
MDF_method=sample.TotalParam[100][i],
|
|
771
774
|
force_to_zero=sample.TotalParam[101][i],
|
|
772
|
-
monte_carlo_size=
|
|
775
|
+
monte_carlo_size=4000,
|
|
773
776
|
)
|
|
774
777
|
|
|
775
778
|
yield res
|
|
@@ -191,7 +191,7 @@ def initial(smp: Sample):
|
|
|
191
191
|
),
|
|
192
192
|
preference=ArArBasic(**PREFERENCE_RES),
|
|
193
193
|
irradiation= ArArBasic(
|
|
194
|
-
label='', pos_h='', pos_x='', pos_y='',
|
|
194
|
+
label='', pos_h='', pos_x='', pos_y='', location='', info=''
|
|
195
195
|
)
|
|
196
196
|
))
|
|
197
197
|
|
|
@@ -234,7 +234,7 @@ def initial(smp: Sample):
|
|
|
234
234
|
))
|
|
235
235
|
setattr(smp, 'TotalParamsTable', Table(
|
|
236
236
|
id='8', name='Total Params', header=samples.TOTAL_PARAMS_HEADERS, decimal_places=decimal_places,
|
|
237
|
-
text_indexes=[0, 1, 2, 30, 31, 33, 34, 61, 100, 103,
|
|
237
|
+
text_indexes=[0, 1, 2, 29, 30, 31, 33, 34, 61, 100, 103, 118],
|
|
238
238
|
# numeric_indexes=list(range(1, 120)),
|
|
239
239
|
))
|
|
240
240
|
|
|
@@ -300,14 +300,18 @@ def check_version(smp: Sample):
|
|
|
300
300
|
-------
|
|
301
301
|
|
|
302
302
|
"""
|
|
303
|
-
if smp.version != samples.VERSION:
|
|
304
|
-
std = initial(Sample())
|
|
305
|
-
basic.get_merged_smp(smp, std)
|
|
306
303
|
|
|
307
304
|
try:
|
|
308
305
|
version = int(smp.version)
|
|
309
306
|
except ValueError:
|
|
310
307
|
return smp
|
|
308
|
+
except AttributeError:
|
|
309
|
+
smp.version = "20240701"
|
|
310
|
+
return check_version(smp)
|
|
311
|
+
|
|
312
|
+
if smp.version != samples.VERSION:
|
|
313
|
+
std = initial(Sample())
|
|
314
|
+
basic.get_merged_smp(smp, std)
|
|
311
315
|
|
|
312
316
|
# 20250328: # Experiment info
|
|
313
317
|
smp.Info.experiment.name = smp.name()
|
|
@@ -328,7 +332,7 @@ def check_version(smp: Sample):
|
|
|
328
332
|
|
|
329
333
|
# 20250404: # Normalization for steps with different J values
|
|
330
334
|
# always check
|
|
331
|
-
if version <
|
|
335
|
+
if version < 99990101:
|
|
332
336
|
doNormalize = True
|
|
333
337
|
v, sv = [], []
|
|
334
338
|
try:
|
|
@@ -359,10 +363,25 @@ def check_version(smp: Sample):
|
|
|
359
363
|
smp.TotalParam[32] = [np.nan for index in range(smp.Info.experiment.step_num)]
|
|
360
364
|
else:
|
|
361
365
|
smp.TotalParam[32] = [item / (3600 * 24 * 365.242) for item in stand_time_second] # stand year
|
|
362
|
-
smp = smp.recalculate(re_table_style=True)
|
|
363
|
-
smp = smp.recalculate(re_set_table=True)
|
|
364
366
|
smp.version = "20251001"
|
|
365
367
|
|
|
368
|
+
# 20251231 change publish table
|
|
369
|
+
if version < 20251231:
|
|
370
|
+
smp.PublishValues = arr.create_arr((len(samples.PUBLISH_TABLE_HEADERS) - 3, smp.Info.experiment.step_num))
|
|
371
|
+
try:
|
|
372
|
+
data = np.array(smp.CorrectedValues)
|
|
373
|
+
data[1:10:2] = np.abs(np.divide(data[1:10:2], data[0:10:2])) * 100
|
|
374
|
+
smp.PublishValues[0:10] = copy.deepcopy(data.tolist())
|
|
375
|
+
smp.PublishValues[10:14] = copy.deepcopy(smp.ApparentAgeValues[0:4])
|
|
376
|
+
smp.PublishValues[14:16] = copy.deepcopy(smp.ApparentAgeValues[6:8])
|
|
377
|
+
except (BaseException, Exception) as e:
|
|
378
|
+
print(f"{type(e).__name__}: {str(e)}")
|
|
379
|
+
pass
|
|
380
|
+
else:
|
|
381
|
+
smp = smp.recalculate(re_table_style=True)
|
|
382
|
+
smp = smp.recalculate(re_set_table=True)
|
|
383
|
+
smp.version = "20251231"
|
|
384
|
+
|
|
366
385
|
return smp
|
|
367
386
|
|
|
368
387
|
|