Skip to content

Commit b1f3f9f

Browse files
committed
MNT: post merge fixes and linting.
1 parent a5938c5 commit b1f3f9f

File tree

7 files changed

+18
-64
lines changed

7 files changed

+18
-64
lines changed

rocketpy/motors/hybrid_motor.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -615,27 +615,3 @@ def draw(self, filename=None):
615615
None
616616
"""
617617
self.plots.draw(filename)
618-
619-
def info(self, filename=None):
620-
"""Prints out basic data about the Motor.
621-
622-
Parameters
623-
----------
624-
filename : str | None, optional
625-
The path the plot should be saved to. By default None, in which case
626-
the plot will be shown instead of saved. Supported file endings are:
627-
eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff
628-
and webp (these are the formats supported by matplotlib).
629-
630-
Returns
631-
-------
632-
None
633-
"""
634-
self.prints.all()
635-
self.plots.thrust(filename=filename)
636-
return None
637-
638-
def all_info(self):
639-
"""Prints out all data and graphs available about the Motor."""
640-
self.prints.all()
641-
self.plots.all()

rocketpy/motors/liquid_motor.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,3 @@ def draw(self, filename=None):
477477
None
478478
"""
479479
self.plots.draw(filename)
480-
481-
def info(self):
482-
"""Prints out basic data about the Motor."""
483-
self.prints.all()
484-
self.plots.thrust()
485-
486-
def all_info(self):
487-
"""Prints out all data and graphs available about the Motor.
488-
489-
Return
490-
------
491-
None
492-
"""
493-
self.prints.all()
494-
self.plots.all()

rocketpy/motors/motor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,6 @@ def get_attr_value(obj, attr_name, multiplier=1):
10631063
# Write last line
10641064
file.write(f"{self.thrust.source[-1, 0]:.4f} {0:.3f}\n")
10651065

1066-
return None
1067-
10681066
def info(self, filename=None):
10691067
"""Prints out a summary of the data and graphs available about the
10701068
Motor.
@@ -1084,9 +1082,7 @@ def info(self, filename=None):
10841082
# Print motor details
10851083
self.prints.all()
10861084
self.plots.thrust(filename=filename)
1087-
return None
10881085

1089-
@abstractmethod
10901086
def all_info(self):
10911087
"""Prints out all data and graphs available about the Motor."""
10921088
self.prints.all()

rocketpy/motors/solid_motor.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,3 @@ def draw(self, filename=None):
741741
None
742742
"""
743743
self.plots.draw(filename)
744-
745-
def info(self):
746-
"""Prints out basic data about the SolidMotor."""
747-
self.prints.all()
748-
self.plots.thrust()
749-
750-
def all_info(self):
751-
"""Prints out all data and graphs available about the SolidMotor."""
752-
self.prints.all()
753-
self.plots.all()

rocketpy/plots/aero_surface_plots.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,24 @@ def draw(self, filename=None):
402402
ax.legend(bbox_to_anchor=(1.05, 1.0), loc="upper left")
403403

404404
plt.tight_layout()
405-
plt.show()
405+
show_or_save_plot(filename)
406406

407407

408408
class _FreeFormFinsPlots(_FinsPlots):
409409
"""Class that contains all free form fin plots."""
410410

411411
# pylint: disable=too-many-statements
412-
def draw(self):
413-
"""Draw the fin shape along with some important information, including
414-
the center line, the quarter line and the center of pressure position.
412+
def draw(self, filename=None):
413+
"""Draw the fin shape along with some important information.
414+
These being: the center line and the center of pressure position.
415+
416+
Parameters
417+
----------
418+
filename : str | None, optional
419+
The path the plot should be saved to. By default None, in which case
420+
the plot will be shown instead of saved. Supported file endings are:
421+
eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff
422+
and webp (these are the formats supported by matplotlib).
415423
416424
Returns
417425
-------
@@ -469,7 +477,7 @@ def draw(self):
469477
ax.legend(bbox_to_anchor=(1.05, 1.0), loc="upper left")
470478

471479
plt.tight_layout()
472-
plt.show()
480+
show_or_save_plot(filename)
473481

474482

475483
class _TailPlots(_AeroSurfacePlots):
@@ -506,12 +514,12 @@ def all(self):
506514
class _GenericSurfacePlots(_AeroSurfacePlots):
507515
"""Class that contains all generic surface plots."""
508516

509-
def draw(self):
517+
def draw(self, filename=None):
510518
pass
511519

512520

513521
class _LinearGenericSurfacePlots(_AeroSurfacePlots):
514522
"""Class that contains all linear generic surface plots."""
515523

516-
def draw(self):
524+
def draw(self, filename=None):
517525
pass

rocketpy/plots/environment_analysis_plots.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def wind_gust_distribution(self, filename=None):
124124
plt.legend()
125125
show_or_save_plot(filename)
126126

127-
def surface10m_wind_speed_distribution(self, wind_speed_limit=False):
127+
def surface10m_wind_speed_distribution(self, wind_speed_limit=False, filename=None):
128128
"""Get all values of sustained surface wind speed (for every date and
129129
hour available) and plot a single distribution. Expected result is a
130130
Weibull distribution. The wind speed limit is plotted as a vertical line.
@@ -1369,8 +1369,7 @@ def surface_wind_speed_distribution_grid(
13691369
fig.supylabel("Probability")
13701370
show_or_save_plot(filename)
13711371

1372-
return None
1373-
1372+
# pylint: disable=too-many-statements
13741373
def animate_surface_wind_speed_distribution(self, wind_speed_limit=False):
13751374
"""Animation of how the sustained surface wind speed distribution varies
13761375
throughout the day. Each frame is a histogram of the wind speed distribution

rocketpy/plots/rocket_plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
from rocketpy.motors import EmptyMotor, HybridMotor, LiquidMotor, SolidMotor
77
from rocketpy.rocket.aero_surface import Fins, NoseCone, Tail
8+
from rocketpy.rocket.aero_surface.generic_surface import GenericSurface
89

910
from .plot_helpers import show_or_save_plot
10-
from rocketpy.rocket.aero_surface.generic_surface import GenericSurface
1111

1212

1313
class _RocketPlots:

0 commit comments

Comments
 (0)