Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AossTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
AossTower
Commits
395155f0
Unverified
Commit
395155f0
authored
7 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add checks for empty frame to quicklooks
parent
25fe631d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aosstower/tower_quicklooks/create_quicklook.py
+8
-4
8 additions, 4 deletions
aosstower/tower_quicklooks/create_quicklook.py
with
8 additions
and
4 deletions
aosstower/tower_quicklooks/create_quicklook.py
+
8
−
4
View file @
395155f0
...
...
@@ -217,19 +217,19 @@ class PlotMaker(object):
:param shared_x:
:return:
"""
specific_frame
=
frame
[[
x
for
x
in
frame
.
columns
if
x
in
self
.
deps
]]
if
frame
.
empty
or
specific_frame
.
empty
or
specific_frame
.
isnull
().
all
().
any
():
raise
ValueError
(
"
No valid data found or missing necessary data to make {}
"
.
format
(
self
.
name
))
if
start_time
is
None
:
start_time
=
frame
.
index
[
0
].
to_pydatetime
()
if
end_time
is
None
:
end_time
=
frame
.
index
[
-
1
].
to_pydatetime
()
# TODO: If frame is empty, make an empty plot
ax
=
self
.
_get_axes
(
fig
,
is_subplot
,
shared_x
)
self
.
_set_title
(
frame
,
fig
,
ax
,
start_time
=
start_time
,
end_time
=
end_time
,
title
=
title
,
is_subplot
=
is_subplot
)
# get the min for each column then combine them assuming we can
specific_frame
=
frame
[[
x
for
x
in
frame
.
columns
if
x
in
self
.
deps
]]
# make ticks show up on top and bottom inside and out of the axis line
ax
.
xaxis
.
set_tick_params
(
left
=
True
,
right
=
True
,
direction
=
'
inout
'
)
lines
=
self
.
_call_plot
(
specific_frame
,
ax
)
...
...
@@ -427,7 +427,11 @@ def create_plot(plot_names, frame, output,
plot_frame
=
plot_frame
[
~
plot_frame
.
isnull
().
any
(
axis
=
1
)]
fig
=
plt
.
figure
()
ax
=
plot_maker
.
create_plot
(
plot_frame
,
fig
,
start_time
=
start_time
,
end_time
=
end_time
)
try
:
ax
=
plot_maker
.
create_plot
(
plot_frame
,
fig
,
start_time
=
start_time
,
end_time
=
end_time
)
except
ValueError
:
LOG
.
error
(
"
Could not make
'
{}
'"
.
format
(
name
),
exc_info
=
True
)
continue
out_fn
=
output
.
format
(
plot_name
=
name
,
start_time
=
start_time
,
end_time
=
end_time
)
LOG
.
info
(
"
Saving plot
'
{}
'
to filename
'
{}
'"
.
format
(
name
,
out_fn
))
...
...
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