Skip to content

Commit 3988ba4

Browse files
committed
Fix style issues
1 parent ea40d72 commit 3988ba4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/emsarray/transect/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from .base import Transect, TransectPoint, TransectSegment
22
from .utils import plot, setup_depth_axis, setup_distance_axis
33

4-
54
__all__ = [
65
'Transect', 'TransectPoint', 'TransectSegment',
76
'plot', 'setup_depth_axis', 'setup_distance_axis',

src/emsarray/transect/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from . import artists
1919

20-
2120
# Useful for calculating distances in a AzimuthalEquidistant projection
2221
# centred on some point:
2322
#
@@ -525,7 +524,8 @@ def make_transect_step_artist(
525524
"""
526525
data_array = name_to_data_array(self.dataset, data_array)
527526
if edgecolor == 'auto':
528-
edgecolor = axes._get_lines.get_next_color()
527+
cycler: Any = axes._get_lines # type: ignore
528+
edgecolor = cast(ColorType, cycler.get_next_color())
529529
artist = artists.TransectStepArtist.from_transect(
530530
self, data_array=data_array,
531531
fill=fill, edgecolor=edgecolor, **kwargs)

src/emsarray/transect/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from emsarray.plot import make_plot_title
1414
from emsarray.types import DataArrayOrName, Landmark
1515
from emsarray.utils import name_to_data_array
16+
1617
from .base import Transect
1718

1819

@@ -77,6 +78,7 @@ def plot(
7778

7879
setup_distance_axis(transect, axes)
7980
if depth_coordinate is not None:
81+
ylim: tuple[float, float] | bool
8082
if len(transect.segments) > 0:
8183
depths_with_data = numpy.flatnonzero(numpy.isfinite(transect_data.values).any(axis=-1))
8284
depth_bounds = dataset[depth_coordinate.attrs['bounds']]
@@ -85,7 +87,7 @@ def plot(
8587
depth_bounds.values[depths_with_data[-1], 1],
8688
)
8789
else:
88-
ylim = None
90+
ylim = False
8991
setup_depth_axis(transect, axes, depth_coordinate=depth_coordinate, ylim=ylim)
9092

9193
if bathymetry is not None:
@@ -181,12 +183,12 @@ def setup_depth_axis(
181183
axes.set_ylim(depth_max, depth_min)
182184
else:
183185
axes.set_ylim(depth_min, depth_max)
184-
elif ylim not in {False, None}:
186+
elif ylim is not False:
185187
axes.set_ylim(ylim)
186188

187189
if label is True:
188-
label = depth_coordinate.attrs.get('long_name')
189-
if label not in {False, None}:
190+
label = str(depth_coordinate.attrs.get('long_name'))
191+
if label is not None and label is not False:
190192
axis.set_label_text(label)
191193

192194
if units is True:

0 commit comments

Comments
 (0)