Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GPLT - a general plotter script in Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STEVAN Antoine
GPLT - a general plotter script in Python
Commits
2d84d783
Verified
Commit
2d84d783
authored
1 month ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
tweak log levels
parent
d87bbc60
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.py
+2
-2
2 additions, 2 deletions
src/main.py
src/plot.py
+6
-6
6 additions, 6 deletions
src/plot.py
with
8 additions
and
8 deletions
src/main.py
+
2
−
2
View file @
2d84d783
...
...
@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
import
plot
import
multi_bar
from
error
import
GPLTError
from
log
import
panic
,
success
,
info
,
set_level
from
log
import
panic
,
success
,
info
,
set_level
,
debug
import
os
import
json
...
...
@@ -21,7 +21,7 @@ def load_json(json_value: str, filename: str = None):
GPLTError
.
NO_SUCH_FILE
,
f
"
{
filename
}
: no such file
"
,
)
info
(
f
"
loading JSON data from
{
filename
}
"
)
debug
(
f
"
loading JSON data from
{
filename
}
"
)
with
open
(
filename
,
"
r
"
)
as
file
:
try
:
data
=
json
.
load
(
file
)
...
...
This diff is collapsed.
Click to expand it.
src/plot.py
+
6
−
6
View file @
2d84d783
...
...
@@ -5,7 +5,7 @@ import shutil
from
itertools
import
zip_longest
from
error
import
GPLTError
from
log
import
panic
,
warning
,
debug
,
info
from
log
import
panic
,
warning
,
info
,
debug
,
trace
from
typing
import
Any
,
Dict
,
List
,
Optional
,
Tuple
,
TypedDict
...
...
@@ -193,7 +193,7 @@ def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes) -> matplotlib.lines
xs
,
ys
,
es
=
_parse_graph_points
(
g
[
"
points
"
],
name
)
if
len
(
xs
)
==
0
:
debu
g
(
f
"
no point to plot for graph
{
name
}
"
)
warnin
g
(
f
"
no point to plot for graph
{
name
}
"
)
line_style
,
error_alpha
=
_parse_graph_style
(
g
)
...
...
@@ -254,7 +254,7 @@ def check(graphs: Any):
point_fields
=
__get_class_fields
(
Point
)
for
i
,
g
in
enumerate
(
graphs
):
debug
(
f
"
checking graph
{
i
}
"
)
trace
(
f
"
checking graph
{
i
}
"
)
if
not
isinstance
(
g
,
dict
):
panic
(
GPLTError
.
INVALID_ARGUMENTS
,
...
...
@@ -271,7 +271,7 @@ def check(graphs: Any):
)
if
"
style
"
in
g
:
debug
(
f
"
checking the `$.style` of graph
{
name
}
"
)
trace
(
f
"
checking the `$.style` of graph
{
name
}
"
)
_check_extra_class_fields
(
g
[
"
style
"
],
name
,
__get_class_fields
(
Style
),
sub_path
=
[
"
style
"
]
)
...
...
@@ -346,12 +346,12 @@ def plot(
legends
=
{}
for
i
,
g
in
enumerate
(
graphs
):
info
(
f
"
plotting graph
{
i
}
"
)
debug
(
f
"
plotting graph
{
i
}
"
)
line
=
_plot_single
(
g
,
i
,
ax
)
legend
=
g
.
get
(
"
legend
"
,
"
main
"
if
"
name
"
in
g
else
None
)
if
legend
is
not
None
:
debug
(
f
"
adding legend of graph
{
i
}
"
)
trace
(
f
"
adding legend of graph
{
i
}
"
)
if
legend
not
in
legends
:
legends
[
legend
]
=
[]
legends
[
legend
]
+=
[
line
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment