majoplot 0.1.11__tar.gz → 0.1.12__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 (45) hide show
  1. {majoplot-0.1.11 → majoplot-0.1.12}/PKG-INFO +1 -1
  2. {majoplot-0.1.11 → majoplot-0.1.12}/pyproject.toml +1 -1
  3. majoplot-0.1.11/src/majoplot/domain/scenarios/PPMS_Resistivity/RT_Resistance.py → majoplot-0.1.12/src/majoplot/domain/scenarios/PPMS_Resistivity/RT.py +10 -6
  4. majoplot-0.1.11/src/majoplot/domain/scenarios/PPMS_Resistivity/RT.py → majoplot-0.1.12/src/majoplot/domain/scenarios/PPMS_Resistivity/RT_Resistivity.py +15 -6
  5. majoplot-0.1.12/src/majoplot/domain/scenarios/PPMS_Resistivity/RT_normalized.py +142 -0
  6. {majoplot-0.1.11 → majoplot-0.1.12}/.gitignore +0 -0
  7. {majoplot-0.1.11 → majoplot-0.1.12}/LICENSE +0 -0
  8. {majoplot-0.1.11 → majoplot-0.1.12}/README.md +0 -0
  9. {majoplot-0.1.11 → majoplot-0.1.12}/README.zh-CN.md +0 -0
  10. {majoplot-0.1.11 → majoplot-0.1.12}/TODO.md +0 -0
  11. {majoplot-0.1.11 → majoplot-0.1.12}/doc.zh-CN/Label.md +0 -0
  12. {majoplot-0.1.11 → majoplot-0.1.12}/doc.zh-CN/interactive_steps.md +0 -0
  13. {majoplot-0.1.11 → majoplot-0.1.12}/doc.zh-CN/main_design.md +0 -0
  14. {majoplot-0.1.11 → majoplot-0.1.12}/doc.zh-CN/note_of_labtalk.md +0 -0
  15. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/__init__.py +0 -0
  16. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/__main__.py +0 -0
  17. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/app/__init__.py +0 -0
  18. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/app/cli.py +0 -0
  19. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/app/gui.py +0 -0
  20. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/config.json +0 -0
  21. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/base.py +0 -0
  22. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/importers/PPMS_Resistivity.py +0 -0
  23. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/importers/VSM.py +0 -0
  24. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/importers/XRD.py +0 -0
  25. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/muti_axes_spec.py +0 -0
  26. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/ChiT.py +0 -0
  27. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/ChiT_onlyZFC.py +0 -0
  28. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/MT.py +0 -0
  29. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/MT_insert.py +0 -0
  30. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/MT_original.py +0 -0
  31. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/VSM/MT_reliability_analysis.py +0 -0
  32. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/scenarios/XRD/Compare.py +0 -0
  33. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/domain/utils.py +0 -0
  34. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/gui/__init__.py +0 -0
  35. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/gui/main.py +0 -0
  36. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/infra/plotters/matplot.py +0 -0
  37. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/infra/plotters/origin.py +0 -0
  38. {majoplot-0.1.11 → majoplot-0.1.12}/src/majoplot/infra/plotters/origin_utils/originlab_type_library.py +0 -0
  39. {majoplot-0.1.11 → majoplot-0.1.12}/tests/README.md +0 -0
  40. {majoplot-0.1.11 → majoplot-0.1.12}/tests/conftest.py +0 -0
  41. {majoplot-0.1.11 → majoplot-0.1.12}/tests/domain/test_data_ignore_outliers.py +0 -0
  42. {majoplot-0.1.11 → majoplot-0.1.12}/tests/domain/test_insert_axes_spec.py +0 -0
  43. {majoplot-0.1.11 → majoplot-0.1.12}/tests/domain/test_labeldict_group.py +0 -0
  44. {majoplot-0.1.11 → majoplot-0.1.12}/tests/domain/test_labelvalue.py +0 -0
  45. {majoplot-0.1.11 → majoplot-0.1.12}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: majoplot
3
- Version: 0.1.11
3
+ Version: 0.1.12
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.11"
3
+ version = "0.1.12"
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"
@@ -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_Resistance:
17
+ class RT:
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")
@@ -92,6 +92,8 @@ class RT_Resistance:
92
92
  major_grid=None,
93
93
  major_tick=TickSpec(),
94
94
  legend=LegendSpec(fontsize=5),
95
+ linewidth=1,
96
+ marker_size=2,
95
97
  )
96
98
 
97
99
 
@@ -104,13 +106,15 @@ class RT_Resistance:
104
106
  title=None,
105
107
  figsize=FIGSIZE,
106
108
  linestyle_cycle= ("-",),
109
+
107
110
  linecolor_cycle = (
108
- "#2d0b59", "#3b0f6f", "#4a136e", "#5a176e", "#6a1c6e",
109
- "#7a216f", "#8b2770", "#9b2d71", "#ac3372", "#bd3973",
110
- "#ce4074", "#df4775", "#f04f76", "#f86a5a", "#fb8c3c",
111
- "#fdbb2d", "#fcfdbf",
111
+ "#515151", "#F14040", "#1A6FDF", "#37AD6B", "#B177DE",
112
+ "#CC9900", "#00CBCC", "#7D4E4E", "#8E8E00", "#FB6501",
113
+ "#6699CC", "#6FB802", "#f04f76", "#f86a5a", "#fb8c3c",
114
+ "#fdbb2d", "#fcfdbf","#2B2E83", "#E6007A", "#005F5F",
115
+ "#1F3D2B", "#E8C6E8","#FAB3d1",
112
116
  ),
113
- linemarker_cycle = ("o","s","^","v","d","*","x","+"),
117
+ linemarker_cycle = ("o",),
114
118
  alpa_cycle = (1.0,),
115
119
  )
116
120
 
@@ -8,14 +8,19 @@ FIGSIZE = (8, 6)
8
8
  T = "Temperature (K)"
9
9
  H = "Magnetic Field (Oe)"
10
10
  R = "Resistivity (Ω·m)"
11
- _headers = (T,R)
12
11
  RI ={
13
12
  1: {"R":"Bridge 1 Resistance (Ohms)", "I":"Bridge 1 Excitation (uA)"},
14
13
  2: {"R":"Bridge 2 Resistance (Ohms)", "I":"Bridge 2 Excitation (uA)"},
15
14
  3: {"R":"Bridge 3 Resistance (Ohms)", "I":"Bridge 3 Excitation (uA)"},
16
15
  }
17
16
 
18
- class RT:
17
+ ResistivityI ={
18
+ 1: {"R":"Bridge 1 Resistivity (Ω·m)", "I":"Bridge 1 Excitation (uA)"},
19
+ 2: {"R":"Bridge 2 Resistivity (Ω·m)", "I":"Bridge 2 Excitation (uA)"},
20
+ 3: {"R":"Bridge 3 Resistivity (Ω·m)", "I":"Bridge 3 Excitation (uA)"},
21
+ }
22
+
23
+ class RT_Resistivity:
19
24
  data_summary_label_names = ["H"]
20
25
  axes_label_names = ("date", "raw_data", "bridge", "sample_name")
21
26
  figure_label_names = ("date", "raw_data", "bridge", "sample_name")
@@ -53,6 +58,7 @@ class RT:
53
58
  for H_stage, points in split_datas:
54
59
  for i in range(1,4):
55
60
  _headerTRI = (T,RI[i]["R"],RI[i]["I"])
61
+ _headers = (T,ResistivityI[i]["R"])
56
62
  s_points = [ [point[headers[x]] for x in _headerTRI] for point in points]
57
63
  # clear null Resistance points
58
64
  s_points = np.array([point for point in s_points if point[1]])
@@ -100,6 +106,8 @@ class RT:
100
106
  major_grid=None,
101
107
  major_tick=TickSpec(),
102
108
  legend=LegendSpec(fontsize=5),
109
+ linewidth=1,
110
+ marker_size=2,
103
111
  )
104
112
 
105
113
 
@@ -113,10 +121,11 @@ class RT:
113
121
  figsize=FIGSIZE,
114
122
  linestyle_cycle= ("-",),
115
123
  linecolor_cycle = (
116
- "#2d0b59", "#3b0f6f", "#4a136e", "#5a176e", "#6a1c6e",
117
- "#7a216f", "#8b2770", "#9b2d71", "#ac3372", "#bd3973",
118
- "#ce4074", "#df4775", "#f04f76", "#f86a5a", "#fb8c3c",
119
- "#fdbb2d", "#fcfdbf",
124
+ "#515151", "#F14040", "#1A6FDF", "#37AD6B", "#B177DE",
125
+ "#CC9900", "#00CBCC", "#7D4E4E", "#8E8E00", "#FB6501",
126
+ "#6699CC", "#6FB802", "#f04f76", "#f86a5a", "#fb8c3c",
127
+ "#fdbb2d", "#fcfdbf","#2B2E83", "#E6007A", "#005F5F",
128
+ "#1F3D2B", "#E8C6E8","#FAB3d1",
120
129
  ),
121
130
  linemarker_cycle = ("o","s","^","v","d","*","x","+"),
122
131
  alpa_cycle = (1.0,),
@@ -0,0 +1,142 @@
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 = "Resistance (Ohms)"
11
+ RI ={
12
+ 1: {"R":"Bridge 1 Resistance (Ohms)", "I":"Bridge 1 Excitation (uA)"},
13
+ 2: {"R":"Bridge 2 Resistance (Ohms)", "I":"Bridge 2 Excitation (uA)"},
14
+ 3: {"R":"Bridge 3 Resistance (Ohms)", "I":"Bridge 3 Excitation (uA)"},
15
+ }
16
+ RI_normalized ={
17
+ 1: {"R":"Bridge 1 Normalized Resistance", "I":"Bridge 1 Excitation (uA)"},
18
+ 2: {"R":"Bridge 2 Normalied Resistance", "I":"Bridge 2 Excitation (uA)"},
19
+ 3: {"R":"Bridge 3 Normalized Resistance", "I":"Bridge 3 Excitation (uA)"},
20
+ }
21
+
22
+ class RT_normalized:
23
+ data_summary_label_names = ["H"]
24
+ axes_label_names = ("date", "raw_data", "bridge", "sample_name")
25
+ figure_label_names = ("date", "raw_data", "bridge", "sample_name")
26
+ figure_summary_label_names = ("raw_data","bridge","sample_name")
27
+ max_axes_in_one_figure = 1
28
+ project_to_child_folder_label_names = {"date":"sample_name"}
29
+ parent_folder_name = "RT"
30
+
31
+ @classmethod
32
+ def preprocess(cls, raw_datas:list[Data])->list[Data]:
33
+ datas = []
34
+ for raw_data in raw_datas:
35
+ raw_labels = raw_data.labels
36
+ headers = raw_data.headers
37
+ raw_points = raw_data.points
38
+
39
+ # Split by H
40
+ split_datas = []
41
+
42
+ last_H_stage = round(raw_points[0][headers[H]])
43
+ current_points = [ last_H_stage, [ raw_points[0] ] ]
44
+
45
+ for point in raw_points[1:]:
46
+ cur_H_stage = round(point[headers[H]])
47
+ if cur_H_stage != last_H_stage:
48
+ split_datas.append(current_points)
49
+ last_H_stage = cur_H_stage
50
+ current_points = [ last_H_stage, [ point ] ]
51
+ else:
52
+ current_points[1].append(point)
53
+ else:
54
+ split_datas.append(current_points)
55
+
56
+ # 3 bridges
57
+ for H_stage, points in split_datas:
58
+ for i in range(1,4):
59
+ _headerTRI = (T,RI[i]["R"],RI[i]["I"])
60
+ _headers = (T,RI_normalized[i]["R"])
61
+ s_points = [ [point[headers[x]] for x in _headerTRI] for point in points]
62
+ # clear null R points
63
+ s_points = np.array([point for point in s_points if point[1]])
64
+ # record
65
+ Imin = np.min(s_points[:,2])
66
+ Imax = np.max(s_points[:,2])
67
+ if (Imax - Imin) / Imax < 0.03:
68
+ Irange = f"{np.mean(s_points[:,1]):.1e}"
69
+ else:
70
+ Irange = f"{Imin:.1e}~{Imax:.1e}"
71
+
72
+ labels = LabelDict()
73
+ labels["instrument"] = raw_labels["instrument"]
74
+ labels["raw_data"] = raw_labels["raw_data"]
75
+ labels["date"] = raw_labels["date"]
76
+ labels["bridge"] = LabelValue(i,unit="Bridge",unit_as_postfix=False)
77
+ labels["sample_name"] = raw_labels[f"sample{i}_name"]
78
+ labels["sample_units"] = raw_labels[f"sample{i}_units"]
79
+ labels["H"] = LabelValue(H_stage, unit="Oe")
80
+ labels["I_range"] = LabelValue(Irange,unit="μA")
81
+ labels.summary_names = cls.data_summary_label_names
82
+ datas.append(Data(
83
+ labels=labels,
84
+ _headers=_headers,
85
+ points=s_points[:,0:2],
86
+ ignore_outliers=IgnoreOutlierSpec(min_gap_base=1e-4,min_gap_multiple=5),
87
+ ))
88
+
89
+ # normalize
90
+ for data in datas:
91
+ data: Data
92
+ ymax = np.max(np.abs(data.ylim))
93
+ data.points = np.column_stack( [data.points[:,0], np.asarray(data.points[:,1] / ymax)])
94
+ data.ignore_outliers = None
95
+ data._ignore_outliers_spec_cache = None
96
+ data._points_for_plot = None
97
+ data._x_for_plot = None
98
+ data._y_for_plot = None
99
+ data._xlim = None
100
+ data._ylim = None
101
+
102
+ return datas
103
+
104
+
105
+
106
+ @classmethod
107
+ def make_axes_spec(cls, axes_labels, data_pool)->AxesSpec:
108
+ return AxesSpec(
109
+ x_axis_title=T,
110
+ y_axis_title=R,
111
+ major_grid=None,
112
+ major_tick=TickSpec(),
113
+ legend=LegendSpec(fontsize=5),
114
+ linewidth=1,
115
+ marker_size=2,
116
+ )
117
+
118
+
119
+ @classmethod
120
+ def make_figure_spec(cls,figure_labels, axes_pool:Iterable[Axes])->FigureSpec:
121
+ figure_name = figure_labels.brief_summary
122
+
123
+ return FigureSpec(
124
+ name=figure_name,
125
+ title=None,
126
+ figsize=FIGSIZE,
127
+ linestyle_cycle= ("-",),
128
+
129
+ linecolor_cycle = (
130
+ "#515151", "#F14040", "#1A6FDF", "#37AD6B", "#B177DE",
131
+ "#CC9900", "#00CBCC", "#7D4E4E", "#8E8E00", "#FB6501",
132
+ "#6699CC", "#6FB802", "#f04f76", "#f86a5a", "#fb8c3c",
133
+ "#fdbb2d", "#fcfdbf","#2B2E83", "#E6007A", "#005F5F",
134
+ "#1F3D2B", "#E8C6E8","#FAB3d1",
135
+ ),
136
+ linemarker_cycle = ("o",),
137
+ alpa_cycle = (1.0,),
138
+ )
139
+
140
+ @classmethod
141
+ def make_muti_axes_spec(cls, axes_pool:list[Axes])->MutiAxesSpec|FAIL|None:
142
+ return None
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