majoplot 0.1.4__tar.gz → 0.1.6__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.
- {majoplot-0.1.4 → majoplot-0.1.6}/PKG-INFO +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/pyproject.toml +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/base.py +2 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/importers/PPMS_Resistivity.py +1 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/importers/VSM.py +1 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/importers/XRD.py +1 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/PPMS_Resistivity/RT.py +1 -1
- majoplot-0.1.6/src/majoplot/domain/scenarios/VSM/ChiT.py +188 -0
- majoplot-0.1.6/src/majoplot/domain/scenarios/VSM/ChiT_ZFC.py +189 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/VSM/MT.py +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/VSM/MT_insert.py +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/VSM/MT_reliability_analysis.py +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/XRD/Compare.py +1 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/utils.py +2 -2
- majoplot-0.1.6/src/majoplot/gui/__init__.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/gui/main.py +8 -5
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/infra/plotters/origin.py +3 -3
- {majoplot-0.1.4 → majoplot-0.1.6}/uv.lock +1 -1
- majoplot-0.1.4/TODO.md +0 -1
- {majoplot-0.1.4 → majoplot-0.1.6}/.gitignore +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/LICENSE +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/README.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/README.zh-CN.md +0 -0
- /majoplot-0.1.4/src/majoplot/__init__.py → /majoplot-0.1.6/TODO.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/doc.zh-CN/Label.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/doc.zh-CN/interactive_steps.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/doc.zh-CN/main_design.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/doc.zh-CN/note_of_labtalk.md +0 -0
- {majoplot-0.1.4/src/majoplot/app → majoplot-0.1.6/src/majoplot}/__init__.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/__main__.py +0 -0
- {majoplot-0.1.4/src/majoplot/gui → majoplot-0.1.6/src/majoplot/app}/__init__.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/app/cli.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/app/gui.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/config.json +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/muti_axes_spec.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/infra/plotters/matplot.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/infra/plotters/origin_utils/originlab_type_library.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/tests/README.md +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/tests/conftest.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/tests/domain/test_data_ignore_outliers.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/tests/domain/test_insert_axes_spec.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/tests/domain/test_labeldict_group.py +0 -0
- {majoplot-0.1.4 → majoplot-0.1.6}/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.
|
|
3
|
+
Version: 0.1.6
|
|
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.
|
|
3
|
+
version = "0.1.6"
|
|
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"
|
|
@@ -359,6 +359,7 @@ class Project(dict[str,folder]):
|
|
|
359
359
|
# ======== Scenario ========
|
|
360
360
|
class Importer(Protocol):
|
|
361
361
|
instrument: str
|
|
362
|
+
prefs_scenario: str
|
|
362
363
|
|
|
363
364
|
@classmethod
|
|
364
365
|
def fetch_raw_data(cls, raw_data_file:TextIO, raw_data_name:str)->Data|FAIL:
|
|
@@ -379,7 +380,7 @@ class Scenario(Protocol):
|
|
|
379
380
|
...
|
|
380
381
|
|
|
381
382
|
@classmethod
|
|
382
|
-
def make_axes_spec(cls, axes_labels:LabelDict)->AxesSpec:
|
|
383
|
+
def make_axes_spec(cls, axes_labels:LabelDict, data_pool:Iterable[Data])->AxesSpec:
|
|
383
384
|
...
|
|
384
385
|
|
|
385
386
|
@classmethod
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from copy import copy
|
|
3
|
+
|
|
4
|
+
from ...base import *
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
FIGSIZE = (8, 6)
|
|
8
|
+
|
|
9
|
+
T = "Temperature (K)"
|
|
10
|
+
M = "DC Moment Free Ctr (emu)"
|
|
11
|
+
H = "Magnetic Field (Oe)"
|
|
12
|
+
chi = "χ ( m³ / kg )"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ChiT:
|
|
16
|
+
data_summary_label_names = ["H","cooling_type"]
|
|
17
|
+
axes_label_names = ("material","date","raw_data")
|
|
18
|
+
figure_label_names = ("material","date", "raw_data")
|
|
19
|
+
figure_summary_label_names = ("raw_data","date")
|
|
20
|
+
max_axes_in_one_figure = 1
|
|
21
|
+
project_to_child_folder_label_names = {"material":"date","date":"material"}
|
|
22
|
+
parent_folder_name = "MT"
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def preprocess(cls, raw_datas:list[Data])->list[Data]:
|
|
26
|
+
datas = []
|
|
27
|
+
for raw_data in raw_datas:
|
|
28
|
+
raw_labels = raw_data.labels
|
|
29
|
+
headers = raw_data.headers
|
|
30
|
+
raw_points = raw_data.points
|
|
31
|
+
iT = headers[T]
|
|
32
|
+
iH = headers[H]
|
|
33
|
+
iM = headers[M]
|
|
34
|
+
|
|
35
|
+
check_deque = []
|
|
36
|
+
|
|
37
|
+
current_points = []
|
|
38
|
+
current_cool_type = "ZFC"
|
|
39
|
+
try:
|
|
40
|
+
current_points.append(raw_points[0])
|
|
41
|
+
H_stage = round(raw_points[0, iH])
|
|
42
|
+
except KeyError:
|
|
43
|
+
return []
|
|
44
|
+
|
|
45
|
+
def append_data():
|
|
46
|
+
nonlocal current_points, check_deque, datas
|
|
47
|
+
nonlocal current_cool_type
|
|
48
|
+
current_points.append(check_deque.pop(0))
|
|
49
|
+
labels = copy(raw_labels)
|
|
50
|
+
labels["H"] = LabelValue(H_stage, "Oe")
|
|
51
|
+
if current_points[-1][iT] < current_points[0][iT]:
|
|
52
|
+
unused = True
|
|
53
|
+
labels["cooling_type"] = "cooling"
|
|
54
|
+
else:
|
|
55
|
+
unused = False
|
|
56
|
+
if current_cool_type == "ZFC":
|
|
57
|
+
labels["cooling_type"] = "ZFC"
|
|
58
|
+
current_cool_type = "FC"
|
|
59
|
+
else:
|
|
60
|
+
labels["cooling_type"] = "FC"
|
|
61
|
+
current_cool_type = "ZFC"
|
|
62
|
+
labels["scenario"] = "MT"
|
|
63
|
+
labels.summary_names = cls.data_summary_label_names
|
|
64
|
+
a_points=np.array(current_points)[:,[iT,iM]]
|
|
65
|
+
try:
|
|
66
|
+
mass = np.float64(labels["mass"].value)
|
|
67
|
+
except ValueError:
|
|
68
|
+
mass = np.nan
|
|
69
|
+
if mass == 0:
|
|
70
|
+
mass = np.nan
|
|
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])
|
|
73
|
+
datas.append(
|
|
74
|
+
Data(
|
|
75
|
+
labels=labels,
|
|
76
|
+
_headers=(T,chi),
|
|
77
|
+
points=chi_points,
|
|
78
|
+
ignore_outliers=IgnoreOutlierSpec(
|
|
79
|
+
min_gap_base=5e-9,
|
|
80
|
+
min_gap_multiple=10
|
|
81
|
+
),
|
|
82
|
+
unused=unused,
|
|
83
|
+
))
|
|
84
|
+
|
|
85
|
+
for point in raw_points[1:]:
|
|
86
|
+
check_deque.append(point)
|
|
87
|
+
if len(check_deque) == 2:
|
|
88
|
+
# not the same H?
|
|
89
|
+
if abs(check_deque[1][iH] - H_stage) > 1.5:
|
|
90
|
+
append_data()
|
|
91
|
+
current_points = [check_deque.pop()]
|
|
92
|
+
H_stage = round(current_points[0][iH])
|
|
93
|
+
current_cool_type = "ZFC"
|
|
94
|
+
# not the same heating curve?
|
|
95
|
+
elif (check_deque[0][iT] - current_points[0][iT])>2 and (check_deque[0][iT] - check_deque[1][iT])>2:
|
|
96
|
+
append_data()
|
|
97
|
+
current_points = [check_deque.pop()]
|
|
98
|
+
else:
|
|
99
|
+
# the same curve
|
|
100
|
+
current_points.append(check_deque.pop(0))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
else:
|
|
104
|
+
while check_deque:
|
|
105
|
+
append_data()
|
|
106
|
+
return datas
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def make_axes_spec(cls,axes_labels,data_pool:Iterable[Data])->AxesSpec:
|
|
111
|
+
if data_pool:
|
|
112
|
+
x_min, x_max = data_pool[0].xlim
|
|
113
|
+
for data in data_pool[1:]:
|
|
114
|
+
data_x_min, data_x_max = data.xlim
|
|
115
|
+
if data_x_min > x_min:
|
|
116
|
+
x_min = data_x_min
|
|
117
|
+
if data_x_max < x_max:
|
|
118
|
+
x_max = data_x_max
|
|
119
|
+
|
|
120
|
+
y_min, y_max = None, None
|
|
121
|
+
for data in data_pool:
|
|
122
|
+
mask = (data.points_for_plot[:, 0] >= x_min) & (data.points_for_plot[:, 0] <= x_max)
|
|
123
|
+
y = data.points_for_plot[mask, 1]
|
|
124
|
+
data_y_min = y.min()
|
|
125
|
+
data_y_max = y.max()
|
|
126
|
+
if y_min:
|
|
127
|
+
if data_y_min < y_min:
|
|
128
|
+
y_min = data_y_min
|
|
129
|
+
else:
|
|
130
|
+
y_min = data_y_min
|
|
131
|
+
|
|
132
|
+
if y_max:
|
|
133
|
+
if data_y_max > y_max:
|
|
134
|
+
y_max = data_y_max
|
|
135
|
+
else:
|
|
136
|
+
y_max = data_y_max
|
|
137
|
+
|
|
138
|
+
x_magin = (x_max - x_min) * 0.05
|
|
139
|
+
y_magin = (y_max - y_min) * 0.05
|
|
140
|
+
|
|
141
|
+
x_min, x_max = x_min - x_magin, x_max + x_magin
|
|
142
|
+
y_min, y_max = y_min - y_magin, y_max + y_magin
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
else:
|
|
146
|
+
x_min, x_max = None, None
|
|
147
|
+
y_min, y_max = None, None
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
return AxesSpec(
|
|
151
|
+
x_axis_title=T,
|
|
152
|
+
y_axis_title=chi,
|
|
153
|
+
x_left_lim=x_min,
|
|
154
|
+
x_right_lim=x_max,
|
|
155
|
+
y_left_lim=y_min,
|
|
156
|
+
y_right_lim=y_max,
|
|
157
|
+
major_grid=None,
|
|
158
|
+
major_tick=TickSpec(),
|
|
159
|
+
legend=LegendSpec(),
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@classmethod
|
|
164
|
+
def make_figure_spec(cls,figure_labels, axes_pool:Iterable[Axes])->FigureSpec:
|
|
165
|
+
figure_name = figure_labels.brief_summary
|
|
166
|
+
|
|
167
|
+
return FigureSpec(
|
|
168
|
+
name=figure_name,
|
|
169
|
+
title=None,
|
|
170
|
+
figsize=FIGSIZE,
|
|
171
|
+
linestyle_cycle= ("-", "--"),
|
|
172
|
+
linecolor_cycle = (
|
|
173
|
+
"#1f77b4", "#1f77b4", # blue (best first color)
|
|
174
|
+
"#ff7f0e", "#ff7f0e", # orange
|
|
175
|
+
"#2ca02c", "#2ca02c", # green
|
|
176
|
+
"#d62728", "#d62728", # red
|
|
177
|
+
"#9467bd", "#9467bd", # purple
|
|
178
|
+
"#8c564b", "#8c564b", # brown
|
|
179
|
+
"#17becf", "#17becf", # cyan
|
|
180
|
+
"#e377c2", "#e377c2", # pink
|
|
181
|
+
),
|
|
182
|
+
linemarker_cycle = ("o","o","s","s","^","^","v","v","d","d","*","*","x","x","+","+"),
|
|
183
|
+
alpa_cycle = (1.0,),
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
@classmethod
|
|
187
|
+
def make_muti_axes_spec(cls, axes_pool:list[Axes])->MutiAxesSpec|FAIL|None:
|
|
188
|
+
return None
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from copy import copy
|
|
3
|
+
|
|
4
|
+
from ...base import *
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
FIGSIZE = (8, 6)
|
|
8
|
+
|
|
9
|
+
T = "Temperature (K)"
|
|
10
|
+
M = "DC Moment Free Ctr (emu)"
|
|
11
|
+
H = "Magnetic Field (Oe)"
|
|
12
|
+
chi = "χ ( m³ / kg )"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ChiT_ZFC:
|
|
16
|
+
data_summary_label_names = ["H","cooling_type"]
|
|
17
|
+
axes_label_names = ("material","date","raw_data")
|
|
18
|
+
figure_label_names = ("material","date", "raw_data")
|
|
19
|
+
figure_summary_label_names = ("raw_data","date")
|
|
20
|
+
max_axes_in_one_figure = 1
|
|
21
|
+
project_to_child_folder_label_names = {"material":"date","date":"material"}
|
|
22
|
+
parent_folder_name = "MT"
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def preprocess(cls, raw_datas:list[Data])->list[Data]:
|
|
26
|
+
datas = []
|
|
27
|
+
for raw_data in raw_datas:
|
|
28
|
+
raw_labels = raw_data.labels
|
|
29
|
+
headers = raw_data.headers
|
|
30
|
+
raw_points = raw_data.points
|
|
31
|
+
iT = headers[T]
|
|
32
|
+
iH = headers[H]
|
|
33
|
+
iM = headers[M]
|
|
34
|
+
|
|
35
|
+
check_deque = []
|
|
36
|
+
|
|
37
|
+
current_points = []
|
|
38
|
+
current_cool_type = "ZFC"
|
|
39
|
+
try:
|
|
40
|
+
current_points.append(raw_points[0])
|
|
41
|
+
H_stage = round(raw_points[0, iH])
|
|
42
|
+
except KeyError:
|
|
43
|
+
return []
|
|
44
|
+
|
|
45
|
+
def append_data():
|
|
46
|
+
nonlocal current_points, check_deque, datas
|
|
47
|
+
nonlocal current_cool_type
|
|
48
|
+
current_points.append(check_deque.pop(0))
|
|
49
|
+
labels = copy(raw_labels)
|
|
50
|
+
labels["H"] = LabelValue(H_stage, "Oe")
|
|
51
|
+
if current_points[-1][iT] < current_points[0][iT]:
|
|
52
|
+
unused = True
|
|
53
|
+
labels["cooling_type"] = "cooling"
|
|
54
|
+
else:
|
|
55
|
+
if current_cool_type == "ZFC":
|
|
56
|
+
unused = False
|
|
57
|
+
labels["cooling_type"] = "ZFC"
|
|
58
|
+
current_cool_type = "FC"
|
|
59
|
+
else:
|
|
60
|
+
unused = True
|
|
61
|
+
labels["cooling_type"] = "FC"
|
|
62
|
+
current_cool_type = "ZFC"
|
|
63
|
+
labels["scenario"] = "MT"
|
|
64
|
+
labels.summary_names = cls.data_summary_label_names
|
|
65
|
+
a_points=np.array(current_points)[:,[iT,iM]]
|
|
66
|
+
try:
|
|
67
|
+
mass = np.float64(labels["mass"].value)
|
|
68
|
+
except ValueError:
|
|
69
|
+
mass = np.nan
|
|
70
|
+
if mass == 0:
|
|
71
|
+
mass = np.nan
|
|
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])
|
|
74
|
+
datas.append(
|
|
75
|
+
Data(
|
|
76
|
+
labels=labels,
|
|
77
|
+
_headers=(T,chi),
|
|
78
|
+
points=chi_points,
|
|
79
|
+
ignore_outliers=IgnoreOutlierSpec(
|
|
80
|
+
min_gap_base=5e-9,
|
|
81
|
+
min_gap_multiple=10
|
|
82
|
+
),
|
|
83
|
+
unused=unused,
|
|
84
|
+
))
|
|
85
|
+
|
|
86
|
+
for point in raw_points[1:]:
|
|
87
|
+
check_deque.append(point)
|
|
88
|
+
if len(check_deque) == 2:
|
|
89
|
+
# not the same H?
|
|
90
|
+
if abs(check_deque[1][iH] - H_stage) > 1.5:
|
|
91
|
+
append_data()
|
|
92
|
+
current_points = [check_deque.pop()]
|
|
93
|
+
H_stage = round(current_points[0][iH])
|
|
94
|
+
current_cool_type = "ZFC"
|
|
95
|
+
# not the same heating curve?
|
|
96
|
+
elif (check_deque[0][iT] - current_points[0][iT])>2 and (check_deque[0][iT] - check_deque[1][iT])>2:
|
|
97
|
+
append_data()
|
|
98
|
+
current_points = [check_deque.pop()]
|
|
99
|
+
else:
|
|
100
|
+
# the same curve
|
|
101
|
+
current_points.append(check_deque.pop(0))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
else:
|
|
105
|
+
while check_deque:
|
|
106
|
+
append_data()
|
|
107
|
+
return datas
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def make_axes_spec(cls,axes_labels,data_pool:Iterable[Data])->AxesSpec:
|
|
112
|
+
if data_pool:
|
|
113
|
+
x_min, x_max = data_pool[0].xlim
|
|
114
|
+
for data in data_pool[1:]:
|
|
115
|
+
data_x_min, data_x_max = data.xlim
|
|
116
|
+
if data_x_min > x_min:
|
|
117
|
+
x_min = data_x_min
|
|
118
|
+
if data_x_max < x_max:
|
|
119
|
+
x_max = data_x_max
|
|
120
|
+
|
|
121
|
+
y_min, y_max = None, None
|
|
122
|
+
for data in data_pool:
|
|
123
|
+
mask = (data.points_for_plot[:, 0] >= x_min) & (data.points_for_plot[:, 0] <= x_max)
|
|
124
|
+
y = data.points_for_plot[mask, 1]
|
|
125
|
+
data_y_min = y.min()
|
|
126
|
+
data_y_max = y.max()
|
|
127
|
+
if y_min:
|
|
128
|
+
if data_y_min < y_min:
|
|
129
|
+
y_min = data_y_min
|
|
130
|
+
else:
|
|
131
|
+
y_min = data_y_min
|
|
132
|
+
|
|
133
|
+
if y_max:
|
|
134
|
+
if data_y_max > y_max:
|
|
135
|
+
y_max = data_y_max
|
|
136
|
+
else:
|
|
137
|
+
y_max = data_y_max
|
|
138
|
+
|
|
139
|
+
x_magin = (x_max - x_min) * 0.05
|
|
140
|
+
y_magin = (y_max - y_min) * 0.05
|
|
141
|
+
|
|
142
|
+
x_min, x_max = x_min - x_magin, x_max + x_magin
|
|
143
|
+
y_min, y_max = y_min - y_magin, y_max + y_magin
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
else:
|
|
147
|
+
x_min, x_max = None, None
|
|
148
|
+
y_min, y_max = None, None
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
return AxesSpec(
|
|
152
|
+
x_axis_title=T,
|
|
153
|
+
y_axis_title=chi,
|
|
154
|
+
x_left_lim=x_min,
|
|
155
|
+
x_right_lim=x_max,
|
|
156
|
+
y_left_lim=y_min,
|
|
157
|
+
y_right_lim=y_max,
|
|
158
|
+
major_grid=None,
|
|
159
|
+
major_tick=TickSpec(),
|
|
160
|
+
legend=LegendSpec(),
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def make_figure_spec(cls,figure_labels, axes_pool:Iterable[Axes])->FigureSpec:
|
|
166
|
+
figure_name = figure_labels.brief_summary
|
|
167
|
+
|
|
168
|
+
return FigureSpec(
|
|
169
|
+
name=figure_name,
|
|
170
|
+
title=None,
|
|
171
|
+
figsize=FIGSIZE,
|
|
172
|
+
linestyle_cycle= ("-",),
|
|
173
|
+
linecolor_cycle = (
|
|
174
|
+
"#1f77b4", # blue (best first color)
|
|
175
|
+
"#ff7f0e", # orange
|
|
176
|
+
"#2ca02c", # green
|
|
177
|
+
"#d62728", # red
|
|
178
|
+
"#9467bd", # purple
|
|
179
|
+
"#8c564b", # brown
|
|
180
|
+
"#17becf", # cyan
|
|
181
|
+
"#e377c2", # pink
|
|
182
|
+
),
|
|
183
|
+
linemarker_cycle = ("o","s","^","v","d","*","x","+"),
|
|
184
|
+
alpa_cycle = (1.0,),
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
@classmethod
|
|
188
|
+
def make_muti_axes_spec(cls, axes_pool:list[Axes])->MutiAxesSpec|FAIL|None:
|
|
189
|
+
return None
|
{majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/domain/scenarios/VSM/MT_reliability_analysis.py
RENAMED
|
@@ -107,7 +107,7 @@ class MT_reliability_analysis:
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
@classmethod
|
|
110
|
-
def make_axes_spec(cls,axes_labels:LabelDict)->AxesSpec:
|
|
110
|
+
def make_axes_spec(cls,axes_labels:LabelDict, data_pool)->AxesSpec:
|
|
111
111
|
return AxesSpec(
|
|
112
112
|
x_axis_title=T,
|
|
113
113
|
y_axis_title=axes_labels["Y_axis"],
|
|
@@ -8,12 +8,12 @@ def group_into_axes(all_datas:Iterable[Data], scenario:Scenario)->list[Axes]:
|
|
|
8
8
|
make_axes_spec = scenario.make_axes_spec
|
|
9
9
|
|
|
10
10
|
axes_labels_and_data_pools, _ = LabelDict.group(
|
|
11
|
-
((data.labels, data) for data in all_datas if
|
|
11
|
+
((data.labels, data) for data in all_datas if not (data.unused or np.isnan(data.y_for_plot).all()) ),
|
|
12
12
|
group_label_names=axes_label_names,
|
|
13
13
|
)
|
|
14
14
|
axes_pool = []
|
|
15
15
|
for axes_labels, data_pool in axes_labels_and_data_pools:
|
|
16
|
-
spec = make_axes_spec(axes_labels)
|
|
16
|
+
spec = make_axes_spec(axes_labels, data_pool)
|
|
17
17
|
axes_pool.append(Axes(spec, axes_labels, data_pool))
|
|
18
18
|
return axes_pool
|
|
19
19
|
|
|
File without changes
|
|
@@ -210,7 +210,10 @@ class MainWindow(ttk.Frame):
|
|
|
210
210
|
snames = sorted(self.scenarios.keys())
|
|
211
211
|
self.scenario_cb["values"] = snames
|
|
212
212
|
if snames:
|
|
213
|
-
|
|
213
|
+
try:
|
|
214
|
+
self.scenario_var.set(self.importers[name].prefs_scenario)
|
|
215
|
+
except AttributeError:
|
|
216
|
+
self.scenario_var.set(snames[0])
|
|
214
217
|
|
|
215
218
|
# ---------------- Import flow ----------------
|
|
216
219
|
def _pick_raw_files(self) -> None:
|
|
@@ -415,8 +418,8 @@ class MainWindow(ttk.Frame):
|
|
|
415
418
|
return
|
|
416
419
|
proj = self.edit_proj_name_var.get().strip()
|
|
417
420
|
folder = self.edit_folder_path_var.get().strip()
|
|
418
|
-
if not proj
|
|
419
|
-
messagebox.showwarning("Invalid", "proj_name
|
|
421
|
+
if not proj:
|
|
422
|
+
messagebox.showwarning("Invalid", "proj_name is required.")
|
|
420
423
|
return
|
|
421
424
|
fig = self.figures[idx]
|
|
422
425
|
if overwrite:
|
|
@@ -428,8 +431,8 @@ class MainWindow(ttk.Frame):
|
|
|
428
431
|
def _apply_archive_to_all(self, overwrite: bool) -> None:
|
|
429
432
|
proj = self.global_proj_name_var.get().strip()
|
|
430
433
|
folder = self.global_folder_path_var.get().strip()
|
|
431
|
-
if not proj
|
|
432
|
-
messagebox.showwarning("Invalid", "proj_name
|
|
434
|
+
if not proj:
|
|
435
|
+
messagebox.showwarning("Invalid", "proj_name is required.")
|
|
433
436
|
return
|
|
434
437
|
for fig in self.figures:
|
|
435
438
|
if overwrite:
|
|
@@ -590,13 +590,13 @@ def _legend_anchor_xy(leg: LegendSpec) -> tuple[float, float]:
|
|
|
590
590
|
|
|
591
591
|
loc = (leg.loc or "upper right").lower().replace("_", " ")
|
|
592
592
|
table = {
|
|
593
|
-
"upper right": (
|
|
593
|
+
"upper right": (85.0, 90.0),
|
|
594
594
|
"upper left": (10.0, 90.0),
|
|
595
595
|
"lower left": (10.0, 10.0),
|
|
596
|
-
"lower right": (
|
|
596
|
+
"lower right": (85.0, 10.0),
|
|
597
597
|
"center": (50.0, 50.0),
|
|
598
598
|
}
|
|
599
|
-
return table.get(loc, (
|
|
599
|
+
return table.get(loc, (85.0, 90.0))
|
|
600
600
|
|
|
601
601
|
|
|
602
602
|
def _apply_legend_text(og: Any, layer_idx: int, legend_spec: LegendSpec, legend_text: str, scale: float) -> None:
|
majoplot-0.1.4/TODO.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
- take in account the situation that no point in data
|
|
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
|
{majoplot-0.1.4 → majoplot-0.1.6}/src/majoplot/infra/plotters/origin_utils/originlab_type_library.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|