From d29dc022b842f22f6694c8d6c5ba19b4f3e470ab Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 29 Nov 2023 19:21:30 +0100 Subject: [PATCH 1/4] DOC: update header related docs for new Function changes --- docs/user/function.rst | 2 +- docs/user/motors/thrust.rst | 2 +- docs/user/rocket.rst | 4 ++-- rocketpy/motors/hybrid_motor.py | 8 ++++---- rocketpy/motors/liquid_motor.py | 8 ++++---- rocketpy/motors/motor.py | 10 +++++----- rocketpy/motors/solid_motor.py | 8 ++++---- rocketpy/rocket/aero_surface.py | 12 ++++++------ rocketpy/rocket/rocket.py | 8 ++++---- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/user/function.rst b/docs/user/function.rst index bd40d4dad..ed78fdd13 100644 --- a/docs/user/function.rst +++ b/docs/user/function.rst @@ -120,7 +120,7 @@ Having the csv file, we can define a ``Function`` object with it: print(f.source) .. note:: - A header in the csv file is optional, but if present must be in a string like format, i.e. beginning and ending with quotation marks. + A single header line in the csv file is optional. b. Function Map ~~~~~~~~~~~~~~~ diff --git a/docs/user/motors/thrust.rst b/docs/user/motors/thrust.rst index 0642247af..e83e70617 100644 --- a/docs/user/motors/thrust.rst +++ b/docs/user/motors/thrust.rst @@ -52,7 +52,7 @@ specify a directory containing a .csv file. .. note:: The first column of the .csv file must be time in seconds and the second - column must be thrust in Newtons. The file must contain no headers. + column must be thrust in Newtons. The file can contain a single line header. That can be done as follows: diff --git a/docs/user/rocket.rst b/docs/user/rocket.rst index ddd6fbfb4..9846ac9b5 100644 --- a/docs/user/rocket.rst +++ b/docs/user/rocket.rst @@ -96,8 +96,8 @@ Here is an example of a drag curve file: 0.9, 0.45696342 1.0, 0.62744566 -.. important:: - The CSV file must have **no headers**. +.. note:: + The CSV file can contain a single line header. .. tip:: Getting a drag curve can be a challenging task. To get really accurate diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index 92f386177..63c84e4de 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -214,10 +214,10 @@ def __init__( also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. - The .csv file shall contain no headers and the first column must - specify time in seconds, while the second column specifies thrust. - Arrays may also be specified, following rules set by the class - Function. Thrust units are Newtons. + The .csv file can contain a single line header and the first column + must specify time in seconds, while the second column specifies + thrust. Arrays may also be specified, following rules set by the + class Function. Thrust units are Newtons. .. seealso:: :doc:`Thrust Source Details ` dry_mass : int, float diff --git a/rocketpy/motors/liquid_motor.py b/rocketpy/motors/liquid_motor.py index 68da73fbe..ac525b379 100644 --- a/rocketpy/motors/liquid_motor.py +++ b/rocketpy/motors/liquid_motor.py @@ -175,10 +175,10 @@ def __init__( also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. - The .csv file shall contain no headers and the first column must - specify time in seconds, while the second column specifies thrust. - Arrays may also be specified, following rules set by the class - Function. Thrust units are Newtons. + The .csv file can contain a single line header and the first column + must specify time in seconds, while the second column specifies + thrust. Arrays may also be specified, following rules set by the + class Function. Thrust units are Newtons. .. seealso:: :doc:`Thrust Source Details ` dry_mass : int, float diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index 1af08d7f1..72797a641 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -174,10 +174,10 @@ def __init__( also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. - The .csv file shall contain no headers and the first column must - specify time in seconds, while the second column specifies thrust. - Arrays may also be specified, following rules set by the class - Function. Thrust units are Newtons. + The .csv file can contain a single line header and the first column + must specify time in seconds, while the second column specifies + thrust. Arrays may also be specified, following rules set by the + class Function. Thrust units are Newtons. .. seealso:: :doc:`Thrust Source Details ` @@ -1092,7 +1092,7 @@ def __init__( also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. - The .csv file shall contain no headers and the first column must + The .csv file can contain a single line header and the first column must specify time in seconds, while the second column specifies thrust. Arrays may also be specified, following rules set by the class Function. Thrust units are Newtons. diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index fc7109392..b63b416a7 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -216,10 +216,10 @@ def __init__( also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. - The .csv file shall contain no headers and the first column must - specify time in seconds, while the second column specifies thrust. - Arrays may also be specified, following rules set by the class - Function. Thrust units are Newtons. + The .csv file can contain a single line header and the first column + must specify time in seconds, while the second column specifies + thrust. Arrays may also be specified, following rules set by the + class Function. Thrust units are Newtons. .. seealso:: :doc:`Thrust Source Details ` nozzle_radius : int, float diff --git a/rocketpy/rocket/aero_surface.py b/rocketpy/rocket/aero_surface.py index 82cafdd2a..7333ce028 100644 --- a/rocketpy/rocket/aero_surface.py +++ b/rocketpy/rocket/aero_surface.py @@ -629,8 +629,8 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files must contain no headers - and the first column must specify the angle of attack, while + or callable. The .csv and .txt files can contain a single line + header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] where x0 is the angle of attack and y0 is the lift coefficient. @@ -1037,8 +1037,8 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files must contain no headers - and the first column must specify the angle of attack, while + or callable. The .csv and .txt files can contain a single line + header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] where x0 is the angle of attack and y0 is the lift coefficient. @@ -1379,8 +1379,8 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files must contain no headers - and the first column must specify the angle of attack, while + or callable. The .csv and .txt files can contain a single line + header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] where x0 is the angle of attack and y0 is the lift coefficient. diff --git a/rocketpy/rocket/rocket.py b/rocketpy/rocket/rocket.py index 947c82acd..693952b60 100644 --- a/rocketpy/rocket/rocket.py +++ b/rocketpy/rocket/rocket.py @@ -955,8 +955,8 @@ def add_trapezoidal_fins( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files must contain no headers - and the first column must specify the angle of attack, while + or callable. The .csv and .txt files can contain a single line + header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] where x0 is the angle of attack and y0 is the lift coefficient. @@ -1036,8 +1036,8 @@ def add_elliptical_fins( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files must contain no headers - and the first column must specify the angle of attack, while + or callable. The .csv and .txt files can contain a single line + header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] where x0 is the angle of attack and y0 is the lift coefficient. From 31b6793f4aa63457c89e9be2cf569ba91efb2cab Mon Sep 17 00:00:00 2001 From: Lint Action Date: Wed, 29 Nov 2023 18:25:42 +0000 Subject: [PATCH 2/4] Fix code style issues with Black --- rocketpy/motors/solid_motor.py | 2 +- rocketpy/rocket/aero_surface.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index b63b416a7..5d38b24f8 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -217,7 +217,7 @@ def __init__( seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. The .csv file can contain a single line header and the first column - must specify time in seconds, while the second column specifies + must specify time in seconds, while the second column specifies thrust. Arrays may also be specified, following rules set by the class Function. Thrust units are Newtons. diff --git a/rocketpy/rocket/aero_surface.py b/rocketpy/rocket/aero_surface.py index 7333ce028..cea919141 100644 --- a/rocketpy/rocket/aero_surface.py +++ b/rocketpy/rocket/aero_surface.py @@ -629,7 +629,7 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files can contain a single line + or callable. The .csv and .txt files can contain a single line header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] @@ -1037,7 +1037,7 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files can contain a single line + or callable. The .csv and .txt files can contain a single line header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] @@ -1379,7 +1379,7 @@ def __init__( Otherwise, if tuple, fins will be considered as airfoils. The tuple's first item specifies the airfoil's lift coefficient by angle of attack and must be either a .csv, .txt, ndarray - or callable. The .csv and .txt files can contain a single line + or callable. The .csv and .txt files can contain a single line header and the first column must specify the angle of attack, while the second column must specify the lift coefficient. The ndarray should be as [(x0, y0), (x1, y1), (x2, y2), ...] From cd366f28c3081b155860e42dbb57846b67ed337b Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 29 Nov 2023 23:26:23 +0100 Subject: [PATCH 3/4] MNT: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2abd6ed91..579756188 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ straightforward as possible. ### Changed - ENH: Function Reverse Arithmetic Priority [#488](https://github.com/RocketPy-Team/RocketPy/pull/488) +- DOC: Update Header Related Docs ### Fixed From 94eded413043b66214742664d2a26b79149ed334 Mon Sep 17 00:00:00 2001 From: MateusStano <69485049+MateusStano@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:51:04 -0300 Subject: [PATCH 4/4] MNT: remove uncessary note --- docs/user/rocket.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/user/rocket.rst b/docs/user/rocket.rst index 9846ac9b5..28e091e8d 100644 --- a/docs/user/rocket.rst +++ b/docs/user/rocket.rst @@ -96,9 +96,6 @@ Here is an example of a drag curve file: 0.9, 0.45696342 1.0, 0.62744566 -.. note:: - The CSV file can contain a single line header. - .. tip:: Getting a drag curve can be a challenging task. To get really accurate drag curves, you can use CFD software or wind tunnel data.