Skip to content

Commit 9afa00b

Browse files
committed
DOC: improved docstrings of the three utilities functions of pre-registered motors
1 parent fc03457 commit 9afa00b

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

rocketpy/utilities.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,7 @@ def load_from_rpy(filename: str, resimulate=False):
766766

767767
def list_motors_dataset():
768768
"""
769-
Lists all motors available in the rocketpy/datasets/motors folder in the .eng format.
770-
771-
To load a specific motor, use 'load_motor_from_dataset(motor_name)'.
769+
Lists all motors available in the .eng format in RocketPy's dataset, located in ``rocketpy/datasets/motors``.
772770
773771
Returns
774772
-------
@@ -779,6 +777,10 @@ def list_motors_dataset():
779777
------
780778
ImportError
781779
If the motors dataset is not found.
780+
781+
Notes
782+
-----
783+
To load a specific motor, use :func:`load_motor_from_dataset`.
782784
"""
783785
try:
784786
motors_package = resources.files("rocketpy.datasets.motors")
@@ -789,8 +791,7 @@ def list_motors_dataset():
789791

790792
def load_motor_from_dataset(motor_name):
791793
"""
792-
Loads a motor from the dataset in the rocketpy/datasets/motors folder in the .eng format.
793-
To see all available motors, the list_motors_dataset() function is available.
794+
Loads a motor from the pre-registered motors included in RocketPy's dataset, located in ``rocketpy/datasets/motors``.
794795
795796
Parameters
796797
----------
@@ -801,6 +802,10 @@ def load_motor_from_dataset(motor_name):
801802
-------
802803
rocketpy.GenericMotor
803804
The loaded motor object.
805+
806+
Notes
807+
-----
808+
To get a list of all available motors, use :func:`list_motors_dataset`.
804809
"""
805810
motors_package = resources.files("rocketpy.datasets.motors")
806811
found = list(motors_package.rglob(f"{motor_name}.eng"))
@@ -821,17 +826,17 @@ def load_motor_from_dataset(motor_name):
821826

822827
def show_motors_dataset():
823828
"""
824-
Prints the list of available pre-registered motors included in the rocketpy dataset.
825-
829+
Prints the list of available pre-registered motors included in RocketPy's dataset, located in ``rocketpy/datasets/motors``.
826830
Useful for quick inspection in terminal or notebooks.
827831
828-
To load a motor as a genericmotor object, use:
829-
load_motor_from_dataset('motor_name')
830-
831832
Returns
832833
-------
833834
None
834835
This function does not return anything. it simply prints the available motors.
836+
837+
Notes
838+
-----
839+
To load a specific motor, use :func:`load_motor_from_dataset`.
835840
"""
836841
motors = list_motors_dataset()
837842
if not motors:

0 commit comments

Comments
 (0)