Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
adbafae8
Commit
adbafae8
authored
Jun 11, 2020
by
Thomas Vincent
Browse files
Merge branch 'update-silx-0.13.0' into 'master'
Avoid deprecation warnings with silx 0.13.0 See merge request
!126
parents
b30abfe8
e7fa90e1
Pipeline
#27091
passed with stages
in 21 minutes and 19 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
xsocs/gui/silx_imports/ImageRois.py
View file @
adbafae8
...
...
@@ -28,6 +28,7 @@ from collections import OrderedDict, namedtuple
import
numpy
as
np
from
silx.gui
import
qt
,
icons
from
silx
import
hexversion
as
silx_hexversion
__author__
=
[
"D. Naudet"
]
__license__
=
"MIT"
...
...
@@ -96,7 +97,6 @@ class RoiItemBase(qt.QObject):
self
.
_manager
=
parent
self
.
_plot
=
plot
self
.
_handles
=
[]
self
.
_items
=
[]
self
.
_points
=
{}
self
.
_kwargs
=
[]
...
...
@@ -133,9 +133,7 @@ class RoiItemBase(qt.QObject):
for
item
in
self
.
_handles
:
self
.
_plot
.
removeMarker
(
item
)
if
shape
:
self
.
_plot
.
removeItem
(
self
.
_name
)
for
item
in
self
.
_items
:
self
.
_plot
.
removeItem
(
item
)
self
.
_plot
.
remove
(
self
.
_name
,
kind
=
"item"
)
def
_interactiveModeChanged
(
self
,
source
):
if
source
is
not
self
or
source
is
not
self
.
parent
():
...
...
@@ -187,18 +185,6 @@ class RoiItemBase(qt.QObject):
except
ValueError
:
pass
def
_registerItem
(
self
,
legend
):
if
legend
in
self
.
_items
:
raise
ValueError
(
'Item {0} is already registered.'
''
.
format
(
legend
))
self
.
_items
.
append
(
legend
)
def
_unregisterItem
(
self
,
legend
):
try
:
self
.
_items
.
remove
(
legend
)
except
ValueError
:
pass
def
_connect
(
self
):
if
self
.
_connected
:
return
...
...
@@ -238,7 +224,11 @@ class RoiItemBase(qt.QObject):
assert
item
==
handle
def
_drawShape
(
self
):
item
=
self
.
_plot
.
addItem
(
self
.
xData
,
if
silx_hexversion
>=
0xd00d2
:
# silx >= v0.13.0b2
addShape
=
self
.
_plot
.
addShape
else
:
# Backward compatibility silx <=0.12.0
addShape
=
self
.
_plot
.
addItem
item
=
addShape
(
self
.
xData
,
self
.
yData
,
shape
=
self
.
shape
,
legend
=
self
.
_name
,
...
...
xsocs/gui/view/QspaceView.py
View file @
adbafae8
...
...
@@ -34,6 +34,7 @@ import os
import
numpy
as
np
from
silx
import
hexversion
as
silx_hexversion
from
silx.utils.weakref
import
WeakMethodProxy
from
silx.gui
import
qt
as
Qt
from
silx.gui.plot
import
actions
,
items
,
PlotToolButtons
,
PlotWidget
...
...
@@ -688,7 +689,11 @@ class QSpaceView(Qt.QMainWindow):
xRange
=
roiSliders
[
xIndex
].
getValues
()
yRange
=
roiSliders
[
yIndex
].
getValues
()
self
.
__stackView
.
addItem
(
if
silx_hexversion
>=
0xd00d2
:
# silx >= v0.13.0b2
addShape
=
self
.
__stackView
.
addShape
else
:
# Backward compatibility silx <=0.12.0
addShape
=
self
.
__stackView
.
addItem
addShape
(
xRange
,
yRange
,
legend
=
"__QSpaceView_ROI__"
,
shape
=
'rectangle'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment