Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CFA Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
JOSSOUD Olivier
CFA Analysis
Commits
f00f0f68
Commit
f00f0f68
authored
5 years ago
by
JOSSOUD Olivier
Browse files
Options
Downloads
Patches
Plain Diff
Stab. Keep window's view box when changing variable.
parent
e2415a7a
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
src/uim/explouim.py
+21
-5
21 additions, 5 deletions
src/uim/explouim.py
with
21 additions
and
5 deletions
src/uim/explouim.py
+
21
−
5
View file @
f00f0f68
...
@@ -637,22 +637,23 @@ class ExploUim:
...
@@ -637,22 +637,23 @@ class ExploUim:
self
.
stab_region_left
.
setRegion
([
x_min
,
x_1_third
])
self
.
stab_region_left
.
setRegion
([
x_min
,
x_1_third
])
self
.
stab_region_right
.
setRegion
([
x_2_third
,
x_max
])
self
.
stab_region_right
.
setRegion
([
x_2_third
,
x_max
])
# Re-calculate the position of the left/right means
self
.
__update_region_characteristics__
(
self
.
stab_region_left
,
"
left
"
)
self
.
__update_region_characteristics__
(
self
.
stab_region_right
,
"
right
"
)
# X range is the same as main window's plot X range
# X range is the same as main window's plot X range
self
.
stab_plot_item
.
getViewBox
().
disableAutoRange
()
self
.
stab_plot_item
.
getViewBox
().
setXRange
(
min
=
main_range
[
0
][
0
],
self
.
stab_plot_item
.
getViewBox
().
setXRange
(
min
=
main_range
[
0
][
0
],
max
=
main_range
[
0
][
1
],
max
=
main_range
[
0
][
1
],
padding
=
0
)
padding
=
0
)
# Otherwise, the function is executed due to a variable change --> keep current viewbox and regions settings.
# Otherwise, the function is executed due to a variable change --> keep current viewbox and regions settings.
else
:
else
:
pass
pass
self
.
stab_plot_item
.
getViewBox
().
setYRange
(
min
=
self
.
stab_timeseries
[
"
value
"
].
min
(),
self
.
stab_plot_item
.
getViewBox
().
setYRange
(
min
=
self
.
stab_timeseries
[
"
value
"
].
min
(),
max
=
self
.
stab_timeseries
[
"
value
"
].
max
(),
max
=
self
.
stab_timeseries
[
"
value
"
].
max
(),
padding
=
0
)
padding
=
0
)
# Re-calculate the position of the left/right means
self
.
__update_region_characteristics__
(
self
.
stab_region_left
,
"
left
"
)
self
.
__update_region_characteristics__
(
self
.
stab_region_right
,
"
right
"
)
def
__update_region_characteristics__
(
self
,
region
:
pg
.
LinearRegionItem
,
side
:
str
):
def
__update_region_characteristics__
(
self
,
region
:
pg
.
LinearRegionItem
,
side
:
str
):
df
=
self
.
stab_timeseries
.
copy
()
df
=
self
.
stab_timeseries
.
copy
()
...
@@ -666,8 +667,23 @@ class ExploUim:
...
@@ -666,8 +667,23 @@ class ExploUim:
# Compute x_value's average and standard deviation over the selected region.
# Compute x_value's average and standard deviation over the selected region.
mean
=
inside_values
.
mean
()
mean
=
inside_values
.
mean
()
sd
=
inside_values
.
std
()
sd
=
inside_values
.
std
()
# Hide InfiniteLines if it is not possible to calculate any region's average.
if
math
.
isnan
(
mean
):
if
math
.
isnan
(
mean
):
self
.
stab_high_hline
.
hide
()
self
.
stab_low_hline
.
hide
()
self
.
stab_high_vline
.
hide
()
self
.
stab_low_vline
.
hide
()
self
.
stab_left_mean_line
.
hide
()
self
.
stab_right_mean_line
.
hide
()
return
return
else
:
self
.
stab_high_hline
.
show
()
self
.
stab_low_hline
.
show
()
self
.
stab_high_vline
.
show
()
self
.
stab_low_vline
.
show
()
self
.
stab_left_mean_line
.
show
()
self
.
stab_right_mean_line
.
show
()
# Update UI's text zones
# Update UI's text zones
getattr
(
self
.
stab_window
.
ui
,
"
stab_lineedit_
"
+
side
+
"
_mean
"
).
setText
(
"
{:.3f}
"
.
format
(
mean
))
getattr
(
self
.
stab_window
.
ui
,
"
stab_lineedit_
"
+
side
+
"
_mean
"
).
setText
(
"
{:.3f}
"
.
format
(
mean
))
...
...
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