ararpy 0.1.27__tar.gz → 0.1.29__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.1.27 → ararpy-0.1.29}/PKG-INFO +1 -1
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/export.py +25 -10
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/initial.py +30 -9
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/sample.py +10 -2
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy.egg-info/PKG-INFO +1 -1
- {ararpy-0.1.27 → ararpy-0.1.29}/setup.py +1 -1
- {ararpy-0.1.27 → ararpy-0.1.29}/LICENSE +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/README.md +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/__init__.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/__init__.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/age.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/arr.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/basic.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/corr.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/err.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/histogram.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/isochron.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/jvalue.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/plot.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/raw_funcs.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/regression.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/calc/spectra.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/022_VU124-M11a.ahd +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/20WHA0103.age +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/22WHA0078.xls +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/22WHA0433.age +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/22WHA0433.arr +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/22WHA0433.full.xls +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/AHD.input-filter +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/ArAr.calc +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/ArArCALC.age +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/NGX-600.TXT +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/NGX-XLS.input-filter +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/S01-239.csv +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/WH01.irra +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/WHA.pdf +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/raw_example.xls +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/examples/sample-default.smp +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/__init__.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/arr_file.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/basic.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/calc_file.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/new_file.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/raw_file.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/files/xls.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/__init__.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/basic.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/calculation.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/consts.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/corr.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/diffusion_funcs.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/info.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/json.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/plots.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/raw.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/style.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/smp/table.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/test.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/thermo/__init__.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/thermo/arrhenius.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/thermo/atomic_level_random_walk.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy/thermo/basic.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy.egg-info/SOURCES.txt +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy.egg-info/dependency_links.txt +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/ararpy.egg-info/top_level.txt +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/setup.cfg +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/tests/test.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/tests/test2.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/tests/test_error_correlation.py +0 -0
- {ararpy-0.1.27 → ararpy-0.1.29}/tests/test_regression_methods.py +0 -0
|
@@ -310,7 +310,7 @@ def getRectFromSpectra(data):
|
|
|
310
310
|
|
|
311
311
|
"""
|
|
312
312
|
data = np.array(data)
|
|
313
|
-
return list(map(lambda index: [data[index,0], min(data[index,[1,2]]),
|
|
313
|
+
return list(filter(lambda rect: rect[2] != 0 and rect[3] != 0, map(lambda index: [data[index,0], min(data[index,[1,2]]), abs(data[index+1,0] - data[index,0]), abs(data[index,1] - data[index,2])], list(range(len(data) - 1)))))
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
def _get_additional_text_series(name):
|
|
@@ -364,7 +364,6 @@ def _get_plot_data_age_spectra_series(smp: sample, **options):
|
|
|
364
364
|
plateau_data = np.array(set_data[index])
|
|
365
365
|
# spectra_fill_data = list(map(lambda each: [data[0][each - 1], min(data[1][each], data[2][each]), data[0][each + 1] - data[0][each], sigma * abs(data[1][each] - data[2][each])], selection))
|
|
366
366
|
spectra_fill_data = getRectFromSpectra(plateau_data)
|
|
367
|
-
print(spectra_fill_data)
|
|
368
367
|
series.append({
|
|
369
368
|
'type': 'series.rect', 'id': f'rect-{smp.name()}-{get_random_digits()}', 'name': f'rect-{smp.name()}-{get_random_digits()}',
|
|
370
369
|
'color': ['red', 'blue'][index], 'fill_color': ['red', 'blue'][index], 'line_width': 0, 'line_style': 'none', 'z_index': 9,
|
|
@@ -1229,20 +1228,36 @@ class WritingWorkbook:
|
|
|
1229
1228
|
|
|
1230
1229
|
def write_sht_table(self, sht_name, prop_name, sht_type, row, col, _, smp_attr_name, header_name, style, xls, sigma=1):
|
|
1231
1230
|
sht = xls.add_worksheet(sht_name)
|
|
1231
|
+
num_step = len(self.sample.SequenceName)
|
|
1232
1232
|
data = arr.transpose(getattr(self.sample, smp_attr_name, None).data)
|
|
1233
1233
|
sht.hide_gridlines(2) # 0 = show grids, 1 = hide print grid, else = hide print and screen grids
|
|
1234
1234
|
sht.hide() # default hidden table sheet
|
|
1235
1235
|
sht.set_column(0, len(data), width=12) # column width
|
|
1236
1236
|
header = getattr(sample, header_name)
|
|
1237
1237
|
header = list(map(lambda each: each if "σ" not in each else each.replace('1', str(sigma)) if str(sigma) not in each else each.replace('2', str(sigma)), header))
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1238
|
+
|
|
1239
|
+
content = [
|
|
1240
|
+
[(0, 0), f"{sht_name}", {'bold': 1, 'top': 1, 'align': 'left'}],
|
|
1241
|
+
*[[(1, col, 2, col), each, {'bold': 1, 'top': 1, 'bottom': 6}] for col, each in enumerate(header)],
|
|
1242
|
+
*[[(3, col, 1), each if "σ" not in header[col] else list(map(lambda _: _ * sigma, each)), {}] for col, each in enumerate(data)],
|
|
1243
|
+
[(3 + num_step, 0, 0), [''] * len(data), {'bold': 1, 'top': 1}],
|
|
1244
|
+
]
|
|
1245
|
+
|
|
1246
|
+
for pos, value, _prop in content:
|
|
1247
|
+
prop = self.default_fmt_prop.copy()
|
|
1248
|
+
prop.update(_prop)
|
|
1249
|
+
fmt = Format(prop, xls.xf_format_indices, xls.dxf_format_indices)
|
|
1250
|
+
xls.formats.append(fmt)
|
|
1251
|
+
if isinstance(value, (list, np.ndarray)) and len(pos) == 3:
|
|
1252
|
+
value = [None if isinstance(v, (float, int)) and np.isnan(v) else v for v in value]
|
|
1253
|
+
[sht.write_row, sht.write_column][pos[2]](*pos[:2], value, fmt)
|
|
1254
|
+
elif len(pos) == 2:
|
|
1255
|
+
isnumeric = isinstance(value, (float, int)) and not np.isnan(value) and not np.isinf(value)
|
|
1256
|
+
[sht.write_string, sht.write_number][isnumeric](*pos, value if isnumeric else str(value), fmt)
|
|
1257
|
+
elif len(pos) == 4:
|
|
1258
|
+
isnumeric = isinstance(value, (float, int)) and not np.isnan(value) and not np.isinf(value)
|
|
1259
|
+
sht.merge_range(*pos, value if isnumeric else str(value), fmt)
|
|
1260
|
+
|
|
1246
1261
|
|
|
1247
1262
|
def write_sht_chart(self, sht_name, prop_name, sht_type, row, col, _, smp_attr_name, header_name, style, xls, start_row, total_rows):
|
|
1248
1263
|
sht = xls.add_chartsheet(sht_name)
|
|
@@ -298,21 +298,42 @@ def check_version(smp: Sample):
|
|
|
298
298
|
std = initial(Sample())
|
|
299
299
|
basic.get_merged_smp(smp, std)
|
|
300
300
|
|
|
301
|
+
try:
|
|
302
|
+
version = int(smp.version)
|
|
303
|
+
except ValueError:
|
|
304
|
+
return smp
|
|
305
|
+
|
|
301
306
|
# 20250328: # Experiment info
|
|
302
307
|
smp.Info.experiment.name = smp.name()
|
|
303
308
|
smp.Info.experiment.step_num = smp.sequence().size
|
|
304
309
|
|
|
305
|
-
#
|
|
310
|
+
# old version: add masses and gain factors
|
|
311
|
+
if version < 20240730:
|
|
312
|
+
gains = np.ones([10, smp.Info.experiment.step_num])
|
|
313
|
+
gains[[1, 3, 5, 7, 9], :] = 0
|
|
314
|
+
smp.TotalParam[126:136] = gains.tolist()
|
|
315
|
+
gains[0] = 35.96754628
|
|
316
|
+
gains[2] = 36.9667759
|
|
317
|
+
gains[4] = 37.9627322
|
|
318
|
+
gains[6] = 38.964313
|
|
319
|
+
gains[8] = 39.962383123
|
|
320
|
+
smp.TotalParam[71:81] = gains.tolist()
|
|
321
|
+
smp.version = "20240730"
|
|
322
|
+
|
|
323
|
+
# 20250404: # Normalization for steps with different J values
|
|
306
324
|
doNormalize = True
|
|
307
325
|
v, sv = [], []
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
326
|
+
try:
|
|
327
|
+
if smp.Info.sample.type.lower() == "unknown":
|
|
328
|
+
v, sv = smp.TotalParam[67:69]
|
|
329
|
+
sv = np.multiply(v, sv) / 100
|
|
330
|
+
elif smp.Info.sample.type.lower() == "air":
|
|
331
|
+
v, sv = smp.TotalParam[93:95]
|
|
332
|
+
sv = np.multiply(v, sv) / 100
|
|
333
|
+
elif smp.Info.sample.type.lower() == "standard":
|
|
334
|
+
v, sv = smp.TotalParam[59:61]
|
|
335
|
+
except:
|
|
336
|
+
doNormalize = False
|
|
316
337
|
smp.NormalizeFactor = [
|
|
317
338
|
[1 if v[0] == each or not doNormalize else v[0] / each for each in v],
|
|
318
339
|
[0 if v[0] == v[i] or not doNormalize else err.div((v[0], sv[0]), (v[i], sv[i])) for i in range(len(v))]
|
|
@@ -776,7 +776,7 @@ DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
|
|
|
776
776
|
},
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
-
VERSION = '
|
|
779
|
+
VERSION = '20250622'
|
|
780
780
|
|
|
781
781
|
NAMED_DICT = {
|
|
782
782
|
"unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
|
|
@@ -884,12 +884,20 @@ class Sample:
|
|
|
884
884
|
# self.__version = '20250301' # update sample info
|
|
885
885
|
# self.__version = '20250321' # error sigma adjustment
|
|
886
886
|
# self.__version = '20250328' # Experiment info
|
|
887
|
-
self.__version = '20250404' # J normalization factor
|
|
887
|
+
# self.__version = '20250404' # J normalization factor
|
|
888
|
+
self.__version = '20250622' # version setter
|
|
888
889
|
|
|
889
890
|
@property
|
|
890
891
|
def version(self):
|
|
891
892
|
return self.__version
|
|
892
893
|
|
|
894
|
+
@version.setter
|
|
895
|
+
def version(self, v):
|
|
896
|
+
if isinstance(v, (str, int)) and str(v).startswith("20"):
|
|
897
|
+
self.__version = str(v)
|
|
898
|
+
else:
|
|
899
|
+
raise ValueError("Version setter Error")
|
|
900
|
+
|
|
893
901
|
def help(self) -> str: ...
|
|
894
902
|
|
|
895
903
|
def name(self) -> str: ...
|
|
@@ -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.
|
|
19
|
+
version='0.1.29', # 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
|
|
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
|
|
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
|
|
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
|