Skip to content

Commit

Permalink
Switch over all other NaNs
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Oct 3, 2024
1 parent 9832d8a commit 58fa635
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions wisdem/ccblade/Polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ def _intersections(x1, y1, x2, y2, plot=False, minDist=1e-6, verbose=False):
"""
INTERSECTIONS Intersections of curves.
Computes the (x,y) locations where two curves intersect. The curves
can be broken with NaNs or have vertical segments.
can be broken with nans or have vertical segments.
Written by: Sukhbinder, https://github.com/sukhbinder/intersection
adapted by E.Branlard to allow for minimum distance between points
Expand Down Expand Up @@ -1915,7 +1915,7 @@ def _rectangle_intersection_(x1, y1, x2, y2):
try:
T[:, i] = np.linalg.solve(AA[:, :, i], BB[:, i])
except:
T[:, i] = np.NaN
T[:, i] = np.nan

in_range = (T[0, :] >= 0) & (T[1, :] >= 0) & (T[0, :] <= 1) & (T[1, :] <= 1)

Expand Down
2 changes: 1 addition & 1 deletion wisdem/ccblade/ccblade.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def distributedAeroLoads(self, Uinf, Omega, pitch, azimuth):
) = self.__loads(phi_star, rotating, *args)

if np.isnan(Np[i]):
print(f"NaNs at {i}/{n}: {phi_lower} {phi_star} {phi_upper}")
print(f"nans at {i}/{n}: {phi_lower} {phi_star} {phi_upper}")
a[i] = 0.0
ap[i] = 0.0
Np[i] = 0.0
Expand Down
2 changes: 1 addition & 1 deletion wisdem/landbosse/model/CollectionCost.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def calc_num_turb_partial_strings(self, num_leftover_turb, num_turb_per_cable):

# Check to make sure there aren't any zeros in num_turbines_per_cable, which is used as the denominator
# in the division above (this happens when not all of the cable types in the input sheet need to be used).
# If there is a zero, then print a warning and change NaN to 0 in perc_partial_string.
# If there is a zero, then print a warning and change nan to 0 in perc_partial_string.
if 0.0 in num_turb_per_cable:
print(
f'Warning: {self.project_name} CollectionCost module generates number of turbines per string that '
Expand Down
36 changes: 18 additions & 18 deletions wisdem/orbit/core/vessel.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def extract_vessel_dayrate(self):
self.day_rate = self.config["vessel_specs"]["day_rate"]

except KeyError:
self.day_rate = np.NaN
self.day_rate = np.nan

def mobilize(self):
"""
Expand Down Expand Up @@ -390,9 +390,9 @@ def update_trip_data(self, cargo=True, deck=True, items=True):
if storage is None:
raise Exception("Vessel does not have storage capacity.")

_cargo = storage.current_cargo_mass if cargo else np.NaN
_deck = storage.current_deck_space if deck else np.NaN
_items = dict(Counter(i for i in storage.items)) if items else np.NaN
_cargo = storage.current_cargo_mass if cargo else np.nan
_deck = storage.current_deck_space if deck else np.nan
_items = dict(Counter(i for i in storage.items)) if items else np.nan

trip = Trip(cargo_mass=_cargo, deck_space=_deck, items=_items)

Expand All @@ -413,7 +413,7 @@ def cargo_mass_utilizations(self):
return np.array(self.cargo_mass_list) / max_cargo_mass

except MissingComponent:
return np.array(np.NaN)
return np.array(np.nan)

@property
def deck_space_list(self):
Expand All @@ -430,14 +430,14 @@ def deck_space_utilizations(self):
return np.array(self.deck_space_list) / max_deck_space

except MissingComponent:
return np.array(np.NaN)
return np.array(np.nan)

@property
def max_cargo_mass_utilization(self):
"""Returns maximum cargo mass utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.max(self.cargo_mass_utilizations)

Expand All @@ -446,7 +446,7 @@ def min_cargo_mass_utilization(self):
"""Returns minimum cargo mass utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.min(self.cargo_mass_utilizations)

Expand All @@ -455,7 +455,7 @@ def mean_cargo_mass_utilization(self):
"""Returns mean cargo mass utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.mean(self.cargo_mass_utilizations)

Expand All @@ -464,7 +464,7 @@ def median_cargo_mass_utilization(self):
"""Returns median cargo mass utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.median(self.cargo_mass_utilizations)

Expand All @@ -473,7 +473,7 @@ def max_deck_space_utilization(self):
"""Returns maximum deck_space utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.max(self.deck_space_utilizations)

Expand All @@ -482,7 +482,7 @@ def min_deck_space_utilization(self):
"""Returns minimum deck_space utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.min(self.deck_space_utilizations)

Expand All @@ -491,7 +491,7 @@ def mean_deck_space_utilization(self):
"""Returns mean deck space utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.mean(self.deck_space_utilizations)

Expand All @@ -500,7 +500,7 @@ def median_deck_space_utilization(self):
"""Returns median deck space utilization."""

if not self.trip_data:
return np.NaN
return np.nan

return np.median(self.deck_space_utilizations)

Expand All @@ -509,7 +509,7 @@ def max_items_by_mass(self):
"""Returns items corresponding to `self.max_cargo_mass`."""

if not self.trip_data:
return np.NaN
return np.nan

i = np.argmax(self.cargo_mass_list)
return self.trip_data[i].items
Expand All @@ -519,7 +519,7 @@ def min_items_by_mass(self):
"""Returns items corresponding to `self.min_cargo_mass`."""

if not self.trip_data:
return np.NaN
return np.nan

i = np.argmin(self.cargo_mass_list)
return self.trip_data[i].items
Expand All @@ -529,7 +529,7 @@ def max_items_by_space(self):
"""Returns items corresponding to `self.max_deck_space`."""

if not self.trip_data:
return np.NaN
return np.nan

i = np.argmax(self.deck_space_list)
return self.trip_data[i].items
Expand All @@ -539,7 +539,7 @@ def min_items_by_space(self):
"""Returns items corresponding to `self.min_deck_space`."""

if not self.trip_data:
return np.NaN
return np.nan

i = np.argmin(self.deck_space_list)
return self.trip_data[i].items
2 changes: 1 addition & 1 deletion wisdem/orbit/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def map_funcs(obj, funcs):
)

except AttributeError:
res = np.NaN
res = np.nan

results[k] = res

Expand Down

0 comments on commit 58fa635

Please sign in to comment.