ararpy 0.1.11__py3-none-any.whl → 0.1.13__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/calc/arr.py +4 -1
- ararpy/calc/basic.py +36 -14
- ararpy/calc/corr.py +15 -30
- ararpy/calc/isochron.py +4 -2
- ararpy/calc/raw_funcs.py +2 -2
- ararpy/calc/regression.py +3 -1
- ararpy/examples/WHA.pdf +2863 -0
- ararpy/files/calc_file.py +1 -1
- ararpy/files/raw_file.py +84 -82
- ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +95 -0
- ararpy/smp/basic.py +9 -7
- ararpy/smp/calculation.py +4 -0
- ararpy/smp/corr.py +104 -56
- ararpy/smp/diffusion_funcs.py +285 -124
- ararpy/smp/export.py +464 -1
- ararpy/smp/json.py +12 -1
- ararpy/smp/plots.py +10 -6
- ararpy/smp/raw.py +9 -2
- ararpy/smp/sample.py +28 -12
- ararpy/smp/table.py +8 -0
- ararpy/test.py +63 -0
- {ararpy-0.1.11.dist-info → ararpy-0.1.13.dist-info}/METADATA +1 -1
- {ararpy-0.1.11.dist-info → ararpy-0.1.13.dist-info}/RECORD +26 -24
- {ararpy-0.1.11.dist-info → ararpy-0.1.13.dist-info}/WHEEL +1 -1
- {ararpy-0.1.11.dist-info → ararpy-0.1.13.dist-info}/LICENSE +0 -0
- {ararpy-0.1.11.dist-info → ararpy-0.1.13.dist-info}/top_level.txt +0 -0
ararpy/smp/table.py
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#
|
|
10
10
|
#
|
|
11
11
|
"""
|
|
12
|
+
import copy
|
|
12
13
|
from .. import calc
|
|
13
14
|
from . import (sample as samples, basic)
|
|
14
15
|
|
|
@@ -47,6 +48,13 @@ def update_table_data(smp: Sample, only_table: str = None):
|
|
|
47
48
|
data = calc.arr.merge(
|
|
48
49
|
smp.SequenceName, smp.SequenceValue, *smp.DegasValues)
|
|
49
50
|
elif key == '5':
|
|
51
|
+
smp.PublishValues[0] = copy.deepcopy(smp.DegasValues[ 0])
|
|
52
|
+
smp.PublishValues[1] = copy.deepcopy(smp.DegasValues[ 8])
|
|
53
|
+
smp.PublishValues[2] = copy.deepcopy(smp.DegasValues[10])
|
|
54
|
+
smp.PublishValues[3] = copy.deepcopy(smp.DegasValues[20])
|
|
55
|
+
smp.PublishValues[4] = copy.deepcopy(smp.DegasValues[24])
|
|
56
|
+
smp.PublishValues[5:7] = copy.deepcopy(smp.ApparentAgeValues[2:4])
|
|
57
|
+
smp.PublishValues[7:9] = copy.deepcopy(smp.ApparentAgeValues[6:8])
|
|
50
58
|
data = calc.arr.merge(
|
|
51
59
|
smp.SequenceName, smp.SequenceValue, *smp.PublishValues)
|
|
52
60
|
elif key == '6':
|
ararpy/test.py
CHANGED
|
@@ -33,5 +33,68 @@ def test():
|
|
|
33
33
|
print(sample.blank().to_df().iloc[:, [1, 2, 3]])
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
def export_pdf_demo():
|
|
37
|
+
import numpy as np
|
|
38
|
+
import pdf_maker as pm
|
|
39
|
+
|
|
40
|
+
example_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), r'examples')
|
|
41
|
+
|
|
42
|
+
# ------ 将以下五个样品的年龄谱图组合到一起 -------
|
|
43
|
+
arr_files = [
|
|
44
|
+
os.path.join(example_dir, r'22WHA0433.arr'),
|
|
45
|
+
os.path.join(example_dir, r'20WHA0103.age'),
|
|
46
|
+
]
|
|
47
|
+
colors = ['#1f3c40', '#e35000', '#e1ae0f', '#3d8ebf']
|
|
48
|
+
series = []
|
|
49
|
+
|
|
50
|
+
# ------ 构建数据 -------
|
|
51
|
+
for index, file in enumerate(arr_files):
|
|
52
|
+
smp = ap.from_arr(file_path=file) if file.endswith('.arr') else ap.from_age(file_path=file)
|
|
53
|
+
age = smp.ApparentAgeValues[2:4]
|
|
54
|
+
ar = smp.DegasValues[20]
|
|
55
|
+
data = ap.calc.spectra.get_data(*age, ar, cumulative=False)
|
|
56
|
+
series.append({
|
|
57
|
+
'type': 'series.line', 'id': f'line{index * 2 + 0}', 'name': f'line{index * 2 + 0}', 'color': colors[index],
|
|
58
|
+
'data': np.transpose([data[0], data[1]]).tolist(), 'line_caps': 'square',
|
|
59
|
+
})
|
|
60
|
+
series.append({
|
|
61
|
+
'type': 'series.line', 'id': f'line{index * 2 + 1}', 'name': f'line{index * 2 + 1}', 'color': colors[index],
|
|
62
|
+
'data': np.transpose([data[0], data[2]]).tolist(), 'line_caps': 'square',
|
|
63
|
+
})
|
|
64
|
+
series.append({
|
|
65
|
+
'type': 'text', 'id': f'text{index * 2 + 0}', 'name': f'text{index * 2 + 0}', 'color': colors[index],
|
|
66
|
+
'text': f'{smp.name()}<r>{round(smp.Info.results.age_plateau[0]["age"], 2)}',
|
|
67
|
+
'size': 10, 'data': [[index * 15 + 5, 23]],
|
|
68
|
+
})
|
|
69
|
+
data = {
|
|
70
|
+
"data": [
|
|
71
|
+
{
|
|
72
|
+
'xAxis': [{'extent': [0, 100], 'interval': [0, 20, 40, 60, 80, 100],
|
|
73
|
+
'title': 'Cumulative <sup>39</sup>Ar Released (%)', 'nameLocation': 'middle', }],
|
|
74
|
+
'yAxis': [{'extent': [0, 250], 'interval': [0, 50, 100, 150, 200, 250],
|
|
75
|
+
'title': 'Apparent Age (Ma)', 'nameLocation': 'middle', }],
|
|
76
|
+
'series': series
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"file_name": "WHA",
|
|
80
|
+
"plot_names": ["all age plateaus"],
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# write pdf
|
|
84
|
+
file = pm.NewPDF(filepath=os.path.join(example_dir, f"{data['file_name']}.pdf"))
|
|
85
|
+
for index, each in enumerate(data['data']):
|
|
86
|
+
# rich text tags should follow this priority: color > script > break
|
|
87
|
+
file.text(page=index, x=50, y=780, line_space=1.2, size=12, base=0, h_align="left",
|
|
88
|
+
text=f"The PDF can be edited with Adobe Acrobat, Illustrator and CorelDRAW")
|
|
89
|
+
cv = ap.smp.export.export_chart_to_pdf(each)
|
|
90
|
+
file.canvas(page=index, base=0, margin_top=5, canvas=cv, unit="cm", h_align="middle")
|
|
91
|
+
if index + 1 < len(data['data']):
|
|
92
|
+
file.add_page()
|
|
93
|
+
|
|
94
|
+
# save pdf
|
|
95
|
+
file.save()
|
|
96
|
+
|
|
97
|
+
|
|
36
98
|
if __name__ == "__main__":
|
|
37
99
|
test()
|
|
100
|
+
# export_pdf_demo()
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
ararpy/__init__.py,sha256=XKlsgklkzGfvqQkt59y-UST9aVhgCf-eXpEDiaZaynQ,6725
|
|
2
|
-
ararpy/test.py,sha256=
|
|
2
|
+
ararpy/test.py,sha256=4F46-JJ1Ge12HGae0qO44Qc6kiEMHBgn2MsY_5LlHDo,3973
|
|
3
3
|
ararpy/calc/__init__.py,sha256=kUjRuLE8TLuKOv3i976RnGJoEMj23QBZDu37LWs81U4,322
|
|
4
4
|
ararpy/calc/age.py,sha256=CUex9UxZbYinl9ypd7o86R3VRQFzahku3gW__fBeoss,5811
|
|
5
|
-
ararpy/calc/arr.py,sha256=
|
|
6
|
-
ararpy/calc/basic.py,sha256=
|
|
7
|
-
ararpy/calc/corr.py,sha256=
|
|
5
|
+
ararpy/calc/arr.py,sha256=w31bn6MXF8I8qPXYo5kI-TfMKCYspx1rZ5g_UpwwSd8,14939
|
|
6
|
+
ararpy/calc/basic.py,sha256=0K0rbm9GpDpEZjQ1r7N-6w-dU-S3UzByOTrefLmjT0c,3231
|
|
7
|
+
ararpy/calc/corr.py,sha256=wCkpUZDQ3VFxfmy0eG6ehkIuMjKRfTNfW8ozH3i1lQc,17928
|
|
8
8
|
ararpy/calc/err.py,sha256=63LtprqjemlIb1QGDst4Ggcv5KMSDHdlAIL-nyQs1eA,2691
|
|
9
9
|
ararpy/calc/histogram.py,sha256=0GVbDdsjd91KQ1sa2B7NtZ4KGo0XpRIJapgIrzAwQUo,5777
|
|
10
|
-
ararpy/calc/isochron.py,sha256=
|
|
10
|
+
ararpy/calc/isochron.py,sha256=ej9G2e68k6yszonWHsLcEubh3TA7eh1upTJP_X0ttAA,5726
|
|
11
11
|
ararpy/calc/jvalue.py,sha256=zHUhJ1iYe5mPrY95mGYxoUPAp7hwu4coUgiHKiruKfM,1138
|
|
12
12
|
ararpy/calc/plot.py,sha256=v-vJwciJIhKrdXKWAUZbYslez0zBrIa6awI-DopmRZg,1956
|
|
13
|
-
ararpy/calc/raw_funcs.py,sha256=
|
|
14
|
-
ararpy/calc/regression.py,sha256=
|
|
13
|
+
ararpy/calc/raw_funcs.py,sha256=UNNdehMBZxrb8QpFsWXDXvDYae6y5veygI_St_hjp_U,2558
|
|
14
|
+
ararpy/calc/regression.py,sha256=dpyEiU1MKSn3lzcSF3A4AcQlS01dmhNvhatJvVQ9ZrY,40207
|
|
15
15
|
ararpy/calc/spectra.py,sha256=iBhuQ03PyIKHbAQSexx3fZ6ZYaxM6P_uMyWdUeeMck4,1936
|
|
16
16
|
ararpy/examples/022_VU124-M11a.ahd,sha256=3m0Gd-ZObou3KsnRNFMf77QwzT1Uz3nu3vA33Sqeyng,5414
|
|
17
17
|
ararpy/examples/20WHA0103.age,sha256=cT-a4d7Wt77aotx6v0G47vulY_TZIcZUcaVHB3pqTPM,380416
|
|
@@ -29,32 +29,34 @@ ararpy/examples/NGX-XLS.input-filter,sha256=iyfTLsLHf0h58ePOsNQoBtG6UBLIf7V-zTGi
|
|
|
29
29
|
ararpy/examples/Qtegra-exported-xls.input-filter,sha256=KuD3Dey82ecuKnqNMQqOcY3VXHgKbpE9Yxfl1ZC4_so,441
|
|
30
30
|
ararpy/examples/S01-239.csv,sha256=J_PHT85XCxPd3TEGzBARGwKSkiAzz1nzNbrKUf00GBU,39566
|
|
31
31
|
ararpy/examples/WH01.irra,sha256=Ws78m5p3fD4oybtkOWoAtvFyuLPxpL_A_ueIg2tnhnw,365
|
|
32
|
+
ararpy/examples/WHA.pdf,sha256=iopbptHkWPmYdgihEVDDfv2nm2XE-Q-e7fFnkR44Xh0,178692
|
|
32
33
|
ararpy/examples/raw_example.xls,sha256=ftcSiXRx_7nYnbqJVma1Yl3Yr_iuceAWlEjhJwlAvFM,1929895
|
|
33
34
|
ararpy/examples/sample-default.smp,sha256=YNkoQGgPrsL_fXS7ZHxfRtLQWekCDqT9czS6vBScImk,432
|
|
34
35
|
ararpy/files/__init__.py,sha256=l5B5ZQ01WdtvjjN0aMkyAFNgpwANdM_1I0tQbqnRuEY,69
|
|
35
36
|
ararpy/files/arr_file.py,sha256=KqksGlEA6nmMQofTgi7v45flscQZVtefxaNCKrV3Am4,837
|
|
36
37
|
ararpy/files/basic.py,sha256=nc7Hgo_qLSkdmtKzZmd5SQ8Jy0dhW46ly4gh-oisUDs,2095
|
|
37
|
-
ararpy/files/calc_file.py,sha256=
|
|
38
|
+
ararpy/files/calc_file.py,sha256=fYPwJxazhxxHS1BCI9q7CJW-VIyJZ8UAh6Z8bO9DmLY,27864
|
|
38
39
|
ararpy/files/new_file.py,sha256=efblARIBROVLWS2w3-98BxLX5VZ8grRpiTkJFtf_rAk,214
|
|
39
|
-
ararpy/files/raw_file.py,sha256=
|
|
40
|
+
ararpy/files/raw_file.py,sha256=aVHlebiGpxHGj_z9mrTR-Y2JEivxa4k1MJZ1TFXyMnA,22319
|
|
40
41
|
ararpy/files/xls.py,sha256=8ibT4ZRY2grK34ikKm1pDmlWFlVTgDL7vSMO6mphzrY,702
|
|
42
|
+
ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py,sha256=baDM437tu6hsPv0uYfod0TREXlPd6kvMBFT1S9ZZlkk,3024
|
|
41
43
|
ararpy/smp/__init__.py,sha256=k6_fa27UJsQK7K7oC5GYlwMo6l0Xd8af3QtOrZz2XJk,478
|
|
42
|
-
ararpy/smp/basic.py,sha256=
|
|
43
|
-
ararpy/smp/calculation.py,sha256=
|
|
44
|
+
ararpy/smp/basic.py,sha256=Jufv_4zXO1-XbmwM4UUrvZsp4tRGD05ec-035u8CiEs,21533
|
|
45
|
+
ararpy/smp/calculation.py,sha256=LCFJWjLVLEKEQ5b7RFUIxsMahEzgLdodW4kCYXV5Z34,2919
|
|
44
46
|
ararpy/smp/consts.py,sha256=XIdjdz8cYxspG2jMnoItdlUsxr3hKbNFJjMZJh1bpzw,393
|
|
45
|
-
ararpy/smp/corr.py,sha256=
|
|
46
|
-
ararpy/smp/diffusion_funcs.py,sha256=
|
|
47
|
-
ararpy/smp/export.py,sha256=
|
|
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
|
|
48
50
|
ararpy/smp/info.py,sha256=iKUELm-BuUduDlJKC1d8tKKNHbwwbNmhUg2pi6bcBvA,489
|
|
49
51
|
ararpy/smp/initial.py,sha256=nZNrV4fv_PlNXYfqqIOOOkcQjnSOTLymVpJyJ9d_QtM,15359
|
|
50
|
-
ararpy/smp/json.py,sha256=
|
|
51
|
-
ararpy/smp/plots.py,sha256=
|
|
52
|
-
ararpy/smp/raw.py,sha256=
|
|
53
|
-
ararpy/smp/sample.py,sha256=
|
|
52
|
+
ararpy/smp/json.py,sha256=Y7xoTZczSTrvVHlhfLmpu-zoxgLw9MFn2lgRYkjgHTY,2079
|
|
53
|
+
ararpy/smp/plots.py,sha256=bM4ofS12NedBUXXleEy7-xcK9C8svVuSrTXYmeiMY3k,31495
|
|
54
|
+
ararpy/smp/raw.py,sha256=51n-rrbW2FqeZHQyevuG7iObPLGvIBzTe414QDVM1FE,6523
|
|
55
|
+
ararpy/smp/sample.py,sha256=3POkIxVXiCkZqa4ocePC76690umMa-7zYEM-iiEF7Cc,55192
|
|
54
56
|
ararpy/smp/style.py,sha256=NZwTeodhtHBBdCyjvupF64nh2B5EDdMHzlT8oE360zg,6746
|
|
55
|
-
ararpy/smp/table.py,sha256=
|
|
56
|
-
ararpy-0.1.
|
|
57
|
-
ararpy-0.1.
|
|
58
|
-
ararpy-0.1.
|
|
59
|
-
ararpy-0.1.
|
|
60
|
-
ararpy-0.1.
|
|
57
|
+
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,,
|
|
File without changes
|
|
File without changes
|