ararpy 0.1.198__tar.gz → 0.1.199__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.
Files changed (74) hide show
  1. {ararpy-0.1.198 → ararpy-0.1.199}/PKG-INFO +1 -1
  2. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/__init__.py +1 -1
  3. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/arr.py +5 -4
  4. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/corr.py +4 -4
  5. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/jvalue.py +1 -1
  6. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/plot.py +5 -2
  7. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/basic.py +71 -14
  8. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/corr.py +4 -5
  9. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/initial.py +12 -3
  10. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/plots.py +103 -76
  11. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/sample.py +39 -6
  12. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/style.py +23 -16
  13. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy.egg-info/PKG-INFO +1 -1
  14. {ararpy-0.1.198 → ararpy-0.1.199}/setup.py +1 -1
  15. {ararpy-0.1.198 → ararpy-0.1.199}/LICENSE +0 -0
  16. {ararpy-0.1.198 → ararpy-0.1.199}/README.md +0 -0
  17. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/__init__.py +0 -0
  18. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/age.py +0 -0
  19. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/basic.py +0 -0
  20. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/err.py +0 -0
  21. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/histogram.py +0 -0
  22. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/isochron.py +0 -0
  23. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/raw_funcs.py +0 -0
  24. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/regression.py +0 -0
  25. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/calc/spectra.py +0 -0
  26. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/022_VU124-M11a.ahd +0 -0
  27. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/20WHA0103.age +0 -0
  28. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/22WHA0078.xls +0 -0
  29. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/22WHA0433.age +0 -0
  30. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/22WHA0433.arr +0 -0
  31. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/22WHA0433.full.xls +0 -0
  32. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
  33. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/AHD.input-filter +0 -0
  34. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/ArAr.calc +0 -0
  35. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/ArArCALC.age +0 -0
  36. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
  37. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/NGX-600.TXT +0 -0
  38. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/NGX-XLS.input-filter +0 -0
  39. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
  40. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/S01-239.csv +0 -0
  41. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/WH01.irra +0 -0
  42. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/WHA.pdf +0 -0
  43. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/raw_example.xls +0 -0
  44. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/examples/sample-default.smp +0 -0
  45. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/__init__.py +0 -0
  46. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/arr_file.py +0 -0
  47. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/basic.py +0 -0
  48. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/calc_file.py +0 -0
  49. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/new_file.py +0 -0
  50. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/raw_file.py +0 -0
  51. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/files/xls.py +0 -0
  52. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
  53. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/__init__.py +0 -0
  54. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/calculation.py +0 -0
  55. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/consts.py +0 -0
  56. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/diffusion_funcs.py +0 -0
  57. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/export.py +0 -0
  58. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/info.py +0 -0
  59. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/json.py +0 -0
  60. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/raw.py +0 -0
  61. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/smp/table.py +0 -0
  62. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/test.py +0 -0
  63. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/thermo/__init__.py +0 -0
  64. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/thermo/arrhenius.py +0 -0
  65. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/thermo/atomic_level_random_walk.py +0 -0
  66. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy/thermo/basic.py +0 -0
  67. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy.egg-info/SOURCES.txt +0 -0
  68. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy.egg-info/dependency_links.txt +0 -0
  69. {ararpy-0.1.198 → ararpy-0.1.199}/ararpy.egg-info/top_level.txt +0 -0
  70. {ararpy-0.1.198 → ararpy-0.1.199}/setup.cfg +0 -0
  71. {ararpy-0.1.198 → ararpy-0.1.199}/tests/test.py +0 -0
  72. {ararpy-0.1.198 → ararpy-0.1.199}/tests/test2.py +0 -0
  73. {ararpy-0.1.198 → ararpy-0.1.199}/tests/test_error_correlation.py +0 -0
  74. {ararpy-0.1.198 → ararpy-0.1.199}/tests/test_regression_methods.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ararpy
3
- Version: 0.1.198
3
+ Version: 0.1.199
4
4
  Summary: A project for Ar-Ar geochronology
5
5
  Home-page: https://github.com/wuyangchn/ararpy.git
6
6
  Author: Yang Wu
@@ -16,7 +16,7 @@ from . import calc, smp, files, thermo, test
16
16
  """ Information """
17
17
 
18
18
  name = 'ararpy'
19
- version = '0.1.198'
19
+ version = '0.1.199'
20
20
  __version__ = version
21
21
  full_version = version
22
22
  last_update = '2024-03-28'
@@ -67,10 +67,11 @@ def div(a, b):
67
67
  n = np.shape([a, b])[-1]
68
68
  k0, k1 = [], []
69
69
  for i in range(n):
70
- k0.append(np.divide(a[0][i], b[0][i]))
71
- k1.append(
72
- (np.divide(a[1][i] ** 2, b[0][i] ** 2) +
73
- np.divide(a[0][i] ** 2 * b[1][i] ** 2, b[0][i] ** 4)) ** .5)
70
+ try:
71
+ k0.append(np.divide(a[0][i], b[0][i]))
72
+ k1.append((np.divide(a[1][i] ** 2, b[0][i] ** 2) + np.divide(a[0][i] ** 2 * b[1][i] ** 2, b[0][i] ** 4)) ** .5)
73
+ except TypeError as e:
74
+ raise TypeError(f"a = {a[0][i]}, b = {b[0][i]}, {e}")
74
75
  return [k0, k1]
