Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enstools-compression
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
w2w
enstools-compression
Commits
d25017b3
Commit
d25017b3
authored
1 year ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
Minor update in streamlit example.
parent
ffdd0c84
No related branches found
Branches containing commit
No related tags found
1 merge request
!18
Several changes including chunking and expansion of examples.
Pipeline
#19107
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/streamlit/component/plotter.py
+2
-5
2 additions, 5 deletions
examples/streamlit/component/plotter.py
with
2 additions
and
5 deletions
examples/streamlit/component/plotter.py
+
2
−
5
View file @
d25017b3
import
streamlit
as
st
import
streamlit
as
st
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
def
plot_comparison
(
data
,
slice_selection
):
def
plot_comparison
(
data
,
slice_selection
):
col1
,
col2
,
col3
,
*
others
=
st
.
columns
(
3
)
col1
,
col2
,
col3
,
*
others
=
st
.
columns
(
3
)
...
@@ -19,7 +20,6 @@ def plot_comparison(data, slice_selection):
...
@@ -19,7 +20,6 @@ def plot_comparison(data, slice_selection):
slice_selection
=
new_slice
slice_selection
=
new_slice
if
data
.
reference_da
is
not
None
:
if
data
.
reference_da
is
not
None
:
print
(
f
"
{
slice_selection
=
}
"
)
slice_selection
=
{
key
:
(
value
if
key
!=
"
lat
"
else
slice
(
value
.
stop
,
value
.
start
))
for
key
,
value
in
slice_selection
=
{
key
:
(
value
if
key
!=
"
lat
"
else
slice
(
value
.
stop
,
value
.
start
))
for
key
,
value
in
slice_selection
.
items
()}
slice_selection
.
items
()}
...
@@ -33,8 +33,8 @@ def plot_comparison(data, slice_selection):
...
@@ -33,8 +33,8 @@ def plot_comparison(data, slice_selection):
if
non_slices
:
if
non_slices
:
reference_slice
=
reference_slice
.
sel
(
**
non_slices
,
method
=
"
nearest
"
)
reference_slice
=
reference_slice
.
sel
(
**
non_slices
,
method
=
"
nearest
"
)
print
(
reference_slice
)
try
:
try
:
plt
.
figure
()
reference_slice
.
plot
()
reference_slice
.
plot
()
fig1
=
plt
.
gcf
()
fig1
=
plt
.
gcf
()
with
col1
:
with
col1
:
...
@@ -76,8 +76,5 @@ def plot_comparison(data, slice_selection):
...
@@ -76,8 +76,5 @@ def plot_comparison(data, slice_selection):
except
TypeError
:
except
TypeError
:
pass
pass
else
:
else
:
st
.
text
(
"
Compress the data to show the plot!
"
)
st
.
text
(
"
Compress the data to show the plot!
"
)
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