Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4c38c6

Browse files
authored
Merge pull request#222 from dstansby/nopy38
Remove support for Python 3.8
2 parents16084b2 +d768a92 commitc4c38c6

File tree

12 files changed

+31
-31
lines changed

12 files changed

+31
-31
lines changed

‎.github/workflows/test_and_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast:false
2121
matrix:
2222
platform:[ubuntu-latest, macos-latest, windows-latest]
23-
python-version:['3.8', '3.9', '3.10', '3.11']
23+
python-version:['3.9', '3.10', '3.11']
2424

2525
steps:
2626
-uses:actions/checkout@v3

‎.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
rev:v1.6.0
2121
hooks:
2222
-id:mypy
23-
additional_dependencies:[numpy, matplotlib<3.8]
23+
additional_dependencies:[numpy, matplotlib]
2424

2525
-repo:https://github.com/astral-sh/ruff-pre-commit
2626
# Ruff version.

‎pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ profile = "black"
2323
line_length =79
2424

2525
[tool.ruff]
26-
target-version ="py38"
26+
target-version ="py39"
2727
select = ["I","UP","F","E","W","D"]
2828
ignore = [
2929
"D100",# Missing docstring in public module
@@ -45,7 +45,7 @@ fix = true
4545
convention ="numpy"
4646

4747
[tool.mypy]
48-
python_version ="3.8"
48+
python_version ="3.9"
4949
# Block below are checks that form part of mypy 'strict' mode
5050
warn_unused_configs =true
5151
warn_redundant_casts =true

‎setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install_requires =
3131
napari
3232
numpy
3333
tinycss2
34-
python_requires = >=3.8
34+
python_requires = >=3.9
3535
include_package_data = True
3636
package_dir =
3737
=src

‎src/napari_matplotlib/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
importos
22
frompathlibimportPath
3-
fromtypingimportList,Optional,Tuple
3+
fromtypingimportOptional
44

55
importmatplotlib
66
importmatplotlib.styleasmplstyle
@@ -184,7 +184,7 @@ class NapariMPLWidget(BaseNapariMPLWidget):
184184
#: Number of layers taken as input
185185
n_layers_input=Interval(None,None)
186186
#: Type of layer taken as input
187-
input_layer_types:Tuple[napari.layers.Layer, ...]= (napari.layers.Layer,)
187+
input_layer_types:tuple[napari.layers.Layer, ...]= (napari.layers.Layer,)
188188

189189
def__init__(
190190
self,
@@ -193,7 +193,7 @@ def __init__(
193193
):
194194
super().__init__(napari_viewer=napari_viewer,parent=parent)
195195
self._setup_callbacks()
196-
self.layers:List[napari.layers.Layer]= []
196+
self.layers:list[napari.layers.Layer]= []
197197

198198
helper_text=self.n_layers_input._helper_text
199199
ifhelper_textisnotNone:

‎src/napari_matplotlib/histogram.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fromtypingimportAny,List,Optional,Tuple
1+
fromtypingimportAny,Optional
22

33
importnapari
44
importnumpyasnp
@@ -107,7 +107,7 @@ def _set_axis_keys(self, x_axis_key: str) -> None:
107107
self._x_axis_key=x_axis_key
108108
self._draw()
109109

110-
def_get_valid_axis_keys(self)->List[str]:
110+
def_get_valid_axis_keys(self)->list[str]:
111111
"""
112112
Get the valid axis keys from the layer FeatureTable.
113113
@@ -122,7 +122,7 @@ def _get_valid_axis_keys(self) -> List[str]:
122122
else:
123123
returnself.layers[0].features.keys()
124124

125-
def_get_data(self)->Tuple[Optional[npt.NDArray[Any]],str]:
125+
def_get_data(self)->tuple[Optional[npt.NDArray[Any]],str]:
126126
"""Get the plot data.
127127
128128
Returns

‎src/napari_matplotlib/scatter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fromtypingimportAny,Dict,List,Optional,Tuple,Union
1+
fromtypingimportAny,Optional,Union
22

33
importnapari
44
importnumpy.typingasnpt
@@ -40,7 +40,7 @@ def draw(self) -> None:
4040
self.axes.set_xlabel(x_axis_name)
4141
self.axes.set_ylabel(y_axis_name)
4242

43-
def_get_data(self)->Tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
43+
def_get_data(self)->tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
4444
"""
4545
Get the plot data.
4646
@@ -67,7 +67,7 @@ class ScatterWidget(ScatterBaseWidget):
6767
n_layers_input=Interval(2,2)
6868
input_layer_types= (napari.layers.Image,)
6969

70-
def_get_data(self)->Tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
70+
def_get_data(self)->tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
7171
"""
7272
Get the plot data.
7373
@@ -106,7 +106,7 @@ def __init__(
106106

107107
self.layout().addLayout(QVBoxLayout())
108108

109-
self._selectors:Dict[str,QComboBox]= {}
109+
self._selectors:dict[str,QComboBox]= {}
110110
fordimin ["x","y"]:
111111
self._selectors[dim]=QComboBox()
112112
# Re-draw when combo boxes are updated
@@ -147,7 +147,7 @@ def y_axis_key(self, key: str) -> None:
147147
self._selectors["y"].setCurrentText(key)
148148
self._draw()
149149

150-
def_get_valid_axis_keys(self)->List[str]:
150+
def_get_valid_axis_keys(self)->list[str]:
151151
"""
152152
Get the valid axis keys from the layer FeatureTable.
153153
@@ -186,7 +186,7 @@ def draw(self) -> None:
186186
ifself._ready_to_scatter():
187187
super().draw()
188188

189-
def_get_data(self)->Tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
189+
def_get_data(self)->tuple[npt.NDArray[Any],npt.NDArray[Any],str,str]:
190190
"""
191191
Get the plot data from the ``features`` attribute of the first
192192
selected layer.

‎src/napari_matplotlib/slice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fromtypingimportAny,List,Optional,Tuple
1+
fromtypingimportAny,Optional
22

33
importmatplotlib.tickerasmticker
44
importnapari
@@ -99,7 +99,7 @@ def current_dim_index(self) -> int:
9999
returnself._dim_names.index(self.current_dim_name)
100100

101101
@property
102-
def_dim_names(self)->List[str]:
102+
def_dim_names(self)->list[str]:
103103
"""
104104
List of dimension names. This is a property as it varies depending on the
105105
dimensionality of the currently selected data.
@@ -111,7 +111,7 @@ def _dim_names(self) -> List[str]:
111111
else:
112112
raiseRuntimeError("Don't know how to handle ndim != 2 or 3")
113113

114-
def_get_xy(self)->Tuple[npt.NDArray[Any],npt.NDArray[Any]]:
114+
def_get_xy(self)->tuple[npt.NDArray[Any],npt.NDArray[Any]]:
115115
"""
116116
Get data for plotting.
117117
"""

‎src/napari_matplotlib/tests/scatter/test_scatter_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fromcopyimportdeepcopy
2-
fromtypingimportAny,Dict,Tuple
2+
fromtypingimportAny
33

44
importnumpyasnp
55
importnumpy.typingasnpt
@@ -34,7 +34,7 @@ def test_features_scatter_widget_2D(
3434

3535

3636
defmake_labels_layer_with_features()-> (
37-
Tuple[npt.NDArray[np.uint16],Dict[str,Any]]
37+
tuple[npt.NDArray[np.uint16],dict[str,Any]]
3838
):
3939
label_image:npt.NDArray[np.uint16]=np.zeros((100,100),dtype=np.uint16)
4040
forlabel_value,start_indexinenumerate([10,30,50],start=1):

‎src/napari_matplotlib/tests/test_layer_changes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fromcopyimportdeepcopy
2-
fromtypingimportAny,Dict,Tuple,Type
2+
fromtypingimportAny
33

44
importnumpyasnp
55
importnumpy.typingasnpt
@@ -61,8 +61,8 @@ def test_change_features_layer(
6161

6262
defassert_features_plot_changes(
6363
viewer:Viewer,
64-
widget_cls:Type[NapariMPLWidget],
65-
data:Tuple[npt.NDArray[np.generic],Dict[str,Any]],
64+
widget_cls:type[NapariMPLWidget],
65+
data:tuple[npt.NDArray[np.generic],dict[str,Any]],
6666
)->None:
6767
"""
6868
When the selected layer is changed, make sure the plot generated

‎src/napari_matplotlib/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fromtypingimportList,Optional,Tuple,Union
1+
fromtypingimportOptional,Union
22
fromwarningsimportwarn
33

44
importnapari.qt
@@ -76,7 +76,7 @@ def _helper_text(self) -> Optional[str]:
7676
returnhelper_text
7777

7878

79-
def_has_id(nodes:List[tinycss2.ast.Node],id_name:str)->bool:
79+
def_has_id(nodes:list[tinycss2.ast.Node],id_name:str)->bool:
8080
"""
8181
Is `id_name` in IdentTokens in the list of CSS `nodes`?
8282
"""
@@ -86,7 +86,7 @@ def _has_id(nodes: List[tinycss2.ast.Node], id_name: str) -> bool:
8686

8787

8888
def_get_dimension(
89-
nodes:List[tinycss2.ast.Node],id_name:str
89+
nodes:list[tinycss2.ast.Node],id_name:str
9090
)->Union[int,None]:
9191
"""
9292
Get the value of the DimensionToken for the IdentToken `id_name`.
@@ -108,7 +108,7 @@ def _get_dimension(
108108

109109

110110
deffrom_napari_css_get_size_of(
111-
qt_element_name:str,fallback:Tuple[int,int]
111+
qt_element_name:str,fallback:tuple[int,int]
112112
)->QSize:
113113
"""
114114
Get the size of `qt_element_name` from napari's current stylesheet.

‎tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tox]
2-
envlist = py{38,39,310,311}
2+
envlist = py{39,310,311}
33
isolated_build = true
44

55
[gh-actions]
66
python =
7-
3.8: py38
87
3.9: py39
98
3.10: py310
9+
3.11: py311
1010

1111
[testenv]
1212
extras = testing

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp