majoplot 0.1.9__tar.gz → 0.1.11__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 (44) hide show
  1. {majoplot-0.1.9 → majoplot-0.1.11}/PKG-INFO +1 -1
  2. {majoplot-0.1.9 → majoplot-0.1.11}/pyproject.toml +1 -1
  3. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/importers/PPMS_Resistivity.py +94 -3
  4. majoplot-0.1.11/src/majoplot/domain/scenarios/PPMS_Resistivity/RT.py +127 -0
  5. majoplot-0.1.9/src/majoplot/domain/scenarios/PPMS_Resistivity/RT.py → majoplot-0.1.11/src/majoplot/domain/scenarios/PPMS_Resistivity/RT_Resistance.py +3 -3
  6. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/VSM/ChiT.py +2 -2
  7. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/VSM/ChiT_onlyZFC.py +2 -2
  8. majoplot-0.1.9/src/majoplot/domain/scenarios/VSM/MT_origin.py → majoplot-0.1.11/src/majoplot/domain/scenarios/VSM/MT_original.py +1 -1
  9. {majoplot-0.1.9 → majoplot-0.1.11}/uv.lock +1 -1
  10. {majoplot-0.1.9 → majoplot-0.1.11}/.gitignore +0 -0
  11. {majoplot-0.1.9 → majoplot-0.1.11}/LICENSE +0 -0
  12. {majoplot-0.1.9 → majoplot-0.1.11}/README.md +0 -0
  13. {majoplot-0.1.9 → majoplot-0.1.11}/README.zh-CN.md +0 -0
  14. {majoplot-0.1.9 → majoplot-0.1.11}/TODO.md +0 -0
  15. {majoplot-0.1.9 → majoplot-0.1.11}/doc.zh-CN/Label.md +0 -0
  16. {majoplot-0.1.9 → majoplot-0.1.11}/doc.zh-CN/interactive_steps.md +0 -0
  17. {majoplot-0.1.9 → majoplot-0.1.11}/doc.zh-CN/main_design.md +0 -0
  18. {majoplot-0.1.9 → majoplot-0.1.11}/doc.zh-CN/note_of_labtalk.md +0 -0
  19. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/__init__.py +0 -0
  20. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/__main__.py +0 -0
  21. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/app/__init__.py +0 -0
  22. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/app/cli.py +0 -0
  23. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/app/gui.py +0 -0
  24. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/config.json +0 -0
  25. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/base.py +0 -0
  26. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/importers/VSM.py +0 -0
  27. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/importers/XRD.py +0 -0
  28. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/muti_axes_spec.py +0 -0
  29. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/VSM/MT.py +0 -0
  30. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/VSM/MT_insert.py +0 -0
  31. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/VSM/MT_reliability_analysis.py +0 -0
  32. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/scenarios/XRD/Compare.py +0 -0
  33. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/domain/utils.py +0 -0
  34. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/gui/__init__.py +0 -0
  35. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/gui/main.py +0 -0
  36. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/infra/plotters/matplot.py +0 -0
  37. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/infra/plotters/origin.py +0 -0
  38. {majoplot-0.1.9 → majoplot-0.1.11}/src/majoplot/infra/plotters/origin_utils/originlab_type_library.py +0 -0
  39. {majoplot-0.1.9 → majoplot-0.1.11}/tests/README.md +0 -0
  40. {majoplot-0.1.9 → majoplot-0.1.11}/tests/conftest.py +0 -0
  41. {majoplot-0.1.9 → majoplot-0.1.11}/tests/domain/test_data_ignore_outliers.py +0 -0
  42. {majoplot-0.1.9 → majoplot-0.1.11}/tests/domain/test_insert_axes_spec.py +0 -0
  43. {majoplot-0.1.9 → majoplot-0.1.11}/tests/domain/test_labeldict_group.py +0 -0
  44. {majoplot-0.1.9 → majoplot-0.1.11}/tests/domain/test_labelvalue.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: majoplot
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Automates scenario-specific data preprocessing and plotting workflows for condensed-matter physics labs (OriginLab COM backend + Matplotlib for preview).
5
5
  Project-URL: Homepage, https://github.com/ponyofshadows/majoplot
6
6
  Project-URL: Source, https://github.com/ponyofshadows/majoplot
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "majoplot"
3
- version = "0.1.9"
3
+ version = "0.1.11"
4
4
  description = "Automates scenario-specific data preprocessing and plotting workflows for condensed-matter physics labs (OriginLab COM backend + Matplotlib for preview)."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -6,10 +6,16 @@ from ..utils import skip_lines_then_readline
6
6
 
7
7
  ROW_FILEOPENTIME = 3
8
8
  ROW_SAMPLE1_NAME = 6
9
+ ROW_SAMPLE1_CROSS_SECTION = 7
10
+ ROW_SAMPLE1_LENGTH = 8
9
11
  ROW_SAMPLE1_UNITS = 9
10
12
  ROW_SAMPLE2_NAME = 10
13
+ ROW_SAMPLE2_CROSS_SECTION = 11
14
+ ROW_SAMPLE2_LENGTH = 12
11
15
  ROW_SAMPLE2_UNITS = 13
12
16
  ROW_SAMPLE3_NAME = 14
17
+ ROW_SAMPLE3_CROSS_SECTION = 15
18
+ ROW_SAMPLE3_LENGTH = 16
13
19
  ROW_SAMPLE3_UNITS = 17
14
20
  ROW_HEADERS = 32
15
21
 
@@ -52,8 +58,36 @@ class PPMS_Resistivity:
52
58
  return fail_signal
53
59
  labels["sample1_name"] = LabelValue(s1_name)
54
60
 
61
+ # S1 Cross Section
62
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE1_CROSS_SECTION - ROW_SAMPLE1_NAME -1)
63
+ info = line.split(",")
64
+ try:
65
+ if info[-1].strip() != "Sample1 Cross Section":
66
+ return fail_signal
67
+ s1_cross_section = info[1]
68
+ except IndexError:
69
+ return fail_signal
70
+ try:
71
+ labels["sample1_cross_section"] = LabelValue(float(s1_cross_section),unit="mm²")
72
+ except ValueError:
73
+ return fail_signal
74
+
75
+ # S1 Length
76
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE1_LENGTH - ROW_SAMPLE1_CROSS_SECTION -1)
77
+ info = line.split(",")
78
+ try:
79
+ if info[-1].strip() != "Sample1 Length":
80
+ return fail_signal
81
+ s1_length = info[1]
82
+ except IndexError:
83
+ return fail_signal
84
+ try:
85
+ labels["sample1_length"] = LabelValue(float(s1_length),unit="mm")
86
+ except ValueError:
87
+ return fail_signal
88
+
55
89
  # S1 Units
56
- line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE1_UNITS - ROW_SAMPLE1_NAME -1)
90
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE1_UNITS - ROW_SAMPLE1_LENGTH -1)
57
91
  info = line.split(",")
58
92
  try:
59
93
  if info[-1].strip() != "Sample1 Units":
@@ -74,8 +108,37 @@ class PPMS_Resistivity:
74
108
  return fail_signal
75
109
  labels["sample2_name"] = LabelValue(s2_name)
76
110
 
111
+ # S2 Cross Section
112
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE2_CROSS_SECTION - ROW_SAMPLE2_NAME -1)
113
+ info = line.split(",")
114
+ try:
115
+ if info[-1].strip() != "Sample2 Cross Section":
116
+ return fail_signal
117
+ s2_cross_section = info[1]
118
+ except IndexError:
119
+ return fail_signal
120
+ try:
121
+ labels["sample2_cross_section"] = LabelValue(float(s2_cross_section),unit="mm²")
122
+ except ValueError:
123
+ return fail_signal
124
+
125
+ # S1 Length
126
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE2_LENGTH - ROW_SAMPLE2_CROSS_SECTION -1)
127
+ info = line.split(",")
128
+ try:
129
+ if info[-1].strip() != "Sample2 Length":
130
+ return fail_signal
131
+ s2_length = info[1]
132
+ except IndexError:
133
+ return fail_signal
134
+ try:
135
+ labels["sample2_length"] = LabelValue(float(s2_length),unit="mm")
136
+ except ValueError:
137
+ return fail_signal
138
+
139
+
77
140
  # S2 Units
78
- line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE2_UNITS - ROW_SAMPLE2_NAME -1)
141
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE2_UNITS - ROW_SAMPLE2_LENGTH -1)
79
142
  info = line.split(",")
80
143
  try:
81
144
  if info[-1].strip() != "Sample2 Units":
@@ -96,8 +159,36 @@ class PPMS_Resistivity:
96
159
  return fail_signal
97
160
  labels["sample3_name"] = LabelValue(s3_name)
98
161
 
162
+ # S3 Cross Section
163
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE3_CROSS_SECTION - ROW_SAMPLE3_NAME -1)
164
+ info = line.split(",")
165
+ try:
166
+ if info[-1].strip() != "Sample3 Cross Section":
167
+ return fail_signal
168
+ s3_cross_section = info[1]
169
+ except IndexError:
170
+ return fail_signal
171
+ try:
172
+ labels["sample3_cross_section"] = LabelValue(float(s3_cross_section),unit="mm²")
173
+ except ValueError:
174
+ return fail_signal
175
+
176
+ # S1 Length
177
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE3_LENGTH - ROW_SAMPLE3_CROSS_SECTION -1)
178
+ info = line.split(",")
179
+ try:
180
+ if info[-1].strip() != "Sample3 Length":
181
+ return fail_signal
182
+ s3_length = info[1]
183
+ except IndexError:
184
+ return fail_signal
185
+ try:
186
+ labels["sample3_length"] = LabelValue(float(s3_length),unit="mm")
187
+ except ValueError:
188
+ return fail_signal
189
+
99
190
  # S3 Units
100
- line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE3_UNITS - ROW_SAMPLE3_NAME -1)
191
+ line = skip_lines_then_readline(raw_data_file, ROW_SAMPLE3_UNITS - ROW_SAMPLE3_LENGTH -1)
101
192
  info = line.split(",")
102
193
  try:
103
194
  if info[-1].strip() != "Sample3 Units":
