ararpy 0.1.13__py3-none-any.whl → 0.1.15__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.
- ararpy/argon_diffusion_simulator/__init__.py +12 -0
- ararpy/argon_diffusion_simulator/main.py +631 -0
- ararpy/calc/age.py +2 -2
- ararpy/calc/basic.py +1 -1
- ararpy/calc/corr.py +8 -8
- ararpy/calc/plot.py +3 -3
- ararpy/calc/raw_funcs.py +2 -0
- ararpy/calc/regression.py +0 -5
- ararpy/calc/spectra.py +3 -1
- ararpy/files/calc_file.py +17 -9
- ararpy/smp/corr.py +9 -1
- ararpy/smp/diffusion_funcs.py +34 -12
- ararpy/smp/export.py +620 -374
- ararpy/smp/initial.py +9 -0
- ararpy/smp/json.py +7 -0
- ararpy/smp/plots.py +6 -4
- ararpy/smp/sample.py +11 -7
- {ararpy-0.1.13.dist-info → ararpy-0.1.15.dist-info}/METADATA +10 -2
- {ararpy-0.1.13.dist-info → ararpy-0.1.15.dist-info}/RECORD +22 -20
- {ararpy-0.1.13.dist-info → ararpy-0.1.15.dist-info}/WHEEL +1 -1
- {ararpy-0.1.13.dist-info → ararpy-0.1.15.dist-info}/LICENSE +0 -0
- {ararpy-0.1.13.dist-info → ararpy-0.1.15.dist-info}/top_level.txt +0 -0
ararpy/smp/initial.py
CHANGED
|
@@ -49,6 +49,12 @@ spectra_res_keys = [
|
|
|
49
49
|
SPECTRA_RES = dict(zip(
|
|
50
50
|
spectra_res_keys, [np.nan for i in spectra_res_keys])
|
|
51
51
|
)
|
|
52
|
+
settings_keys = [
|
|
53
|
+
'sigma_level'
|
|
54
|
+
]
|
|
55
|
+
SETTINGS_RES = dict(zip(
|
|
56
|
+
settings_keys, [np.nan for i in settings_keys])
|
|
57
|
+
)
|
|
52
58
|
|
|
53
59
|
|
|
54
60
|
# create sample instance
|
|
@@ -176,8 +182,11 @@ def initial(smp: Sample):
|
|
|
176
182
|
reference=ArArBasic(
|
|
177
183
|
name='REFERENCE', journal='JOURNAL', doi='DOI'
|
|
178
184
|
),
|
|
185
|
+
settings=copy.deepcopy(SETTINGS_RES)
|
|
179
186
|
))
|
|
180
187
|
|
|
188
|
+
smp.Info.settings.update({'sigma_level': 1})
|
|
189
|
+
|
|
181
190
|
# Plots and Tables
|
|
182
191
|
setattr(smp, 'UnknownTable', Table(
|
|
183
192
|
id='1', name='Unknown', header=samples.SAMPLE_INTERCEPT_HEADERS,
|
ararpy/smp/json.py
CHANGED
|
@@ -14,6 +14,7 @@ import json
|
|
|
14
14
|
import numpy as np
|
|
15
15
|
import pandas as pd
|
|
16
16
|
from .sample import Sample, Table, Plot, RawData, Sequence, ArArBasic
|
|
17
|
+
from django.db.models import QuerySet
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def dumps(a):
|
|
@@ -31,6 +32,9 @@ class MyEncoder(json.JSONEncoder):
|
|
|
31
32
|
# np.array
|
|
32
33
|
if isinstance(obj, np.ndarray):
|
|
33
34
|
return obj.tolist()
|
|
35
|
+
# np.array
|
|
36
|
+
if isinstance(obj, QuerySet):
|
|
37
|
+
return list(obj)
|
|
34
38
|
# pd.DataFrame
|
|
35
39
|
if isinstance(obj, pd.DataFrame):
|
|
36
40
|
print(obj)
|
|
@@ -49,6 +53,9 @@ class MyEncoder(json.JSONEncoder):
|
|
|
49
53
|
'is_blank': obj.is_blank(), 'is_unknown': obj.is_unknown(),
|
|
50
54
|
'is_air': obj.is_air()})
|
|
51
55
|
return obj.__dict__
|
|
56
|
+
# Error
|
|
57
|
+
if isinstance(obj, BaseException):
|
|
58
|
+
return obj.args[0]
|
|
52
59
|
if not isinstance(obj, (int, str, list, dict, tuple, float)):
|
|
53
60
|
print(f"Special type, {type(obj) = }, {obj = }")
|
|
54
61
|
return super(MyEncoder, self).default(obj)
|
ararpy/smp/plots.py
CHANGED
|
@@ -434,8 +434,9 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
434
434
|
# Get ages and line data points for each set
|
|
435
435
|
try:
|
|
436
436
|
set1_res, set1_age, set1_data = \
|
|
437
|
-
get_plateau_results(sample, sample.SelectedSequence1, calc_ar40ar39(*ratio_set1, smp=sample))
|
|
437
|
+
get_plateau_results(sample, sample.SelectedSequence1, calc_ar40ar39(*ratio_set1, smp=sample), **kwargs)
|
|
438
438
|
except ValueError:
|
|
439
|
+
# print(traceback.format_exc())
|
|
439
440
|
pass
|
|
440
441
|
# raise ValueError(f"Set 1 Plateau results calculation error.")
|
|
441
442
|
else:
|
|
@@ -444,8 +445,9 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
444
445
|
sample.AgeSpectraPlot.text1.text = "" # 注意和js的配合,js那边根据text是否为空判断是否重新生成文字
|
|
445
446
|
try:
|
|
446
447
|
set2_res, set2_age, set2_data = \
|
|
447
|
-
get_plateau_results(sample, sample.SelectedSequence2, calc_ar40ar39(*ratio_set2, smp=sample))
|
|
448
|
+
get_plateau_results(sample, sample.SelectedSequence2, calc_ar40ar39(*ratio_set2, smp=sample), **kwargs)
|
|
448
449
|
except ValueError:
|
|
450
|
+
# print(traceback.format_exc())
|
|
449
451
|
pass
|
|
450
452
|
# raise ValueError(f"Set 2 Plateau results calculation error.")
|
|
451
453
|
else:
|
|
@@ -579,7 +581,7 @@ def calc_ar40ar39(r, sr, smp):
|
|
|
579
581
|
|
|
580
582
|
|
|
581
583
|
def get_plateau_results(sample: Sample, sequence: list, ar40rar39k: list = None,
|
|
582
|
-
ar39k_percentage: list = None):
|
|
584
|
+
ar39k_percentage: list = None, **kwargs):
|
|
583
585
|
"""
|
|
584
586
|
Get initial ratio re-corrected plateau results
|
|
585
587
|
Parameters
|
|
@@ -613,7 +615,7 @@ def get_plateau_results(sample: Sample, sequence: list, ar40rar39k: list = None,
|
|
|
613
615
|
ar39k_percentage = sample.ApparentAgeValues[7]
|
|
614
616
|
|
|
615
617
|
age = basic.calc_age(ar40ar39=ar40rar39k, smp=sample)[0:2]
|
|
616
|
-
plot_data = calc.spectra.get_data(*age, ar39k_percentage, indices=sequence)
|
|
618
|
+
plot_data = calc.spectra.get_data(*age, ar39k_percentage, indices=sequence, **kwargs)
|
|
617
619
|
f_values = _get_partial(sequence, *ar40rar39k)
|
|
618
620
|
age = _get_partial(sequence, *age)
|
|
619
621
|
sum_ar39k = sum(_get_partial(sequence, ar39k_percentage)[0])
|
ararpy/smp/sample.py
CHANGED
|
@@ -122,9 +122,10 @@ TOTAL_PARAMS_HEADERS = [
|
|
|
122
122
|
'Not Zero', 'Corr Blank', 'Corr Discr', 'Corr \u00B3\u2077Ar Decay', # 103-106
|
|
123
123
|
'Corr \u00B3\u2079Ar Decay', # 107
|
|
124
124
|
'Ca Degassing', 'K Degassing', 'Cl Degassing', 'Trap Degassing', # 108-111
|
|
125
|
-
'Using Min Equation',
|
|
125
|
+
'Using Min Equation', # 112
|
|
126
126
|
# 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
|
|
127
|
-
'
|
|
127
|
+
'Apply Gain Corr to Blanks', # 113
|
|
128
|
+
'', '', # 114-115
|
|
128
129
|
'Auto Plateau Method', # 116 the index includes sequence name and unit
|
|
129
130
|
'Initial Ratio Model', # 117
|
|
130
131
|
'Set1 initial Ratio', # 118
|
|
@@ -235,9 +236,10 @@ TOTAL_PARAMS_SHORT_HEADERS = [
|
|
|
235
236
|
'NotZero', 'CorrBlank', 'CorrDiscr', 'CorrAr37Decay',
|
|
236
237
|
'CorrAr39Decay', # 103-107
|
|
237
238
|
'CaDegassing', 'KDegassing', 'ClDegassing', 'TrapDegassing', # 108-111
|
|
238
|
-
'UsingMin',
|
|
239
|
+
'UsingMin', # 112
|
|
239
240
|
# 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
|
|
240
|
-
'',
|
|
241
|
+
'BlankGainCorr', # 113
|
|
242
|
+
'', '', # 114-115
|
|
241
243
|
'AutoPlateauMethod', # 116 the index includes sequence name and unit
|
|
242
244
|
'InitialRatioModel', # 117
|
|
243
245
|
'Set1InitialRatio', # 118
|
|
@@ -741,7 +743,7 @@ DEFAULT_PLOT_STYLES = {
|
|
|
741
743
|
},
|
|
742
744
|
}
|
|
743
745
|
|
|
744
|
-
VERSION = '
|
|
746
|
+
VERSION = '20250301'
|
|
745
747
|
|
|
746
748
|
NAMED_DICT = {
|
|
747
749
|
"unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
|
|
@@ -843,7 +845,9 @@ class Sample:
|
|
|
843
845
|
# self.__version = '20230827' # using merge smp to update arr version
|
|
844
846
|
# self.__version = '20231116' # change smp parameters
|
|
845
847
|
# self.__version = '20240730' # change parameter table for thermo calculation
|
|
846
|
-
self.__version = '20241028' # gain correction
|
|
848
|
+
# self.__version = '20241028' # gain correction
|
|
849
|
+
# self.__version = '20250102' # gain correction to blanks
|
|
850
|
+
self.__version = '20250301' # error sigma adjustment
|
|
847
851
|
|
|
848
852
|
@property
|
|
849
853
|
def version(self):
|
|
@@ -940,7 +944,7 @@ class Table:
|
|
|
940
944
|
if header is None:
|
|
941
945
|
header = ['']
|
|
942
946
|
if data is None:
|
|
943
|
-
data = [['']]
|
|
947
|
+
data = [['' for i in range(len(header))]]
|
|
944
948
|
if colcount is None:
|
|
945
949
|
colcount = len(header)
|
|
946
950
|
if rowcount is None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: ararpy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.15
|
|
4
4
|
Summary: A project for Ar-Ar geochronology
|
|
5
5
|
Home-page: https://github.com/wuyangchn/ararpy.git
|
|
6
6
|
Author: Yang Wu
|
|
@@ -12,6 +12,14 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.5
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
15
23
|
|
|
16
24
|
# ArArPy
|
|
17
25
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
ararpy/__init__.py,sha256=XKlsgklkzGfvqQkt59y-UST9aVhgCf-eXpEDiaZaynQ,6725
|
|
2
2
|
ararpy/test.py,sha256=4F46-JJ1Ge12HGae0qO44Qc6kiEMHBgn2MsY_5LlHDo,3973
|
|
3
|
+
ararpy/argon_diffusion_simulator/__init__.py,sha256=8VEdUP7sh17lNg6FcRVVK0JynthEsSk_qcTQtwisqU8,229
|
|
4
|
+
ararpy/argon_diffusion_simulator/main.py,sha256=-EN7ndhzVslNctJSaQTn_JwumA6Cnt37yiPxuLtahXQ,25490
|
|
3
5
|
ararpy/calc/__init__.py,sha256=kUjRuLE8TLuKOv3i976RnGJoEMj23QBZDu37LWs81U4,322
|
|
4
|
-
ararpy/calc/age.py,sha256=
|
|
6
|
+
ararpy/calc/age.py,sha256=zaiy_2AgKEe1a-KfZoi6HmrLpyU_aLUuNVmSeJ_X5KQ,5820
|
|
5
7
|
ararpy/calc/arr.py,sha256=w31bn6MXF8I8qPXYo5kI-TfMKCYspx1rZ5g_UpwwSd8,14939
|
|
6
|
-
ararpy/calc/basic.py,sha256=
|
|
7
|
-
ararpy/calc/corr.py,sha256=
|
|
8
|
+
ararpy/calc/basic.py,sha256=QN__j0JrEZA-W29iPAnwT7XtR6PCuvgDptLtyTgGp_k,3236
|
|
9
|
+
ararpy/calc/corr.py,sha256=i0ku_L0dV4Cex0SLZxyDHYML8lF_njA0yfIufX8DXXo,17926
|
|
8
10
|
ararpy/calc/err.py,sha256=63LtprqjemlIb1QGDst4Ggcv5KMSDHdlAIL-nyQs1eA,2691
|
|
9
11
|
ararpy/calc/histogram.py,sha256=0GVbDdsjd91KQ1sa2B7NtZ4KGo0XpRIJapgIrzAwQUo,5777
|
|
10
12
|
ararpy/calc/isochron.py,sha256=ej9G2e68k6yszonWHsLcEubh3TA7eh1upTJP_X0ttAA,5726
|
|
11
13
|
ararpy/calc/jvalue.py,sha256=zHUhJ1iYe5mPrY95mGYxoUPAp7hwu4coUgiHKiruKfM,1138
|
|
12
|
-
ararpy/calc/plot.py,sha256=
|
|
13
|
-
ararpy/calc/raw_funcs.py,sha256=
|
|
14
|
-
ararpy/calc/regression.py,sha256=
|
|
15
|
-
ararpy/calc/spectra.py,sha256=
|
|
14
|
+
ararpy/calc/plot.py,sha256=iWxPYIaT0OmJBiho7X9wFY7m-QrvYexu6nWHp24T_VY,1962
|
|
15
|
+
ararpy/calc/raw_funcs.py,sha256=UC01lvA6GyZ5FJv43jgoUULAFoLnZJMxeSa0BeVFCAM,2637
|
|
16
|
+
ararpy/calc/regression.py,sha256=Xes0rvIX5a9e_gje3n6iTXYbNtRuZZMKRcADp2b-5Dw,40091
|
|
17
|
+
ararpy/calc/spectra.py,sha256=_Q23eP9necHlaCoHf3_UfW1N3JmVZj5rcWFro8GS-CA,1995
|
|
16
18
|
ararpy/examples/022_VU124-M11a.ahd,sha256=3m0Gd-ZObou3KsnRNFMf77QwzT1Uz3nu3vA33Sqeyng,5414
|
|
17
19
|
ararpy/examples/20WHA0103.age,sha256=cT-a4d7Wt77aotx6v0G47vulY_TZIcZUcaVHB3pqTPM,380416
|
|
18
20
|
ararpy/examples/22WHA0078.xls,sha256=1XAAHmIhuswwZ3toCT-qTLrYzqXNDYWGjDyCTI3xaMY,2611729
|
|
@@ -35,7 +37,7 @@ ararpy/examples/sample-default.smp,sha256=YNkoQGgPrsL_fXS7ZHxfRtLQWekCDqT9czS6vB
|
|
|
35
37
|
ararpy/files/__init__.py,sha256=l5B5ZQ01WdtvjjN0aMkyAFNgpwANdM_1I0tQbqnRuEY,69
|
|
36
38
|
ararpy/files/arr_file.py,sha256=KqksGlEA6nmMQofTgi7v45flscQZVtefxaNCKrV3Am4,837
|
|
37
39
|
ararpy/files/basic.py,sha256=nc7Hgo_qLSkdmtKzZmd5SQ8Jy0dhW46ly4gh-oisUDs,2095
|
|
38
|
-
ararpy/files/calc_file.py,sha256=
|
|
40
|
+
ararpy/files/calc_file.py,sha256=ezKtP2PFSW5W2w6cPY3p4l9VJ4uUPAjc5guHeZxxERA,28303
|
|
39
41
|
ararpy/files/new_file.py,sha256=efblARIBROVLWS2w3-98BxLX5VZ8grRpiTkJFtf_rAk,214
|
|
40
42
|
ararpy/files/raw_file.py,sha256=aVHlebiGpxHGj_z9mrTR-Y2JEivxa4k1MJZ1TFXyMnA,22319
|
|
41
43
|
ararpy/files/xls.py,sha256=8ibT4ZRY2grK34ikKm1pDmlWFlVTgDL7vSMO6mphzrY,702
|
|
@@ -44,19 +46,19 @@ ararpy/smp/__init__.py,sha256=k6_fa27UJsQK7K7oC5GYlwMo6l0Xd8af3QtOrZz2XJk,478
|
|
|
44
46
|
ararpy/smp/basic.py,sha256=Jufv_4zXO1-XbmwM4UUrvZsp4tRGD05ec-035u8CiEs,21533
|
|
45
47
|
ararpy/smp/calculation.py,sha256=LCFJWjLVLEKEQ5b7RFUIxsMahEzgLdodW4kCYXV5Z34,2919
|
|
46
48
|
ararpy/smp/consts.py,sha256=XIdjdz8cYxspG2jMnoItdlUsxr3hKbNFJjMZJh1bpzw,393
|
|
47
|
-
ararpy/smp/corr.py,sha256=
|
|
48
|
-
ararpy/smp/diffusion_funcs.py,sha256=
|
|
49
|
-
ararpy/smp/export.py,sha256=
|
|
49
|
+
ararpy/smp/corr.py,sha256=ga3OsRSwPeLd4VV7DbOjZ3T4qlOYweUZhFfAM9MkM5s,25484
|
|
50
|
+
ararpy/smp/diffusion_funcs.py,sha256=_8SchTD27CAS8SmQVDoXJscTRB7M-BqtpASEgg_izBM,175748
|
|
51
|
+
ararpy/smp/export.py,sha256=4RtoDvItQ2ysWXY78gS_tDocTgSY9ftP9Vb-YKrOGQI,107646
|
|
50
52
|
ararpy/smp/info.py,sha256=iKUELm-BuUduDlJKC1d8tKKNHbwwbNmhUg2pi6bcBvA,489
|
|
51
|
-
ararpy/smp/initial.py,sha256=
|
|
52
|
-
ararpy/smp/json.py,sha256=
|
|
53
|
-
ararpy/smp/plots.py,sha256=
|
|
53
|
+
ararpy/smp/initial.py,sha256=J30NYDpccRJ1TSP6Fl_nHSZ12J6PDMtIic-iT5fSlC4,15580
|
|
54
|
+
ararpy/smp/json.py,sha256=BTZCjVN0aj9epc700nwkYEYMKN2lHBYo-pLmtnz5oHY,2300
|
|
55
|
+
ararpy/smp/plots.py,sha256=jYvi4oNEdI1r4371Wh3cB6vkL-1rrzgbyClK87Uw6YM,31617
|
|
54
56
|
ararpy/smp/raw.py,sha256=51n-rrbW2FqeZHQyevuG7iObPLGvIBzTe414QDVM1FE,6523
|
|
55
|
-
ararpy/smp/sample.py,sha256=
|
|
57
|
+
ararpy/smp/sample.py,sha256=2aqyszY81GXzbZWRKip9BEaeYaFV32-gxmhue3gCvfs,55429
|
|
56
58
|
ararpy/smp/style.py,sha256=NZwTeodhtHBBdCyjvupF64nh2B5EDdMHzlT8oE360zg,6746
|
|
57
59
|
ararpy/smp/table.py,sha256=yNr4PLxbH4ezeUXpKBxLjRfq4RuYiW-G3sMWFDtjlVM,6802
|
|
58
|
-
ararpy-0.1.
|
|
59
|
-
ararpy-0.1.
|
|
60
|
-
ararpy-0.1.
|
|
61
|
-
ararpy-0.1.
|
|
62
|
-
ararpy-0.1.
|
|
60
|
+
ararpy-0.1.15.dist-info/LICENSE,sha256=cvG5t_C1qY_zUyJI7sNOa7gCArdngNPaOrfujl2LYuc,1085
|
|
61
|
+
ararpy-0.1.15.dist-info/METADATA,sha256=_zC9lSFdJP2rU_a6zTZlmrz231SNMTGtLR0iMHnLR1E,24513
|
|
62
|
+
ararpy-0.1.15.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
63
|
+
ararpy-0.1.15.dist-info/top_level.txt,sha256=9iTpsPCYuRYq09yQTk9d2lqB8JtTEOmbN-IcGB-K3vY,7
|
|
64
|
+
ararpy-0.1.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|