Skip to content

Commit 7cd217d

Browse files
committed
Merge branch 'master' into norm_for_each_many_vars
2 parents 4446419 + 45575f9 commit 7cd217d

9 files changed

Lines changed: 20 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ coverage.xml
4848

4949
# vim
5050
*.sw?
51+
52+
# vscode
5153
/.vscode

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
1111
### Fixed
1212
- fixed bug where numpy>2.4 broke `data.join`
1313

14+
### Changed
15+
- per [PEP 765](https://peps.python.org/pep-0765/), `return` is removed from `finally` blocks
16+
1417
## [3.6.1]
1518

1619
### Changed

WrightTools/_dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ def natural_name(self):
148148
assert self._natural_name is not None
149149
except (AssertionError, AttributeError):
150150
self._natural_name = self.attrs["name"]
151-
finally:
152-
return self._natural_name
151+
return self._natural_name
153152

154153
@natural_name.setter
155154
def natural_name(self, value):

WrightTools/_group.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ def natural_name(self):
237237
assert self._natural_name is not None
238238
except (AssertionError, AttributeError):
239239
self._natural_name = self.attrs["name"]
240-
finally:
241-
return self._natural_name
240+
return self._natural_name
242241

243242
@natural_name.setter
244243
def natural_name(self, value):
@@ -269,8 +268,7 @@ def parent(self):
269268
if key.endswith("::"):
270269
key += posixpath.sep
271270
self._parent = Group._instances[key]
272-
finally:
273-
return self._parent
271+
return self._parent
274272

275273
def close(self):
276274
"""Close the file that contains the Group.

WrightTools/artists/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def corner_text(
188188
text : str
189189
The text to use.
190190
distance : number (optional)
191-
Distance from the corner. Default is 0.05.
191+
Distance from the corner. Default is 0.075.
192192
ax : axis (optional)
193193
The axis object to label. If None, uses current axis. Default is None.
194194
corner : {'UL', 'LL', 'UR', 'LR'} (optional)

WrightTools/data/_axis.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def ndim(self) -> int:
120120
assert self._ndim is not None
121121
except (AssertionError, AttributeError):
122122
self._ndim = self.variables[0].ndim
123-
finally:
124-
return self._ndim
123+
return self._ndim
125124

126125
@property
127126
def points(self) -> np.ndarray:
@@ -168,8 +167,7 @@ def variables(self) -> list:
168167
if key in self.parent.variable_names:
169168
indices.append(self.parent.variable_names.index(key))
170169
self._variables = [self.parent.variables[i] for i in indices]
171-
finally:
172-
return self._variables
170+
return self._variables
173171

174172
@property
175173
def masked(self) -> np.ndarray:

WrightTools/data/_data.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def ndim(self) -> int:
166166
self._ndim = 0
167167
else:
168168
self._ndim = self.variables[0].ndim
169-
finally:
170-
return self._ndim
169+
return self._ndim
171170

172171
@property
173172
def shape(self) -> tuple:
@@ -176,8 +175,7 @@ def shape(self) -> tuple:
176175
assert self._shape is not None
177176
except (AssertionError, AttributeError):
178177
self._shape = wt_kit.joint_shape(*self.variables)
179-
finally:
180-
return self._shape
178+
return self._shape
181179

182180
@property
183181
def size(self) -> int:
@@ -221,8 +219,7 @@ def variables(self) -> tuple:
221219
assert self._variables is not None
222220
except (AssertionError, AttributeError):
223221
self._variables = [self[n] for n in self.variable_names]
224-
finally:
225-
return tuple(self._variables)
222+
return tuple(self._variables)
226223

227224
@property
228225
def _leaf(self):

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ add-ignore = D105
2323
[tool:pytest]
2424
addopts = --durations=10 --cov=WrightTools --verbose --cov-report term:skip-covered
2525
python_files = tests/*.py
26+
markers = ["mp_group"]

tests/artists/test_interact2D.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def test_perovskite():
1515
break
1616
except:
1717
pass
18-
return wt.artists.interact2D(data, xaxis=2, yaxis=1)
18+
# return wt.artists.interact2D(data, xaxis=2, yaxis=1)
1919

2020

2121
def test_MoS2():
2222
p = datasets.wt5.v1p0p1_MoS2_TrEE_movie # axes w2, w1=wm, d2
2323
data = wt.open(p)
2424
data.convert("eV")
2525
data.level(0, 2, -4)
26-
return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True)
26+
# return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True)
2727

2828

2929
def test_asymmetric():
@@ -37,7 +37,7 @@ def test_asymmetric():
3737
data.create_variable("x", values=x[:, None], units="wn")
3838
data.create_variable("y", values=y[None, :], units="wn")
3939
data.transform("x", "y")
40-
return wt.artists.interact2D(data, xaxis=1, yaxis=0)
40+
# return wt.artists.interact2D(data, xaxis=1, yaxis=0)
4141

4242

4343
def test_skewed():
@@ -46,7 +46,7 @@ def test_skewed():
4646
data = wt.data.from_PyCMDS(p)
4747
data.convert("wn", convert_variables=True)
4848
data.transform("wm", "w1") # wm = w1 + 2*w2
49-
return wt.artists.interact2D(data, xaxis=0, yaxis=1)
49+
# return wt.artists.interact2D(data, xaxis=0, yaxis=1)
5050

5151

5252
def test_4D():
@@ -82,7 +82,7 @@ def test_4D():
8282
data.create_variable("d_1", values=tau[None, None, None, :], units="ps")
8383

8484
data.transform("w_1", "w_2", "w_3", "d_1")
85-
return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True, use_imshow=True)
85+
# return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True, use_imshow=True)
8686

8787

8888
if __name__ == "__main__":

0 commit comments

Comments
 (0)