Skip to content

Commit 6777507

Browse files
MNT: updates paths after refactoring the data folder
1 parent b0d22cf commit 6777507

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4397
-53500
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ env = Environment(
161161
latitude=32.990254,
162162
longitude=-106.974998,
163163
elevation=1400,
164-
)
164+
)
165165

166166
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
167167

@@ -182,7 +182,7 @@ A sample Motor object can be created by the following code:
182182

183183
```python
184184
Pro75M1670 = SolidMotor(
185-
thrust_source="data/motors/Cesaroni_M1670.eng",
185+
thrust_source="data/motors/cesaroni/Cesaroni_M1670.eng",
186186
dry_mass=1.815,
187187
dry_inertia=(0.125, 0.125, 0.002),
188188
center_of_dry_mass_position=0.317,
@@ -215,8 +215,8 @@ calisto = Rocket(
215215
radius=0.0635,
216216
mass=14.426, # without motor
217217
inertia=(6.321, 6.321, 0.034),
218-
power_off_drag="data/calisto/powerOffDragCurve.csv",
219-
power_on_drag="data/calisto/powerOnDragCurve.csv",
218+
power_off_drag="data/rockets/calisto/powerOffDragCurve.csv",
219+
power_on_drag="data/rockets/calisto/powerOnDragCurve.csv",
220220
center_of_mass_without_motor=0,
221221
coordinate_system_orientation="tail_to_nose",
222222
)
Binary file not shown.

docs/development/rocketpy_as_developer.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Go into the cloned repository folder by typing on a terminal
1616
Open your preference editor by typing on a terminal
1717

1818
.. code-block:: console
19-
19+
2020
<editor name> .
2121
2222
For example, to open VS Code type on terminal
2323

2424
.. code-block:: console
25-
25+
2626
code .
2727
2828
Alternatively, you can open the folder directly through your editor's interface.
@@ -45,7 +45,7 @@ To create the folder, type on the terminal:
4545
And, to add it on .gitignore, type:
4646

4747
.. code-block:: console
48-
48+
4949
echo <folder name>/ >> .gitignore
5050
5151
It is important to remember that all the files inside this folder will not be included in any commit so, if it is important to the solution, do not add them inside it.
@@ -57,7 +57,7 @@ Importing the RocketPy files
5757
----------------------------
5858

5959
First, create a python (or .ipynb) file to make the simulation.
60-
To ensure you are using the local files and not the files as a python package (if you installed the library via pip for example), add
60+
To ensure you are using the local files and not the files as a python package (if you installed the library via pip for example), add
6161

6262
.. code-block:: python
6363
@@ -66,15 +66,15 @@ To ensure you are using the local files and not the files as a python package (i
6666
Alternatively you can use the following command to pip install the local library:
6767

6868
.. code-block:: console
69-
69+
7070
import sys
7171
sys.path.append('../') # if you are using a notebook
7272
sys.path.append('../rocketpy') # if you are using a script
7373
7474
Import the classes that will be used, in case:
7575

7676
.. code-block:: python
77-
77+
7878
from rocketpy import Environment, SolidMotor, Rocket, Flight, Function
7979
8080
If it is the first time you are using rocketpy and you do not have all required libraries installed, you could use the command:
@@ -99,7 +99,7 @@ It contains information about the local pressure profile, temperature, speed of
9999
100100
env = Environment(latitude=32.990254, longitude=-106.974998, elevation=1400)
101101
102-
RocketPy can use local files via the Ensemble method or meteorological forecasts through OpenDAP protocol.
102+
RocketPy can use local files via the Ensemble method or meteorological forecasts through OpenDAP protocol.
103103
To work with environment files, it will be very important ensuring tha that you have the netCDF4 library installed.
104104
Assuming we are using forecast, first we set the simulated data with:
105105

@@ -122,14 +122,14 @@ Weather forecast data can be visualized through two info methods.
122122
Creating the motor that boosts the rocket
123123
-----------------------------------------
124124

125-
Now we need to create the motor.
125+
Now we need to create the motor.
126126
For example, we will use a solid motor called Pro75M1670, but other configurations are also possible.
127127
The motor class contains information about the thrust curve and uses some geometric parameters to calculate the mass variation over time, as well as the total thrust and other important outputs.
128128

129129
.. code-block:: python
130130
131131
Pro75M1670 = SolidMotor(
132-
thrust_source="../data/motors/Cesaroni_M1670.eng", #copy here the path to the thrust source file
132+
thrust_source="../data/motors/cesaroni/Cesaroni_M1670.eng", #copy here the path to the thrust source file
133133
burn_time=3.9,
134134
grain_number=5,
135135
grain_separation=5 / 1000,
@@ -160,8 +160,8 @@ The first step is to initialize the class with the vital data:
160160
mass=19.197 - 2.956,
161161
inertia_i=6.60,
162162
inertia_z=0.0351,
163-
power_off_drag="../../data/calisto/powerOffDragCurve.csv",
164-
power_on_drag="../../data/calisto/powerOnDragCurve.csv",
163+
power_off_drag="../../data/rockets/calisto/powerOffDragCurve.csv",
164+
power_on_drag="../../data/rockets/calisto/powerOnDragCurve.csv",
165165
center_of_dry_mass_position=0,
166166
coordinate_system_orientation="tail_to_nose",
167167
)
@@ -171,7 +171,7 @@ The first step is to initialize the class with the vital data:
171171
Then the rail buttons must be set:
172172

173173
.. code-block:: python
174-
174+
175175
calisto.set_rail_buttons(0.2, -0.5)
176176
177177
In sequence, the aerodynamic surfaces must be set.

docs/development/testing.rst

+26-26
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ Testing Guidelines
22
==================
33

44
This page describes the testing philosophy used throughout RocketPy's
5-
development with pytest. That includes the definition
5+
development with pytest. That includes the definition
66
and some technical discussion regarding:
77

88
* Testing philosophy and style
99
* Testing naming conventions
1010
* Directory structure
11-
* Unit tests definition
11+
* Unit tests definition
1212
* Integration tests definition
1313
* Acceptance tests definition
1414

@@ -21,7 +21,7 @@ First of all, it is worth noting the role of tests within the framework of Rocke
2121

2222
* Unit tests are the minimum requirement for a feature to be accepted.
2323

24-
That is, for each feature must correspond a testing unit which properly documents and tests the newly implemented feature.
24+
That is, for each feature must correspond a testing unit which properly documents and tests the newly implemented feature.
2525
In even more practical terms that means the Pull Request containing the feature should include an unit test together with it.
2626

2727
Testing Naming Conventions
@@ -48,7 +48,7 @@ RocketPy Team agreed upon following the testing convention where it's name exact
4848
* ``test_methodname_stateundertest``
4949
* ``test_methodname_expectedbehaviour``
5050

51-
However, in any case, it is of utmost importance that the expected behaviour or state to be tested
51+
However, in any case, it is of utmost importance that the expected behaviour or state to be tested
5252
**should be included within the docstring of the test**, just as illustrated below by the docstring
5353
of the same test:
5454

@@ -66,7 +66,7 @@ of the same test:
6666

6767
Do not get caught by the size of that docstring. The only requirements it has to satisfy is
6868
that the docstring contains precise information on the expected behaviour and/or behaviour
69-
to be tested.
69+
to be tested.
7070

7171
Directory Structure
7272
-------------------
@@ -93,14 +93,14 @@ RocketPy organizes its tests as follows:
9393
└── stochastic_file_2.py
9494

9595
As one might guess, each kind of test should be included within it's correspondent kind of test. For instance, if one is writing
96-
an unit testing module called ``test_flight.py``, it should be included within the ``unit`` folder. The same holds for other tests.
96+
an unit testing module called ``test_flight.py``, it should be included within the ``unit`` folder. The same holds for other tests.
9797
For a more detailed treatment of the directory containing the fixtures, read the next section.
9898

9999
Fixtures
100100
--------
101101

102102
Fixtures play a significant role within testing. In RocketPy it is no different. In fact, so many features are needed
103-
to properly test the code that the RocketPy Team decided to organize them a little different then one might find in
103+
to properly test the code that the RocketPy Team decided to organize them a little different then one might find in
104104
small projects. The directory is structured as follows:
105105

106106
::
@@ -123,10 +123,10 @@ small projects. The directory is structured as follows:
123123

124124
Rocketpy Team opted for this kind of structure since it allowed for a more convenient way of organizing
125125
fixtures. Additionally, it serves the purpose of putting the tests in a position where only strictly needed
126-
fixtures are imported.
126+
fixtures are imported.
127127

128-
**Important:** If a new module containing fixtures is to be created, do not forget to look for the
129-
``conftest.py`` file within the tests folder to include your newly created module.
128+
**Important:** If a new module containing fixtures is to be created, do not forget to look for the
129+
``conftest.py`` file within the tests folder to include your newly created module.
130130

131131
To finish, let's take a quick look inside the tests directory structure. Consider the **motor**
132132
folder containing its fixtures:
@@ -150,16 +150,16 @@ Unit tests definition
150150
---------------------
151151

152152
Within a complex code such as RocketPy, some definitions or agreements need to be reviewed or sophisticated
153-
to make sense within a projec. In RocketPy, unit tests are/can be **sociable**, which **still** means that:
153+
to make sense within a project. In RocketPy, unit tests are/can be **sociable**, which **still** means that:
154154

155155
* (Speed) They have to be **fast**.
156156
* (Isolated behavior) They focus on a **small part** of the system. Here we define unit in the method-level.
157157

158158
*However*, as already said, they are/can be sociable:
159159

160160
* (Sociable) The tested unit relies on other units to fulfill its behavior.
161-
162-
The classification depends on whether the test isolates the unit under test from its dependencies or allows them
161+
162+
The classification depends on whether the test isolates the unit under test from its dependencies or allows them
163163
to interact naturally. In practical terms, consider the test:
164164

165165
.. code-block:: python
@@ -175,16 +175,16 @@ to interact naturally. In practical terms, consider the test:
175175
"""
176176
assert isinstance(calisto_motorless.evaluate_total_mass(), Function)
177177
178-
This test is **sociable** because it relies on the actual Rocket instance and tests its real behavior without
179-
isolating the Rocket class from its potential interactions with other classes or methods within its implementation.
180-
It checks the real implementation of ``evaluate_total_mass`` rather than a mocked or stubbed version, ensuring that
178+
This test is **sociable** because it relies on the actual Rocket instance and tests its real behavior without
179+
isolating the Rocket class from its potential interactions with other classes or methods within its implementation.
180+
It checks the real implementation of ``evaluate_total_mass`` rather than a mocked or stubbed version, ensuring that
181181
the functionality being tested is part of the integrated system.
182182

183183
Please note that writing an unit test which is solitary is allowed, however: make sure to back it up with proper contract
184-
tests when applicable.
184+
tests when applicable.
185185

186186
The classification regarding solitary and sociable tests was clarified due to the specific needs developers
187-
naturally encountered within the software, while also hoping that since the developers had the need to further
187+
naturally encountered within the software, while also hoping that since the developers had the need to further
188188
identify them, external contributors would probably fall into the same problem.
189189

190190
Integration tests definition
@@ -235,28 +235,28 @@ The motivation behind lies in the fact that it interacts and calls too many meth
235235
to be considered an unit test.
236236

237237
Please be aware that Integration tests are not solely classfied when interacting with external dependencies,
238-
but also encompass verifying the interaction between classes or too many methods at once, such as ``all_info()``.
238+
but also encompass verifying the interaction between classes or too many methods at once, such as ``all_info()``.
239239

240240
Further clarification: Even if the test contains traits of unit tests and use dependencies which are stable, such as
241-
.csv or .eng files contained within the project or any other external dependencies which are easy to access
242-
and do not make the test slow, **then your test is still an integration test, since those are strongly I/O related.**
241+
.csv or .eng files contained within the project or any other external dependencies which are easy to access
242+
and do not make the test slow, **then your test is still an integration test, since those are strongly I/O related.**
243243

244244
Acceptance tests definition
245245
---------------------------
246246

247247
Acceptance tests configure the final phase of the testing lifecycle within RocketPy. These tests are designed to
248-
account for user-centered scenarios where usually real flights and configurations are setup and launched.
248+
account for user-centered scenarios where usually real flights and configurations are setup and launched.
249249

250-
This phase of testing presents the task of letting the developers know if the system still satisfies well enough the
250+
This phase of testing presents the task of letting the developers know if the system still satisfies well enough the
251251
requirements of normal use of the software, including for instance:
252252

253253
* Error free use of the software within the setup of a real launch.
254254
* Assertions regarding the accuracy of simulations. Thresholds are put and should be checked. RocketPy Paper results are a good reference.
255-
* Usually include prior knowledge of real flight data.
255+
* Usually include prior knowledge of real flight data.
256256

257257
In practical terms, acceptance tests come through the form of a notebook where a certain flight is tested.
258-
It is an important feature and also defining feature of the acceptance tests that thresholds are compared
259-
to real flight data allowing for true comparison.
258+
It is an important feature and also defining feature of the acceptance tests that thresholds are compared
259+
to real flight data allowing for true comparison.
260260

261261
Docstrings
262262
----------

docs/examples/SEB_liquid_motor.ipynb

+1,370-1,425
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)