@@ -0,0 +1,127 @@
1
+ from __future__ import annotations
2
+
3
+ from ...base import *
4
+
5
+
6
+ FIGSIZE = (8, 6)
7
+
8
+ T = "Temperature (K)"
9
+ H = "Magnetic Field (Oe)"
10
+ R = "Resistivity (Ω·m)"
11
+ _headers = (T,R)
12
+ RI ={
13
+ 1: {"R":"Bridge 1 Resistance (Ohms)", "I":"Bridge 1 Excitation (uA)"},
14
+ 2: {"R":"Bridge 2 Resistance (Ohms)", "I":"Bridge 2 Excitation (uA)"},
15
+ 3: {"R":"Bridge 3 Resistance (Ohms)", "I":"Bridge 3 Excitation (uA)"},
16
+ }
17
+
18
+ class RT:
19
+ data_summary_label_names = ["H"]
20
+ axes_label_names = ("date", "raw_data", "bridge", "sample_name")
21
+ figure_label_names = ("date", "raw_data", "bridge", "sample_name")
22
+ figure_summary_label_names = ("raw_data","bridge","sample_name")
23
+ max_axes_in_one_figure = 1
24
+ project_to_child_folder_label_names = {"date":"sample_name"}
25
+ parent_folder_name = "RT"
26
+
27
+ @classmethod
28
+ def preprocess(cls, raw_datas:list[Data])->list[Data]:
29
+ datas = []
30
+ for raw_data in raw_datas:
31
+ raw_labels = raw_data.labels
32
+ headers = raw_data.headers
33
+ raw_points = raw_data.points
34
+
35
+ # Split by H
36
+ split_datas = []
37
+
38
+ last_H_stage = round(raw_points[0][headers[H]])
39
+ current_points = [ last_H_stage, [ raw_points[0] ] ]
40
+
41
+ for point in raw_points[1:]:
42
+ cur_H_stage = round(point[headers[H]])
43
+ if cur_H_stage != last_H_stage:
44
+ split_datas.append(current_points)
45
+ last_H_stage = cur_H_stage
46
+ current_points = [ last_H_stage, [ point ] ]
47
+ else:
48
+ current_points[1].append(point)
49
+ else:
50
+ split_datas.append(current_points)
51
+
52
+ # 3 bridges
53
+ for H_stage, points in split_datas:
54
+ for i in range(1,4):
55
+ _headerTRI = (T,RI[i]["R"],RI[i]["I"])
56
+ s_points = [ [point[headers[x]] for x in _headerTRI] for point in points]
57
+ # clear null Resistance points
58
+ s_points = np.array([point for point in s_points if point[1]])
59
+ # calculate resistivity
60
+ cross_section = raw_labels[f"sample{i}_cross_section"].value * 1e-6
61
+ if cross_section <= 0:
62
+ cross_section = np.nan
63
+ length = raw_labels[f"sample{i}_length"].value * 1e-3
64
+ if length <= 0:
65
+ length = np.nan
66
+ r_points = np.column_stack([s_points[:,0], s_points[:,1] * cross_section / length])
67
+ # record
68
+ Imin = np.min(s_points[:,2])
69
+ Imax = np.max(s_points[:,2])
70
+ if (Imax - Imin) / Imax < 0.03:
71
+ Irange = f"{np.mean(s_points[:,1]):.1e}"
72
+ else:
73
+ Irange = f"{Imin:.1e}~{Imax:.1e}"
74
+ labels = LabelDict()
75
+ labels["instrument"] = raw_labels["instrument"]
76
+ labels["raw_data"] = raw_labels["raw_data"]
77
+ labels["date"] = raw_labels["date"]
78
+ labels["bridge"] = LabelValue(i,unit="Bridge",unit_as_postfix=False)
79
+ labels["sample_name"] = raw_labels[f"sample{i}_name"]
80
+ labels["sample_units"] = raw_labels[f"sample{i}_units"]
81
+ labels["H"] = LabelValue(H_stage, unit="Oe")
82
+ labels["I_range"] = LabelValue(Irange,unit="μA")
83
+ labels.summary_names = cls.data_summary_label_names
84
+ datas.append(Data(
85
+ labels=labels,
86
+ _headers=_headers,
87
+ points=r_points,
88
+ ignore_outliers=IgnoreOutlierSpec(min_gap_base=1e-8,min_gap_multiple=10),
89
+ ))
90
+
91
+ return datas
92
+
93
+
94
+
95
+ @classmethod
96
+ def make_axes_spec(cls, axes_labels, data_pool)->AxesSpec:
97
+ return AxesSpec(
98
+ x_axis_title=T,
99
+ y_axis_title=R,
100
+ major_grid=None,
101
+ major_tick=TickSpec(),
102
+ legend=LegendSpec(fontsize=5),
103
+ )
104
+
105
+
106
+ @classmethod
107
+ def make_figure_spec(cls,figure_labels, axes_pool:Iterable[Axes])->FigureSpec:
108
+ figure_name = figure_labels.brief_summary
109
+
110
+ return FigureSpec(
111
+ name=figure_name,
112
+ title=None,
113
+ figsize=FIGSIZE,
114
+ linestyle_cycle= ("-",),
115
+ linecolor_cycle = (
116
+ "#2d0b59", "#3b0f6f", "#4a136e", "#5a176e", "#6a1c6e",
117
+ "#7a216f", "#8b2770", "#9b2d71", "#ac3372", "#bd3973",
118
+ "#ce4074", "#df4775", "#f04f76", "#f86a5a", "#fb8c3c",
119
+ "#fdbb2d", "#fcfdbf",
120
+ ),
121
+ linemarker_cycle = ("o","s","^","v","d","*","x","+"),
122
+ alpa_cycle = (1.0,),
123
+ )
124
+
125
+ @classmethod
126
+ def make_muti_axes_spec(cls, axes_pool:list[Axes])->MutiAxesSpec|FAIL|None:
127
+ return None
@@ -14,7 +14,7 @@ RI ={
14
14
  3: {"R":"Bridge 3 Resistance (Ohms)", "I":"Bridge 3 Excitation (uA)"},
15
15
  }
16
16
 
17
- class RT:
17
+ class RT_Resistance:
18
18
  data_summary_label_names = ["H"]
19
19
  axes_label_names = ("date", "raw_data", "bridge", "sample_name")
20
20
  figure_label_names = ("date", "raw_data", "bridge", "sample_name")
@@ -57,8 +57,8 @@ class RT:
57
57
  # clear null R points
58
58
  s_points = np.array([point for point in s_points if point[1]])
59
59
  # record
60
- Imin = np.min(s_points[:,1])
61
- Imax = np.max(s_points[:,1])
60
+ Imin = np.min(s_points[:,2])
61
+ Imax = np.max(s_points[:,2])
62
62
  if (Imax - Imin) / Imax < 0.03:
63
63
  Irange = f"{np.mean(s_points[:,1]):.1e}"
64
64
  else:
@@ -9,7 +9,7 @@ FIGSIZE = (8, 6)
9
9
  T = "Temperature (K)"
10
10
  M = "DC Moment Free Ctr (emu)"
11
11
  H = "Magnetic Field (Oe)"
12
- chi = "χ ( m³ / kg )"
12
+ chi = "χ ( cm³ / g )"
13
13
 
14
14
 
15
15
  class ChiT:
@@ -69,7 +69,7 @@ class ChiT:
69
69
  if mass == 0:
70
70
  mass = np.nan
71
71
  safe_H_stage = np.nan if H_stage == 0 else H_stage
72
- chi_points = np.column_stack([a_points[:,0], a_points[:,1] / safe_H_stage * 1e6 / mass])
72
+ chi_points = np.column_stack([a_points[:,0], a_points[:,1] / safe_H_stage * 1e3 / mass])
73
73
  datas.append(
74
74
  Data(
75
75
  labels=labels,
@@ -9,7 +9,7 @@ FIGSIZE = (8, 6)
9
9
  T = "Temperature (K)"
10
10
  M = "DC Moment Free Ctr (emu)"
11
11
  H = "Magnetic Field (Oe)"
12
- chi = "χ ( m³ / kg )"
12
+ chi = "χ ( cm³ / g )"
13
13
 
14
14
 
15
15
  class ChiT_onlyZFC:
@@ -70,7 +70,7 @@ class ChiT_onlyZFC:
70
70
  if mass == 0:
71
71
  mass = np.nan
72
72
  safe_H_stage = np.nan if H_stage == 0 else H_stage
73
- chi_points = np.column_stack([a_points[:,0], a_points[:,1] / safe_H_stage * 1e6 / mass])
73
+ chi_points = np.column_stack([a_points[:,0], a_points[:,1] / safe_H_stage * 1e3 / mass])
74
74
  datas.append(
75
75
  Data(
76
76
  labels=labels,
@@ -11,7 +11,7 @@ M = "DC Moment Free Ctr (emu)"
11
11
  H = "Magnetic Field (Oe)"
12
12
 
13
13
 
14
- class MT_origin:
14
+ class MT_original:
15
15
  data_summary_label_names = ["mass","H","cooling_type"]
16
16
  axes_label_names = ("material","date","raw_data", "H")
17
17
  figure_label_names = ("material","date", "raw_data","H")
@@ -252,7 +252,7 @@ wheels = [
252
252
 
253
253
  [[package]]
254
254
  name = "majoplot"
255
- version = "0.1.9"
255
+ version = "0.1.11"
256
256
  source = { editable = "." }
257
257
  dependencies = [
258
258
  { name = "matplotlib" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes