Skip to content

Commit

Permalink
ensure int/float can work for non-fixed vertical levels
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Oct 14, 2024
1 parent d87d8df commit 92d8b8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nctoolkit/verticals.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def vertical_interp(
if thickness is not None:
fixed = False

if isinstance(levels, (int, float)):
levels = [levels]

if fixed is False:
self.to_zlevels(
levels=levels, thickness=thickness, depths=depths, surface=surface
Expand All @@ -191,8 +194,6 @@ def vertical_interp(

# first a quick fix for the case when there is only one vertical depth

if isinstance(levels, (int, float)):
levels = [levels]

# levels = [float(x) for x in levels]

Expand Down

0 comments on commit 92d8b8d

Please sign in to comment.