ararpy 0.1.13__py3-none-any.whl → 0.1.14__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/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
@@ -59,7 +59,7 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
59
59
  # Initialization, apply age spectra data and isochron plot data
60
60
  if isInit:
61
61
  try:
62
- initial_plot_data(sample)
62
+ initial_plot_data(sample, **kwargs)
63
63
  except (Exception, BaseException):
64
64
  # print(traceback.format_exc())
65
65
  pass
@@ -80,7 +80,7 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
80
80
  # Recalculate plateaus
81
81
  if isPlateau:
82
82
  try:
83
- recalc_plateaus(sample)
83
+ recalc_plateaus(sample, **kwargs)
84
84
  except (Exception, BaseException):
85
85
  # print(traceback.format_exc())
86
86
  pass
@@ -89,7 +89,7 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
89
89
  # =======================
90
90
  # Initialize plot data
91
91
  # =======================
92
- def initial_plot_data(sample: Sample):
92
+ def initial_plot_data(sample: Sample, **kwargs):
93
93
  """
94
94
  Assign initial data for plots
95
95
  Parameters
@@ -136,7 +136,7 @@ def initial_plot_data(sample: Sample):
136
136
  )
137
137
  try:
138
138
  sample.AgeSpectraPlot.data = calc.spectra.get_data(
139
- *sample.ApparentAgeValues[2:4], sample.ApparentAgeValues[7])
139
+ *sample.ApparentAgeValues[2:4], sample.ApparentAgeValues[7], **kwargs)
140
140
  sample.AgeSpectraPlot.data = calc.arr.transpose(sample.AgeSpectraPlot.data)
141
141
  except (Exception, BaseException):
142
142
  print(traceback.format_exc())
@@ -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
- '', '', '', # 112-115
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
- '', '', '', # 112-115
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 = '20241028'
746
+ VERSION = '20250102'
745
747
 
746
748
  NAMED_DICT = {
747
749
  "unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
@@ -843,7 +845,8 @@ 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
847
850
 
848
851
  @property
849
852
  def version(self):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ararpy
3
- Version: 0.1.13
3
+ Version: 0.1.14
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=TaULfYZCKkbotIxt0wMuRlSCg0OuG0sy1V4fdzY8VMk,21920
3
5
  ararpy/calc/__init__.py,sha256=kUjRuLE8TLuKOv3i976RnGJoEMj23QBZDu37LWs81U4,322
4
6
  ararpy/calc/age.py,sha256=CUex9UxZbYinl9ypd7o86R3VRQFzahku3gW__fBeoss,5811
5
7
  ararpy/calc/arr.py,sha256=w31bn6MXF8I8qPXYo5kI-TfMKCYspx1rZ5g_UpwwSd8,14939
6
8
  ararpy/calc/basic.py,sha256=0K0rbm9GpDpEZjQ1r7N-6w-dU-S3UzByOTrefLmjT0c,3231
7
- ararpy/calc/corr.py,sha256=wCkpUZDQ3VFxfmy0eG6ehkIuMjKRfTNfW8ozH3i1lQc,17928
9
+ ararpy/calc/corr.py,sha256=mFo_j2YGUS4U3dwIkcYO6QrffcODvnzS_IgB6m2qeK4,17979
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=v-vJwciJIhKrdXKWAUZbYslez0zBrIa6awI-DopmRZg,1956
13
- ararpy/calc/raw_funcs.py,sha256=UNNdehMBZxrb8QpFsWXDXvDYae6y5veygI_St_hjp_U,2558
14
- ararpy/calc/regression.py,sha256=dpyEiU1MKSn3lzcSF3A4AcQlS01dmhNvhatJvVQ9ZrY,40207
15
- ararpy/calc/spectra.py,sha256=iBhuQ03PyIKHbAQSexx3fZ6ZYaxM6P_uMyWdUeeMck4,1936
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
@@ -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=5dzCI92xg8kL12wA5GLx4kV7YZnwP9g3xGErKZ--bGE,24998
48
- ararpy/smp/diffusion_funcs.py,sha256=mYK7czYaEZqd18UBI1CjyBb6b7cnjnq7slGXAU-A7ZQ,174874
49
- ararpy/smp/export.py,sha256=UTC71CdkintOp5jHspzcs_rTSeI7chvwFnx-bXtrTDw,97173
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
53
  ararpy/smp/initial.py,sha256=nZNrV4fv_PlNXYfqqIOOOkcQjnSOTLymVpJyJ9d_QtM,15359
52
- ararpy/smp/json.py,sha256=Y7xoTZczSTrvVHlhfLmpu-zoxgLw9MFn2lgRYkjgHTY,2079
53
- ararpy/smp/plots.py,sha256=bM4ofS12NedBUXXleEy7-xcK9C8svVuSrTXYmeiMY3k,31495
54
+ ararpy/smp/json.py,sha256=BTZCjVN0aj9epc700nwkYEYMKN2lHBYo-pLmtnz5oHY,2300
55
+ ararpy/smp/plots.py,sha256=AuL-cUU9hdzTOGsf764c-nCyhnq0k8Mv4MTGs2Eb0IU,31657
54
56
  ararpy/smp/raw.py,sha256=51n-rrbW2FqeZHQyevuG7iObPLGvIBzTe414QDVM1FE,6523
55
- ararpy/smp/sample.py,sha256=3POkIxVXiCkZqa4ocePC76690umMa-7zYEM-iiEF7Cc,55192
57
+ ararpy/smp/sample.py,sha256=w_ev8lXgpU7A7dIH-uVhteuL6UG4GXJZNp6LdB8yR-Y,55336
56
58
  ararpy/smp/style.py,sha256=NZwTeodhtHBBdCyjvupF64nh2B5EDdMHzlT8oE360zg,6746
57
59
  ararpy/smp/table.py,sha256=yNr4PLxbH4ezeUXpKBxLjRfq4RuYiW-G3sMWFDtjlVM,6802
58
- ararpy-0.1.13.dist-info/LICENSE,sha256=cvG5t_C1qY_zUyJI7sNOa7gCArdngNPaOrfujl2LYuc,1085
59
- ararpy-0.1.13.dist-info/METADATA,sha256=Fcxg6Sb9jDsFq2zlBT6iGPxgam-sNRFLgBapjUbzYck,24331
60
- ararpy-0.1.13.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
61
- ararpy-0.1.13.dist-info/top_level.txt,sha256=9iTpsPCYuRYq09yQTk9d2lqB8JtTEOmbN-IcGB-K3vY,7
62
- ararpy-0.1.13.dist-info/RECORD,,
60
+ ararpy-0.1.14.dist-info/LICENSE,sha256=cvG5t_C1qY_zUyJI7sNOa7gCArdngNPaOrfujl2LYuc,1085
61
+ ararpy-0.1.14.dist-info/METADATA,sha256=ei5CYPYIF-nGHQrn3BvfqpzDcGy79ekVX2N1Ra9dcjM,24513
62
+ ararpy-0.1.14.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
63
+ ararpy-0.1.14.dist-info/top_level.txt,sha256=9iTpsPCYuRYq09yQTk9d2lqB8JtTEOmbN-IcGB-K3vY,7
64
+ ararpy-0.1.14.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5