75
76
 
76
77
 
@@ -72,18 +72,18 @@ def mdf(rm: float, srm: float, m1: float, m2: float, ra: float = 298.56,
72
72
  v3 = err.div((np.log(ra / rm), v1), (np.log(ratio_m), v2))
73
73
  k4 = err.div((np.log(ra / rm) / np.log(ratio_m), v3), (m1, sm1))
74
74
  except Exception:
75
- k3, k4 = "Null", "Null"
75
+ k3, k4 = 0, 0
76
76
  # pow
77
77
  try:
78
78
  k5 = pow((ra / rm), (1 / delta_m)) # Renne2009, B.D. Turrin2010
79
79
  k6 = err.pow((ra / rm, err.div((ra, sra), (rm, srm))),
80
80
  (1 / delta_m, err.div((1, 0), (delta_m, sdelta_m))))
81
81
  except Exception:
82
- k5, k6 = "Null", "Null"
83
- return k1, k2, k3, k4, k5, k6
82
+ k5, k6 = 0, 0
83
+ return k1, k2, k2, k2, k3, k4, k4, k4, k5, k6, k6, k6
84
84
  else:
85
85
  mdf_line_2 = (rm / ra - 1) / delta_m # Ryu et al., 2013
86
- return mdf_line_2, 0, 0, 0, 0, 0
86
+ return mdf_line_2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
87
87
 
88
88
 
89
89
  def discr(a0: list, e0: list, mdf: list, smdf: list, m: list, m40: list,
@@ -36,4 +36,4 @@ def j_value(age, sage, r, sr, f, rsf):
36
36
  v2 = sage ** 2 * (f * np.exp(f * age) / r) ** 2
37
37
  v3 = sr ** 2 * ((1 - np.exp(f * age)) / r ** 2) ** 2
38
38
  k1 = np.sqrt(v1 + v2 + v3)
39
- return k0, k1
39
+ return k0, k1, k1, k1
@@ -39,8 +39,11 @@ def get_axis_scale(data: list, count=6, increment=None, extra_count=0, min_inter
39
39
  """
40
40
  if len(data) == 0:
41
41
  return 0, 1, 5, 0.2 # Default return
42
- _max = float(np.ma.masked_invalid(data).max())
43
- _min = float(np.ma.masked_invalid(data).min())
42
+ _max = np.ma.masked_invalid(data).max()
43
+ _min = np.ma.masked_invalid(data).min()
44
+ if isinstance(_max, np.ma.core.MaskedConstant) or isinstance(_min, np.ma.core.MaskedConstant):
45
+ return 0, 1, 5, 0.2 # Default return
46
+ _max = float(_max); _min = float(_min)
44
47
  interval = (_max - _min) / count
45
48
  if interval == 0:
46
49
  interval = 10
@@ -59,24 +59,81 @@ def calc_apparent_ages(smp: Sample):
59
59
 
60
60
 
61
61
  def calc_j(ar40ar39=None, params: dict = None, smp: Sample = None, index: list = None):
62
- std_age, std_err = smp.TotalParam[59:61]
63
- r, sr = smp.ApparentAgeValues[0:2] # ar40ar39, error
64
- f, rsf = smp.TotalParam[34:36] # L, sL
65
- j, sj = calc.jvalue.j_value(std_age, std_err, r, sr, f, rsf)
66
- return [j.tolist(), sj.tolist()]
62
+ params_index_dict = {
63
+ 34: 'L', 35: 'rsL', 59: 'Age', 60: 'sAge'
64
+ }
65
+ if ar40ar39 is None and smp is not None:
66
+ ar40ar39 = smp.ApparentAgeValues[0:2] # ar40ar39 air, error
67
+ if len(np.shape(ar40ar39)) == 1:
68
+ ar40ar39 = np.reshape(ar40ar39, (2, 1))
69
+ if index is None:
70
+ index = list(range(np.shape(ar40ar39)[-1]))
71
+ if smp is None and params is None:
72
+ raise ValueError(f"Parameters are required for calculating mdf, or it is empty.")
73
+ if params is not None:
74
+ for key, val in params.items():
75
+ if not isinstance(val, list):
76
+ params[key] = list(val)
77
+ if smp is not None:
78
+ try:
79
+ params_from_smp = dict(zip(
80
+ list(params_index_dict.values()),
81
+ [[smp.TotalParam[i][j] for j in index] for i in params_index_dict.keys()]
82
+ ))
83
+ except Exception:
84
+ print(traceback.format_exc())
85
+ raise ValueError(f"Parameters cannot be found in the given sample object")
86
+ if params is not None:
87
+ params_from_smp.update(params)
88
+ params = params_from_smp
89
+
90
+ j = calc.jvalue.j_value(params['Age'], params['sAge'], *ar40ar39, params['L'], params['rsL'])
91
+
92
+ if len(index) == 1:
93
+ return np.array(j).squeeze().tolist()
94
+ else:
95
+ return np.array(j).tolist()
67
96
 
68
97
 
69
98
  def calc_mdf(ar40ar36=None, params: dict = None, smp: Sample = None, index: list = None):
70
- std_air, std_err = smp.TotalParam[93:95]
71
- m36, sm36 = smp.TotalParam[71:73]
72
- m40, sm40 = smp.TotalParam[79:81]
73
- air, sair = smp.ApparentAgeValues[0:2] # ar40ar36 air, error
74
- discrimination_method = smp.TotalParam[100] # L, sL
99
+ params_index_dict = {
100
+ 71: 'M36', 72: 'sM36', 79: 'M40', 80: 'sM40', 93: 'Air', 94: 'sAir', 100: 'Discr'
101
+ }
102
+ if ar40ar36 is None and smp is not None:
103
+ ar40ar36 = smp.ApparentAgeValues[0:2] # ar40ar36 air, error
104
+ if len(np.shape(ar40ar36)) == 1:
105
+ ar40ar36 = np.reshape(ar40ar36, (2, 1))
106
+ if index is None:
107
+ index = list(range(np.shape(ar40ar36)[-1]))
108
+ if smp is None and params is None:
109
+ raise ValueError(f"Parameters are required for calculating mdf, or it is empty.")
110
+ if params is not None:
111
+ for key, val in params.items():
112
+ if not isinstance(val, list):
113
+ params[key] = list(val)
114
+ if smp is not None:
115
+ try:
116
+ params_from_smp = dict(zip(
117
+ list(params_index_dict.values()),
118
+ [[smp.TotalParam[i][j] for j in index] for i in params_index_dict.keys()]
119
+ ))
120
+ except Exception:
121
+ print(traceback.format_exc())
122
+ raise ValueError(f"Parameters cannot be found in the given sample object")
123
+ if params is not None:
124
+ params_from_smp.update(params)
125
+ params = params_from_smp
126
+
75
127
  mdf = []
76
- for i in range(len(std_air)):
77
- k = calc.corr.mdf(air[i], sair[i], m36[i], m40[i], std_air[i], std_err[i]) # linear, exp, pow
78
- mdf.append({"linear": k[0:2], "exp": k[2:4], "pow": k[4:6]}[discrimination_method[i].lower()])
79
- return np.transpose(mdf).tolist()
128
+ for i in range(len(index)):
129
+ k = calc.corr.mdf(ar40ar36[0][i], ar40ar36[1][i], params['M36'][i], params['M40'][i],
130
+ params['Air'][i], params['sAir'][i]) # linear, exp, pow
131
+ mdf.append({"linear": k[0:4], "exp": k[4:8], "pow": k[8:12]}[params['Discr'][i].lower()])
132
+
133
+ if len(index) == 1:
134
+ return np.transpose(mdf).squeeze().tolist()
135
+ else:
136
+ return np.transpose(mdf).tolist()
80
137
 
81
138
 
82
139
  def calc_age(ar40ar39=None, params: dict = None, smp: Sample = None, index: list = None):
@@ -25,16 +25,15 @@ from .sample import Sample
25
25
  def corr_gain(sample: Sample):
26
26
  """Blank Correction"""
27
27
  corrGain = True
28
- gain_corrected = np.zeros([10, len(sample.SequenceName)])
28
+ gain_corrected = np.zeros([10, sample.Info.experiment.step_num])
29
29
  try:
30
30
  for i in range(5):
31
31
  f, sf = np.array(sample.TotalParam[126 + i * 2:128 + i * 2])
32
32
  sf = f * sf / 100
33
33
  gain_corrected[i * 2:2 + i * 2] = calc.corr.gain(*sample.SampleIntercept[i * 2:2 + i * 2], f, sf)
34
- except Exception as e:
35
- print(f"Gain correction failed")
36
- print(traceback.format_exc())
37
- return
34
+ except (Exception, BaseException) as e:
35
+ print(f"Gain correction failed: \n{traceback.format_exc()}")
36
+ raise
38
37
  for i in range(0, 10, 2):
39
38
  gain_corrected[i] = [gain_corrected[i][index] if corrGain else j for index, j in enumerate(sample.SampleIntercept[i])]
40
39
  gain_corrected[i + 1] = [gain_corrected[i + 1][index] if corrGain else j for index, j in enumerate(sample.SampleIntercept[i + 1])]
@@ -237,7 +237,7 @@ def initial(smp: Sample):
237
237
  return smp
238
238
 
239
239
 
240
- def initial_plot_styles(sample: Sample, except_attrs=None):
240
+ def initial_plot_styles(smp: Sample, except_attrs=None):
241
241
  """
242
242
  Initialize plot components styles based on Default Styles. Except attrs is a list containing attrs
243
243
  that are not expected to be initialized.
@@ -261,13 +261,22 @@ def initial_plot_styles(sample: Sample, except_attrs=None):
261
261
  for k, v in value.items():
262
262
  set_attr(getattr(obj, name), k, v)
263
263
 
264
- default_styles = copy.deepcopy(samples.DEFAULT_PLOT_STYLES)
264
+ default_styles = get_default_plot_style(smp)
265
265
  for figure_index, figure_attr in default_styles.items():
266
- plot = getattr(sample, figure_attr['attr_name'], Plot())
266
+ plot = getattr(smp, figure_attr['attr_name'], Plot())
267
267
  for key, attr in figure_attr.items():
268
268
  set_attr(plot, key, attr)
269
269
 
270
270
 
271
+ def get_default_plot_style(smp: Sample):
272
+ sample_type = smp.Info.sample.type
273
+ try:
274
+ age_unit = str(smp.Info.preference['ageUnit']).capitalize()
275
+ except:
276
+ age_unit = "Undefined"
277
+ return copy.deepcopy(samples.DEFAULT_PLOT_STYLES(sample_type, age_unit))
278
+
279
+
271
280
  def re_set_smp(smp: Sample):
272
281
  std = initial(Sample())
273
282
  basic.get_merged_smp(smp, std)
@@ -89,27 +89,27 @@ 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(smp: Sample):
93
93
  """
94
94
  Assign initial data for plots
95
95
  Parameters
96
96
  ----------
97
- sample : Sample instance
97
+ smp : Sample instance
98
98
 
99
99
  Returns
100
100
  -------
101
101
  None
102
102
  """
103
103
  for key, val in ISOCHRON_INDEX_DICT.items():
104
- figure = basic.get_component_byid(sample, key)
104
+ figure = basic.get_component_byid(smp, key)
105
105
  try:
106
106
  # data = [x, sx, y, sy, (z, sz,) r1, (r2, r3,), index from 1]
107
- figure.data = sample.IsochronValues[val['data_index'][0]:val['data_index'][1]] + \
108
- [[i + 1 for i in range(len(sample.SequenceName))]]
107
+ figure.data = smp.IsochronValues[val['data_index'][0]:val['data_index'][1]] + \
108
+ [[i + 1 for i in range(len(smp.SequenceName))]]
109
109
  except (Exception, BaseException):
110
110
  print(traceback.format_exc())
111
111
  figure.data = [[]] * (val['data_index'][1] - val['data_index'][0]) + \
112
- [[i + 1 for i in range(len(sample.SequenceName))]]
112
+ [[i + 1 for i in range(len(smp.SequenceName))]]
113
113
  finally:
114
114
  # Ellipse
115
115
  if key != 'figure_7':
@@ -122,51 +122,64 @@ def initial_plot_data(sample: Sample):
122
122
  # Set age spectra lines
123
123
  # Try to calculate total gas age
124
124
  try:
125
- a0, e0 = sum(sample.DegasValues[24]), pow(sum([i ** 2 for i in sample.DegasValues[25]]), 0.5)
126
- a1, e1 = sum(sample.DegasValues[20]), pow(sum([i ** 2 for i in sample.DegasValues[21]]), 0.5)
125
+ if str(smp.Info.sample.type).lower() == "unknown":
126
+ a0, e0 = sum(smp.DegasValues[24]), pow(sum([i ** 2 for i in smp.DegasValues[25]]), 0.5)
127
+ a1, e1 = sum(smp.DegasValues[20]), pow(sum([i ** 2 for i in smp.DegasValues[21]]), 0.5)
128
+ handle = basic.calc_age
129
+ elif str(smp.Info.sample.type).lower() == "standard":
130
+ a0, e0 = sum(smp.DegasValues[24]), pow(sum([i ** 2 for i in smp.DegasValues[25]]), 0.5)
131
+ a1, e1 = sum(smp.DegasValues[20]), pow(sum([i ** 2 for i in smp.DegasValues[21]]), 0.5)
132
+ handle = basic.calc_j
133
+ elif str(smp.Info.sample.type).lower() == "air":
134
+ a0, e0 = sum(smp.DegasValues[26]), pow(sum([i ** 2 for i in smp.DegasValues[27]]), 0.5)
135
+ a1, e1 = sum(smp.DegasValues[ 0]), pow(sum([i ** 2 for i in smp.DegasValues[ 1]]), 0.5)
136
+ handle = basic.calc_mdf
137
+ else:
138
+ raise TypeError(f"Sample type is not supported: {smp.Info.sample.type}")
127
139
  total_f = [a0 / a1, calc.err.div((a0, e0), (a1, e1))]
128
- total_age = basic.calc_age(total_f[:2], smp=sample)
140
+ total_age = handle(total_f[:2], smp=smp)
129
141
  except (Exception, BaseException):
130
142
  print(traceback.format_exc())
131
143
  total_f = [np.nan] * 2
132
144
  total_age = [np.nan] * 4
133
- sample.Info.results.age_spectra['TGA'].update(
145
+ print(f"{total_f = }")
146
+ print(f"{total_age = }")
147
+ smp.Info.results.age_spectra['TGA'].update(
134
148
  {'Ar39': 100, 'F': total_f[0], 'sF': total_f[1], 'age': total_age[0],
135
- 's1': total_age[1], 's2': total_age[2], 's3': total_age[3], 'Num': len(sample.DegasValues[24])}
149
+ 's1': total_age[1], 's2': total_age[2], 's3': total_age[3], 'Num': len(smp.DegasValues[24])}
136
150
  )
137
151
  try:
138
- sample.AgeSpectraPlot.data = calc.spectra.get_data(
139
- *sample.ApparentAgeValues[2:4], sample.ApparentAgeValues[7])
140
- sample.AgeSpectraPlot.data = calc.arr.transpose(sample.AgeSpectraPlot.data)
152
+ smp.AgeSpectraPlot.data = calc.spectra.get_data(*smp.ApparentAgeValues[2:4], smp.ApparentAgeValues[7])
153
+ smp.AgeSpectraPlot.data = calc.arr.transpose(smp.AgeSpectraPlot.data)
141
154
  except (Exception, BaseException):
142
155
  print(traceback.format_exc())
143
- sample.AgeSpectraPlot.data = []
156
+ smp.AgeSpectraPlot.data = []
144
157
 
145
158
  # Degassing plot
146
159
  try:
147
- if not hasattr(sample, 'DegasPatternPlot'):
148
- setattr(sample, 'DegasPatternPlot', Plot(id='figure_8', name='Degas Pattern Plot'))
160
+ if not hasattr(smp, 'DegasPatternPlot'):
161
+ setattr(smp, 'DegasPatternPlot', Plot(id='figure_8', name='Degas Pattern Plot'))
149
162
  isotope_percentage = lambda l: [e / sum(l) * 100 if sum(l) != 0 else 0 for e in l]
150
- sample.DegasPatternPlot.data = [
151
- isotope_percentage(sample.DegasValues[0]), # Ar36a
152
- isotope_percentage(sample.DegasValues[8]), # Ar37Ca
153
- isotope_percentage(sample.DegasValues[10]), # Ar38Cl
154
- isotope_percentage(sample.DegasValues[20]), # Ar39K
155
- isotope_percentage(sample.DegasValues[24]), # Ar40r
156
- isotope_percentage(sample.CorrectedValues[0]), # Ar36
157
- isotope_percentage(sample.CorrectedValues[2]), # Ar37
158
- isotope_percentage(sample.CorrectedValues[4]), # Ar38
159
- isotope_percentage(sample.CorrectedValues[6]), # Ar39
160
- isotope_percentage(sample.CorrectedValues[8]), # Ar40
163
+ smp.DegasPatternPlot.data = [
164
+ isotope_percentage(smp.DegasValues[0]), # Ar36a
165
+ isotope_percentage(smp.DegasValues[8]), # Ar37Ca
166
+ isotope_percentage(smp.DegasValues[10]), # Ar38Cl
167
+ isotope_percentage(smp.DegasValues[20]), # Ar39K
168
+ isotope_percentage(smp.DegasValues[24]), # Ar40r
169
+ isotope_percentage(smp.CorrectedValues[0]), # Ar36
170
+ isotope_percentage(smp.CorrectedValues[2]), # Ar37
171
+ isotope_percentage(smp.CorrectedValues[4]), # Ar38
172
+ isotope_percentage(smp.CorrectedValues[6]), # Ar39
173
+ isotope_percentage(smp.CorrectedValues[8]), # Ar40
161
174
  ]
162
- sample.DegasPatternPlot.info = [True] * 10
175
+ smp.DegasPatternPlot.info = [True] * 10
163
176
  except Exception as e:
164
177
  print(traceback.format_exc())
165
178
  pass
166
179
 
167
180
  # Set age distribution plot data
168
181
  try:
169
- recalc_agedistribution(sample)
182
+ recalc_agedistribution(smp)
170
183
  except Exception as e:
171
184
  print(traceback.format_exc())
172
185
 
@@ -390,7 +403,7 @@ def recalc_plateaus(sample: Sample, **kwargs):
390
403
  if sample.Info.sample.type == "Standard":
391
404
  return recalc_j_plateaus(sample, **kwargs)
392
405
  if sample.Info.sample.type == "Air":
393
- return recalc_j_plateaus(sample, **kwargs)
406
+ return recalc_mdf_plateaus(sample, **kwargs)
394
407
 
395
408
 
396
409
  def recalc_age_plateaus(sample: Sample, **kwargs):
@@ -437,7 +450,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
437
450
  try:
438
451
  set1_res, set1_age, set1_data = get_plateau_results(
439
452
  sample, sample.SelectedSequence1, calc_ar40ar39(*ratio_set1, smp=sample),
440
- ar39k_percentage=np.cumsum(ar39k) / np.sum(ar39k),
453
+ ar39k_percentage=np.array(ar39k) / np.sum(ar39k),
441
454
  **kwargs)
442
455
  except ValueError:
443
456
  # print(traceback.format_exc())
@@ -450,7 +463,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
450
463
  try:
451
464
  set2_res, set2_age, set2_data = get_plateau_results(
452
465
  sample, sample.SelectedSequence2, calc_ar40ar39(*ratio_set2, smp=sample),
453
- ar39k_percentage=np.cumsum(ar39k) / np.sum(ar39k),
466
+ ar39k_percentage=np.array(ar39k) / np.sum(ar39k),
454
467
  **kwargs)
455
468
  except ValueError:
456
469
  # print(traceback.format_exc())
@@ -464,7 +477,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
464
477
  # Weighted mean ages of two sets with 298.56 (defoult air ratio)
465
478
  try:
466
479
  set1_res = get_wma_results(
467
- sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k, ar39k_percentage=np.cumsum(ar39k) / np.sum(ar39k))
480
+ sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k, ar39k_percentage=np.array(ar39k) / np.sum(ar39k))
468
481
  except ValueError:
469
482
  pass
470
483
  # raise ValueError(f"Set 1 WMA calculation error.")
@@ -472,7 +485,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
472
485
  sample.Info.results.age_spectra.update({0: set1_res})
473
486
  try:
474
487
  set2_res = get_wma_results(
475
- sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k, ar39k_percentage=np.cumsum(ar39k) / np.sum(ar39k))
488
+ sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k, ar39k_percentage=np.array(ar39k) / np.sum(ar39k))
476
489
  except ValueError:
477
490
  pass
478
491
  # raise ValueError(f"Set 2 WMA calculation error.")
@@ -552,6 +565,41 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
552
565
  # # """end"""
553
566
 
554
567
 
568
+ def recalc_mdf_plateaus(sample: Sample, **kwargs):
569
+ """
570
+ Calculate age plateaus results
571
+ Parameters
572
+ ----------
573
+ sample : sample instance
574
+ kwargs : optional args, keys in [r1, sr1, r2, sr2]
575
+
576
+ Returns
577
+ -------
578
+ None
579
+ """
580
+ ar36a, sar36a = calc.arr.mul(sample.DegasValues[0:2], sample.NormalizeFactor)
581
+ ar40aar36a = sample.ApparentAgeValues[0:2]
582
+ mdf = sample.ApparentAgeValues[2:4]
583
+
584
+ try:
585
+ set1_res, _, set1_data = get_plateau_results(sample, sample.SelectedSequence1, ar40rar39k=ar40aar36a)
586
+ except ValueError:
587
+ pass
588
+ else:
589
+ sample.Info.results.age_plateau.update({0: set1_res})
590
+ sample.AgeSpectraPlot.set1.data = calc.arr.transpose(set1_data)
591
+ sample.AgeSpectraPlot.text1.text = ""
592
+
593
+ try:
594
+ set2_res, _, set2_data = get_plateau_results(sample, sample.SelectedSequence2, ar40rar39k=ar40aar36a)
595
+ except ValueError:
596
+ pass
597
+ else:
598
+ sample.Info.results.age_plateau.update({1: set2_res})
599
+ sample.AgeSpectraPlot.set2.data = calc.arr.transpose(set2_data)
600
+ sample.AgeSpectraPlot.text2.text = ""
601
+
602
+
555
603
  def calc_ar40ar39(r, sr, smp):
556
604
  """
557
605
  Calculate Ar40r / Ar39K based on passed initial ratio.
@@ -586,20 +634,20 @@ def calc_ar40ar39(r, sr, smp):
586
634
  return ar40rar39k
587
635
 
588
636
 
589
- def get_plateau_results(sample: Sample, sequence: list, ar40rar39k: list = None,
637
+ def get_plateau_results(smp: Sample, sequence: list, ar40rar39k: list = None,
590
638
  ar39k_percentage: list = None, **kwargs):
591
639
  """
592
640
  Get initial ratio re-corrected plateau results
593
641
  Parameters
594
642
  ----------
595
- sample : sample instance
643
+ smp : sample instance
596
644
  sequence : data slice index
597
645
  ar40rar39k :
598
646
  ar39k_percentage : Ar39K released
599
647
 
600
648
  Returns
601
649
  -------
602
- three itmes tuple, result dict, age, and plot data, results keys = [
650
+ three items tuple, result dict, age, and plot data, results keys = [
603
651
  'F', 'sF', 'Num', 'MSWD', 'Chisq', 'Pvalue',
604
652
  'age', 's1', 's2', 's3', 'Ar39', 'rs'
605
653
  ]
@@ -616,21 +664,28 @@ def get_plateau_results(sample: Sample, sequence: list, ar40rar39k: list = None,
616
664
  if len(sequence) == 0:
617
665
  return plateau_res, [], []
618
666
  if ar40rar39k is None:
619
- ar40rar39k = sample.ApparentAgeValues[0:2]
667
+ ar40rar39k = smp.ApparentAgeValues[0:2]
620
668
  if ar39k_percentage is None:
621
- ar39k_percentage = sample.ApparentAgeValues[7]
669
+ ar39k_percentage = smp.ApparentAgeValues[7]
670
+
671
+ if str(smp.Info.sample.type).lower() == "unknown":
672
+ handle = basic.calc_age
673
+ elif str(smp.Info.sample.type).lower() == "standard":
674
+ handle = basic.calc_j
675
+ elif str(smp.Info.sample.type).lower() == "air":
676
+ handle = basic.calc_mdf
677
+ else:
678
+ raise TypeError(f"Sample type is not supported: {smp.Info.sample.type}")
622
679
 
623
- age = basic.calc_age(ar40ar39=ar40rar39k, smp=sample)[0:2]
680
+ age = handle(ar40ar39=ar40rar39k, smp=smp)[0:2]
624
681
  plot_data = calc.spectra.get_data(*age, ar39k_percentage, indices=sequence, **kwargs)
625
682
  f_values = _get_partial(sequence, *ar40rar39k)
626
683
  age = _get_partial(sequence, *age)
627
684
  sum_ar39k = sum(_get_partial(sequence, ar39k_percentage)[0])
628
685
  wmf = calc.arr.wtd_mean(*f_values)
629
- wmage = basic.calc_age(wmf[0:2], smp=sample)
686
+ wmage = handle(wmf[0:2], smp=smp)
630
687
 
631
- plateau_res.update(dict(zip(
632
- plateau_res_keys, [*wmf, *wmage, sum_ar39k, np.nan]
633
- )))
688
+ plateau_res.update(dict(zip(plateau_res_keys, [*wmf, *wmage, sum_ar39k, np.nan])))
634
689
  return plateau_res, age, plot_data
635
690
 
636
691
 
@@ -679,13 +734,11 @@ def get_wma_results(sample: Sample, sequence: list, ar40rar39k: list = None, ar3
679
734
 
680
735
  def recalc_j_plateaus(sample: Sample, **kwargs):
681
736
 
682
- print(f"Recalc J plateau")
683
-
737
+ ar40rar39k = sample.ApparentAgeValues[0:2]
684
738
  j = sample.ApparentAgeValues[2:4]
685
739
 
686
740
  try:
687
- set1_res, _, set1_data = \
688
- get_j_plateau_results(sample, sample.SelectedSequence1, j)
741
+ set1_res, _, set1_data = get_plateau_results(sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k)
689
742
  except ValueError:
690
743
  pass
691
744
  else:
@@ -694,8 +747,7 @@ def recalc_j_plateaus(sample: Sample, **kwargs):
694
747
  sample.AgeSpectraPlot.text1.text = "" # 注意和js的配合,js那边根据text是否为空判断是否重新生成文字
695
748
 
696
749
  try:
697
- set2_res, _, set2_data = \
698
- get_j_plateau_results(sample, sample.SelectedSequence2, j)
750
+ set2_res, _, set2_data = get_plateau_results(sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k)
699
751
  except ValueError:
700
752
  pass
701
753
  else:
@@ -704,31 +756,6 @@ def recalc_j_plateaus(sample: Sample, **kwargs):
704
756
  sample.AgeSpectraPlot.text2.text = "" # 注意和js的配合,js那边根据text是否为空判断是否重新生成文字
705
757
 
706
758
 
707
- def get_j_plateau_results(sample: Sample, sequence: list, j: list, ar39k_percentage: list = None):
708
-
709
- def _get_partial(points, *args):
710
- # return [arg[min(points): max(points) + 1] for arg in args]
711
- return [[arg[i] for i in points] for arg in args]
712
-
713
- if ar39k_percentage is None:
714
- ar39k_percentage = sample.ApparentAgeValues[7]
715
- sum_ar39k = sum(_get_partial(sequence, ar39k_percentage)[0])
716
-
717
- j_values = _get_partial(sequence, *j)
718
- wmj = calc.arr.wtd_mean(*j_values)
719
- plot_data = [[sum(ar39k_percentage[:min(sequence)]), sum(ar39k_percentage[:max(sequence) + 1])],
720
- [wmj[0], wmj[0]]]
721
-
722
- plateau_res_keys = [
723
- 'F', 'sF', 'Num', 'MSWD', 'Chisq', 'Pvalue', 'age', 's1', 's2', 's3', 'Ar39',
724
- 'rs', # 'rs' means relative error of the total sum
725
- ]
726
- plateau_res = dict(zip(plateau_res_keys, [np.nan for i in plateau_res_keys]))
727
- plateau_res.update(dict(zip(plateau_res_keys, [*wmj, np.nan, np.nan, np.nan, np.nan, sum_ar39k, np.nan])))
728
-
729
- return plateau_res, 0, plot_data
730
-
731
-
732
759
  # =======================
733
760
  # Age Distribution Plot
734
761
  # =======================
@@ -54,7 +54,21 @@ PUBLISH_TABLE_HEADERS = [
54
54
  'Sequence', '', # 0-1
55
55
  '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
56
56
  '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
57
- 'Apparent Age', '1\u03C3', '\u2074\u2070Arr%', '\u00B3\u2079ArK%', # 7-10
57
+ 'Apparent Age', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 7-10
58
+ 'Ca/K', '1\u03C3', # 11-12
59
+ ]
60
+ PUBLISH_TABLE_HEADERS_AIR = [
61
+ 'Sequence', '', # 0-1
62
+ '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
63
+ '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
64
+ 'MDF', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
65
+ 'Ca/K', '1\u03C3', # 11-12
66
+ ]
67
+ PUBLISH_TABLE_HEADERS_STD = [
68
+ 'Sequence', '', # 0-1
69
+ '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
70
+ '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
71
+ 'J', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
58
72
  'Ca/K', '1\u03C3', # 11-12
59
73
  ]
60
74
  SPECTRUM_TABLE_HEADERS = [
@@ -63,6 +77,18 @@ SPECTRUM_TABLE_HEADERS = [
63
77
  'Apparent Age', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
64
78
  '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 8-9
65
79
  ]
80
+ SPECTRUM_TABLE_HEADERS_AIR = [
81
+ 'Sequence', '', # 0-1
82
+ '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
83
+ 'MDF', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
84
+ '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
85
+ ]
86
+ SPECTRUM_TABLE_HEADERS_STD = [
87
+ 'Sequence', '', # 0-1
88
+ '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
89
+ 'J', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
90
+ '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
91
+ ]
66
92
  ISOCHRON_TABLE_HEADERS = [
67
93
  'Sequence', '', 'Mark', # 0-2
68
94
  '\u00B3\u2079Ar[K]/\u00B3\u2076Ar[a]', '1\u03C3', # 3-4
@@ -259,19 +285,26 @@ TOTAL_PARAMS_SHORT_HEADERS = [
259
285
  '40Gain', '%1s', # 136-137
260
286
  ]
261
287
 
262
- DEFAULT_PLOT_STYLES = {
288
+ DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
263
289
  'figure_1': {
264
- 'id': 'figure_1', 'name': 'Age Spectra', 'type': 'spectra', 'attr_name': 'AgeSpectraPlot',
290
+ 'id': 'figure_1', 'name': 'Age Spectra' if sample_type == "Unknown" else 'J Spectra' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
291
+ 'type': 'spectra', 'attr_name': 'AgeSpectraPlot',
265
292
  'rightside_text': [],
266
- 'title': {'id': 'title', 'show': True, 'text': 'Age Spectra', 'position': 'center',
293
+ 'title': {'id': 'title', 'show': True,
294
+ 'text': 'Age Spectra' if sample_type == "Unknown" else 'J Spectra' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
295
+ 'position': 'center',
267
296
  'font_size': 18, 'color': '#333333', 'opacity': 1, 'type': 'text', 'font_weight': 'bolder',
268
297
  'font_family': 'Microsoft Sans Serif', },
269
298
  'xaxis': {
270
- 'title': {'text': 'Cumulative {sup|39}Ar Released (%)', 'type': 'text', }, 'type': 'axis',
299
+ 'title': {'text': 'Cumulative {sup|39}Ar Released (%)' if sample_type == "Unknown" or sample_type == "Standard" else "Cumulative {sup|36}Ar Released (%)" if sample_type == "Air" else "Unkown Title",
300
+ 'type': 'text', }, 'type': 'axis',
271
301
  'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
272
302
  },
273
303
  'yaxis': {
274
- 'title': {'text': 'Apparent Age (Ma)', 'type': 'text', }, 'type': 'axis',
304
+ 'title': {
305
+ 'text': f'Apparent Age ({age_unit})' if sample_type == "Unknown" else 'J Values' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
306
+ 'type': 'text',
307
+ }, 'type': 'axis',
275
308
  'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
276
309
  },
277
310
  'set1': {'id': 'Points Set 1', 'type': 'set', },
@@ -19,13 +19,26 @@ Sample = samples.Sample
19
19
  Table = samples.Table
20
20
  Plot = samples.Plot
21
21
 
22
- TABLEHEADER = lambda index: [
23
- '',
24
- samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
25
- samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS,
26
- samples.SPECTRUM_TABLE_HEADERS, samples.ISOCHRON_TABLE_HEADERS,
27
- samples.TOTAL_PARAMS_HEADERS
28
- ][index]
22
+ TABLEHEADER = lambda index, sample_type: {
23
+ 'Unknown': ['',
24
+ samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
25
+ samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS,
26
+ samples.SPECTRUM_TABLE_HEADERS, samples.ISOCHRON_TABLE_HEADERS,
27
+ samples.TOTAL_PARAMS_HEADERS
28
+ ],
29
+ 'Standard': ['',
30
+ samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
31
+ samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS_STD,
32
+ samples.SPECTRUM_TABLE_HEADERS_STD, samples.ISOCHRON_TABLE_HEADERS,
33
+ samples.TOTAL_PARAMS_HEADERS
34
+ ],
35
+ 'Air': ['',
36
+ samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
37
+ samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS_AIR,
38
+ samples.SPECTRUM_TABLE_HEADERS_AIR, samples.ISOCHRON_TABLE_HEADERS,
39
+ samples.TOTAL_PARAMS_HEADERS
40
+ ],
41
+ }[sample_type][index]
29
42
 
30
43
 
31
44
  # =======================
@@ -58,13 +71,6 @@ def set_plot_style(smp: Sample):
58
71
  setattr(figure, 'title', Plot.Text())
59
72
  setattr(getattr(figure, 'title'), 'text', f"{suffix} {getattr(figure, 'name', '')}")
60
73
 
61
- age_unit = "Undefined"
62
- try:
63
- age_unit = str(smp.Info.preference['ageUnit']).capitalize()
64
- except:
65
- print(traceback.format_exc())
66
- smp.AgeSpectraPlot.yaxis.title.text = f"Apparent Age ({age_unit})"
67
-
68
74
 
69
75
  def reset_plot_scale(smp: Sample, only_figure: str = None):
70
76
  """
@@ -160,7 +166,8 @@ def reset_text(smp: Sample, only_figure: str = None):
160
166
  -------
161
167
  None
162
168
  """
163
- for figure_id in list(samples.DEFAULT_PLOT_STYLES.keys()):
169
+ default_styles = initial.get_default_plot_style(smp)
170
+ for figure_id in list(default_styles.keys()):
164
171
  if only_figure is not None and figure_id != only_figure:
165
172
  continue
166
173
  figure = basic.get_component_byid(smp, figure_id)
@@ -190,7 +197,7 @@ def set_table_style(sample: Sample):
190
197
  """
191
198
  for key, comp in basic.get_components(sample).items():
192
199
  if isinstance(comp, Table):
193
- comp.header = TABLEHEADER(index=int(comp.id))
200
+ comp.header = TABLEHEADER(sample_type=sample.Info.sample.type, index=int(comp.id))
194
201
  comp.set_coltypes()
195
202
  # comp.colcount = len(comp.header)
196
203
  # comp.coltypes = [{'type': 'numeric'}] * (comp.colcount)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ararpy
3
- Version: 0.1.198
3
+ Version: 0.1.199
4
4
  Summary: A project for Ar-Ar geochronology
5
5
  Home-page: https://github.com/wuyangchn/ararpy.git
6
6
  Author: Yang Wu
@@ -16,7 +16,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
16
16
 
17
17
  setuptools.setup(
18
18
  name='ararpy', #
19
- version='0.1.198', # version
19
+ version='0.1.199', # version
20
20
  author='Yang Wu',
21
21
  author_email='wuycug@hotmail.com',
22
22
  description='A project for Ar-Ar geochronology', # short description
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes