ararpy 0.1.198__py3-none-any.whl → 0.2.1__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/Example - Check arr.py +52 -0
- ararpy/Example - Granite Cooling History.py +411 -0
- ararpy/Example - Plot temperature calibration.py +291 -0
- ararpy/Example - Show MDD results.py +561 -0
- ararpy/Example - Show all Kfs age spectra.py +344 -0
- ararpy/Example - Show random walk results.py +363 -0
- ararpy/Example - Tc calculation.py +437 -0
- ararpy/__init__.py +3 -4
- ararpy/calc/age.py +34 -36
- ararpy/calc/arr.py +5 -24
- ararpy/calc/basic.py +26 -3
- ararpy/calc/corr.py +135 -89
- ararpy/calc/jvalue.py +1 -1
- ararpy/calc/plot.py +6 -4
- ararpy/calc/raw_funcs.py +41 -2
- ararpy/calc/regression.py +224 -132
- ararpy/files/arr_file.py +2 -1
- ararpy/files/basic.py +0 -22
- ararpy/files/calc_file.py +107 -84
- ararpy/files/raw_file.py +242 -229
- ararpy/smp/basic.py +202 -46
- ararpy/smp/calculation.py +6 -6
- ararpy/smp/corr.py +339 -154
- ararpy/smp/diffusion_funcs.py +345 -36
- ararpy/smp/export.py +247 -129
- ararpy/smp/info.py +2 -2
- ararpy/smp/initial.py +105 -48
- ararpy/smp/json.py +2 -2
- ararpy/smp/plots.py +225 -218
- ararpy/smp/raw.py +11 -15
- ararpy/smp/sample.py +257 -183
- ararpy/smp/style.py +48 -22
- ararpy/smp/table.py +42 -33
- ararpy/thermo/atomic_level_random_walk.py +56 -48
- ararpy/thermo/basic.py +2 -2
- {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/METADATA +1 -1
- ararpy-0.2.1.dist-info/RECORD +73 -0
- {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/WHEEL +1 -1
- ararpy-0.1.198.dist-info/RECORD +0 -66
- {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/top_level.txt +0 -0
ararpy/smp/raw.py
CHANGED
|
@@ -22,7 +22,7 @@ RawData = samples.RawData
|
|
|
22
22
|
Sequence = samples.Sequence
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
def to_raw(file_path: Union[str, List[str]], input_filter_path: Union[str, List[str]], **kwargs):
|
|
25
|
+
def to_raw(file_path: Union[str, List[str]], input_filter_path: Union[str, List[str]], file_name=None, **kwargs):
|
|
26
26
|
""" Read raw data from files, can create raw data instance based on the given files
|
|
27
27
|
Raw data will have the structure like:
|
|
28
28
|
[
|
|
@@ -35,6 +35,7 @@ def to_raw(file_path: Union[str, List[str]], input_filter_path: Union[str, List[
|
|
|
35
35
|
----------
|
|
36
36
|
file_path
|
|
37
37
|
input_filter_path
|
|
38
|
+
file_name
|
|
38
39
|
kwargs
|
|
39
40
|
|
|
40
41
|
Returns
|
|
@@ -42,22 +43,18 @@ def to_raw(file_path: Union[str, List[str]], input_filter_path: Union[str, List[
|
|
|
42
43
|
|
|
43
44
|
"""
|
|
44
45
|
if isinstance(file_path, list) and isinstance(input_filter_path, list):
|
|
45
|
-
raw = concatenate([to_raw(file, input_filter_path[index]
|
|
46
|
+
raw = concatenate([to_raw(file, input_filter_path[index],
|
|
47
|
+
file_name[index] if isinstance(file_name, list) else file_name) for index, file in enumerate(file_path)])
|
|
46
48
|
elif isinstance(file_path, str) and isinstance(input_filter_path, str):
|
|
47
49
|
input_filter = read_params(input_filter_path)
|
|
48
|
-
file_name = str(os.path.split(file_path)[-1]).split('.')[0]
|
|
49
|
-
res = raw_file.open_file(file_path, input_filter)
|
|
50
|
+
file_name = str(os.path.split(file_path)[-1]).split('.')[0] if file_name is None else file_name
|
|
51
|
+
res = raw_file.open_file(file_path, input_filter, file_name)
|
|
50
52
|
data = res.get('data', None)
|
|
51
53
|
sequences = res.get('sequences', None)
|
|
52
54
|
sequence_num = len(data) if data is not None else len(sequences)
|
|
53
|
-
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
# <option value=2>Exponential</option>
|
|
57
|
-
# <option value=3>Power</option>
|
|
58
|
-
# <option value=4>Average</option>
|
|
59
|
-
fitting_method = [2, 0, 2, 2, 2]
|
|
60
|
-
raw = RawData(name=file_name, data=data, isotopic_num=10, sequence_num=sequence_num, source=[file_path],
|
|
55
|
+
experiment_name = data[0][0][2]['ExpName'] if data is not None else file_name
|
|
56
|
+
fitting_method = [2, 0, 2, 2, 2] # 0 - linear, 1 - quadratic, 2 - exponential, 3 - power, 4 - average
|
|
57
|
+
raw = RawData(name=experiment_name, data=data, isotopic_num=10, sequence_num=sequence_num, source=[file_path],
|
|
61
58
|
sequence=sequences, unit=str(input_filter[30]), fitting_method=[*fitting_method])
|
|
62
59
|
else:
|
|
63
60
|
raise ValueError("File path and input filter should be both string or list with a same length.")
|
|
@@ -156,11 +153,10 @@ def do_regression(raw: RawData, sequence_index: Optional[List] = None, isotopic_
|
|
|
156
153
|
# unselected: list = [unselected[[isotopic_index*2 + 1, 2 * (isotopic_index + 1)]].dropna().values.tolist()
|
|
157
154
|
# for isotopic_index in list(range(5))]
|
|
158
155
|
|
|
159
|
-
for index,
|
|
156
|
+
for index, isotopic_data in enumerate(selected):
|
|
160
157
|
if hasattr(isotopic_index, '__getitem__') and index not in isotopic_index:
|
|
161
158
|
continue
|
|
162
|
-
|
|
163
|
-
res = raw_funcs.get_raw_data_regression_results(isotope)
|
|
159
|
+
res = raw_funcs.get_raw_data_regression_results(isotopic_data)
|
|
164
160
|
try:
|
|
165
161
|
sequence.results[index] = res[1]
|
|
166
162
|
sequence.coefficients[index] = res[2]
|