Skip to content

Commit

Permalink
Fix code style issues with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Feb 18, 2023
1 parent 1ee3c15 commit ff8ae3d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
2 changes: 0 additions & 2 deletions rocketpy/AeroSurfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ def rollInfo(self):
return None

def airfoilPlots(self):

if self.airfoil is not None:
airfoilCl = Function(
self.airfoil[0],
Expand Down Expand Up @@ -1480,7 +1479,6 @@ def geometricInfo(self):
return None

def aerodynamicInfo(self):

print(f"\nTail name: {self.name}")
print(f"Tail Center of Pressure Position in Local Coordinates: {self.cp} m")
print(f"Tail Lift Coefficient Slope: {self.clalpha:.3f} 1/rad")
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/EnvironmentAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ def parsePressureLevelData(self):

# Loop through time and save all values
for timeIndex, timeNum in enumerate(timeNumArray):

dateString, hourString, dateTime = self.__timeNumToDateString(
timeNum, timeNumArray.units, calendar="gregorian"
)
Expand Down Expand Up @@ -820,7 +819,6 @@ def parseSurfaceData(self):

# Loop through time and save all values
for timeIndex, timeNum in enumerate(timeNumArray):

dateString, hourString, dateTime = self.__timeNumToDateString(
timeNum, timeNumArray.units, calendar="gregorian"
)
Expand Down Expand Up @@ -2138,7 +2136,7 @@ def plot_wind_gust_distribution_over_average_day(self):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, 0, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.set_title(f"{float(hour):05.2f}".replace(".", ":"), y=0.8)
Expand Down Expand Up @@ -2300,7 +2298,7 @@ def plot_sustained_surface_wind_speed_distribution_over_average_day(
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, 0, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.set_title(f"{float(hour):05.2f}".replace(".", ":"), y=0.8)
Expand Down Expand Up @@ -2344,7 +2342,7 @@ def plot_sustained_surface_wind_speed_distribution_over_average_day(
)

if windSpeedLimit:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky Range Altitude Limits j]
ax = axs[i, j]
ax.vlines(
Expand Down Expand Up @@ -2677,7 +2675,7 @@ def plot_wind_profile_over_average_day(self, clear_range_limits=False):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, np.inf, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.plot(*self.average_wind_profile_at_given_hour[hour], "r-")
Expand Down Expand Up @@ -2710,7 +2708,7 @@ def plot_wind_profile_over_average_day(self, clear_range_limits=False):
)

if clear_range_limits:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky Range Altitude Limits
ax = axs[i, j]
ax.fill_between(
Expand Down Expand Up @@ -2819,7 +2817,7 @@ def plot_wind_heading_profile_over_average_day(self, clear_range_limits=False):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, np.inf, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.plot(*self.average_wind_heading_profile_at_given_hour[hour], "r-")
Expand All @@ -2844,7 +2842,7 @@ def plot_wind_heading_profile_over_average_day(self, clear_range_limits=False):
)

if clear_range_limits:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky range limits
ax = axs[i, j]
ax.fill_between(
Expand Down
1 change: 0 additions & 1 deletion rocketpy/plots/compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def create_comparison_figure(
raise AttributeError(f"Invalid attribute {y_attributes[i]}.")

for i, subplot in enumerate(ax):

# Set the labels for the x and y axis
subplot.set_xlabel(x_labels[i])
subplot.set_ylabel(y_labels[i])
Expand Down
4 changes: 0 additions & 4 deletions rocketpy/plots/compare/compare_flights.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,6 @@ def compare_trajectories_3d(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, y, z = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1383,7 +1382,6 @@ def __plot_xy(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, y, _ = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1447,7 +1445,6 @@ def __plot_xz(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, _, z = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1514,7 +1511,6 @@ def __plot_yz(

# Iterate through trajectories
for index, flight in enumerate(flights):

_, y, z = flight

# Update mx and min values to set the limits of the plot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
position=parameters.get("tailDistanceToCM")[0],
)


# Parachute set-up
def drogueTrigger(p, y):
# p = pressure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
position=parameters.get("transitiondistanceToCM")[0],
)


# Parachute set-up
def drogueTrigger(p, y):
# p = pressure
Expand Down
1 change: 0 additions & 1 deletion tests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_gefs_atmosphere(mock_show, example_env_robust):

@patch("matplotlib.pyplot.show")
def test_info_returns(mock_show, example_env):

returned_plots = example_env.allPlotInfoReturned()
returned_infos = example_env.allInfoReturned()
expected_info = {
Expand Down

0 comments on commit ff8ae3d

Please sign in to comment.