Skip to content

Commit e868eb8

Browse files
DOC: more upgrades to development docs
1 parent 052ee67 commit e868eb8

File tree

11 files changed

+232
-69
lines changed

11 files changed

+232
-69
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"sphinx.ext.napoleon",
4141
"sphinx.ext.viewcode",
4242
"sphinx.ext.mathjax",
43+
"sphinx_tabs.tabs",
4344
"sphinx_copybutton",
4445
"sphinx_design",
4546
"jupyter_sphinx",

docs/development/conflicts.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Solving git conflicts
2+
=====================
3+
4+
...

docs/development/docker.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ RocketPy with docker
22
=====================
33

44
RocketPy does not provide an official docker image, but you can build one
5-
yourself using the provided `Dockerfile` and `docker-compose.yml` files.
5+
yourself using the provided ``Dockerfile`` and ``docker-compose.yml`` files.
66

77
Benefits
88
--------
@@ -20,15 +20,15 @@ using docker are:
2020
Using docker will be specially important when you are not sure if the code
2121
additions will still run on different operational systems.
2222

23-
Although we have a set of GitHub actions to test the code on different
23+
Although we have a set of GitHub actions to test the code on different
2424
operational systems every time a pull request is made, it is important to
2525
submit a PR only after you are sure that the code will run flawlessly,
2626
otherwise quota limits may be reached on GitHub.
2727

2828
Requirements
2929
-------------
3030

31-
Before you start, you need to install on your machine:
31+
Before you start, you need to install on your machine:
3232

3333
1. `Docker <https://docs.docker.com/get-docker/>`__, to build and run the image.
3434
2. `Docker Compose <https://docs.docker.com/compose/install/>`__, to compose multiple images at once.
@@ -40,11 +40,11 @@ Build the image
4040
To build the image, run the following command on your terminal:
4141

4242
.. code-block:: console
43-
43+
4444
docker build -t rocketpy-image -f Dockerfile .
4545
4646
47-
This will build the image and tag it as `rocketpy-image` (you can apply another
47+
This will build the image and tag it as ``rocketpy-image`` (you can apply another
4848
name of your preference if you want).
4949

5050
An image is a read-only template with instructions for creating a Docker
@@ -82,45 +82,45 @@ Run the unit tests
8282
--------------------
8383

8484
You might have noticed that the container is running in an isolated environment
85-
with no access to your machine's files, but the `Dockerfile` already copied the
85+
with no access to your machine's files, but the ``Dockerfile`` already copied the
8686
RocketPy repository to the container.
8787
This means that you can run tests (and simulations!) as if you were running
8888
RocketPy on your machine.
8989

9090
As simple as that, you can run the unit tests:
9191

9292
.. code-block:: console
93-
93+
9494
pytest
9595
9696
9797
To access a list of all available execution options, see the
9898
`pytest docs <https://docs.pytest.org/en/latest/how-to/usage.html>`__.
9999

100-
Compose docker images
100+
Compose docker images
101101
---------------------
102102

103-
We also made available a `docker-compose.yml` file that allows you to compose
103+
We also made available a ``docker-compose.yml`` file that allows you to compose
104104
multiple docker images at once.
105-
Unfortunately, this file will not allow you to test the code on different
105+
Unfortunately, this file will not allow you to test the code on different
106106
operational systems at once, since docker images inherits from the host
107107
operational system.
108108
However, it is still useful to run the unit tests on different python versions.
109109

110-
Currently, the `docker-compose.yml` file is configured to run the unit tests
110+
Currently, the ``docker-compose.yml`` file is configured to run the unit tests
111111
on python 3.9 and 3.12.
112112

113113
To run the unit tests on both python versions, run the following command
114114
**on your machine**:
115115

116116
.. code-block:: console
117-
117+
118118
docker-compose up
119119
120120
Also, you can check the logs of the containers by running:
121121

122122
.. code-block:: console
123-
123+
124124
docker-compose logs
125125
126126
@@ -131,7 +131,7 @@ After you're done testing, or if you wish to stop the containers and remove the
131131
services, use the command:
132132

133133
.. code-block:: console
134-
134+
135135
docker-compose down
136136
137137
@@ -142,31 +142,31 @@ images created by up.
142142
Changing to other operational systems
143143
-------------------------------------
144144

145-
The default image in the `Dockerfile` is based on a Linux distribution.
145+
The default image in the ``Dockerfile`` is based on a Linux distribution.
146146
However, you can alter the base image to use different operating systems, though
147147
the process may require additional steps depending on the OS's compatibility
148148
with your project setup.
149149
For instance, certain dependencies or scripts may behave differently or require
150150
different installation procedures, so use it with caution.
151151

152-
To change the base image, you will need to modify the `FROM` statement in the
153-
`Dockerfile`.
152+
To change the base image, you will need to modify the ``FROM`` statement in the
153+
``Dockerfile``.
154154
For example, to use a Windows-based image, you might change:
155155

156156
.. code-block:: Dockerfile
157-
157+
158158
FROM python:latest
159159
160160
161161
to
162162

163163
.. code-block:: Dockerfile
164-
164+
165165
FROM mcr.microsoft.com/windows/servercore:ltsc2019
166166
167167
168168
Please note, the above is just an example, and using a different OS may require
169-
further adjustments in the `Dockerfile`.
169+
further adjustments in the ``Dockerfile``.
170170
We recommend you to see the official Python images on the Docker Hub for
171171
different OS options: `Docker Hub Python Tags <https://hub.docker.com/_/python/tags>`__.
172172

docs/development/first_pr.rst

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Picking an issue
88
----------------
99

1010
Before you start coding, you should pick an issue to work on. You can find a
11-
list of issues in the `Issues`_ tab on GitHub.
12-
.. _Issues: https://github.com/RocketPy-Team/RocketPy/issues
11+
list of issues in the `Issues` tab on GitHub (https://github.com/RocketPy-Team/RocketPy/issues).
1312
If you are new hear, it is really recommended that you talk to maintainers
1413
before starting to work on an issue.
1514
That way you avoid working on something that is already being worked on or
@@ -20,12 +19,29 @@ a new issue to discuss it with the maintainers before submitting a PR.
2019

2120
Once the issue is assigned to you, you can start working on it.
2221

22+
.. note::
2323

24+
In order to open an issue at our repo, you must have a GitHub account. \
25+
In case you do not want to open an account yet, you can contact the maintainers \
26+
through our Discord server. But keep in mind that you you need an account to \
27+
open a Pull Request (PR).
2428

2529
Creating a new branch
2630
---------------------
2731

28-
At your local machine, ...
32+
At your local machine,
33+
34+
.. code-block:: console
35+
36+
git checkout -b <branch_name>
37+
38+
39+
.. tip::
40+
41+
VS Code has a built-in integration with git, this allows you to run git commands \
42+
quite easily through the editor's interface. For example, you could search for \
43+
"git checkout" in the command palette and run the command from there.
44+
2945

3046
Opening the PR
3147
--------------
@@ -55,16 +71,51 @@ Please correct any issues that may arise from the CI checks.
5571

5672
.. note::
5773

58-
All the commands we run in the CI pipeline can also be run locally. It is important \
59-
that you run the checks locally before pushing your changes to the repository.
74+
All the commands we run in the CI pipeline can also be run locally. It is \
75+
important that you run the checks locally before pushing your changes to \
76+
the repository.
6077

6178
The CHANGELOG file
6279
------------------
6380

64-
We keep track of the changes in the `CHANGELOG.md` file. When you open a PR, you should add a new entry to the `Unreleased` section of the file. This entry should simply be the title of your PR.
81+
We keep track of the changes in the ``CHANGELOG.md`` file.
82+
When you open a PR, you should add a new entry to the "Unreleased" section of the file. This entry should simply be the title of your PR.
6583

6684
.. note::
6785

6886
In the future we would like to automate the CHANGELOG update, but for now \
6987
it is a manual process, unfortunately.
7088

89+
90+
The review process
91+
------------------
92+
93+
After you open a PR, the maintainers will review your code.
94+
This review process is a way to ensure that the code is in line with the project's goals and that it is well written and documented.
95+
96+
The maintainers may ask you to make changes to your code.
97+
You should address these changes or explain why you think they are not necessary.
98+
99+
This is the best time to learn from the maintainers and improve your coding skills.
100+
101+
In case you do not address the comments in a timely manner, the maintainers may
102+
either close the PR or make the changes themselves.
103+
104+
105+
Merging the PR
106+
--------------
107+
108+
There are 3 different ways of merging a PR:
109+
110+
1. **Create a merge commit**: this is the default option on GitHub.
111+
2. **Squash and merge**: this option will squash all your commits into a single one. This is useful when you have many commits and you want to keep the history clean, therefore this is the recommended option.
112+
3. **Rebase and merge**: this option will add your commits directly to the target branch, without creating a merge commit. This is useful to keep the history linear. However, this
113+
114+
.. note::
115+
116+
Overall, you will not have permission to merge your PR. The maintainers will \
117+
take care of that for you. This is here just for you to understand the process.
118+
119+
All in all, there is no right or wrong way to merge a PR.
120+
The maintainers will decide which option is the best for the project.
121+
What you should care tough is about conflicting changes, let's talk about that next.

docs/development/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ There are a few guidelines we would like to share with you to make the as
77
smooth as possible:
88

99
.. toctree::
10-
:maxdepth: 2
10+
:maxdepth: 1
1111
:caption: Contents:
1212

13-
Setting Up the repository <setting_up.rst>
13+
setting_up.rst
1414
Running RocketPy as a Developer <rocketpy_as_developer.rst>
1515
Your First Pull Request (PR) <first_pr.rst>
16+
Solving git conflicts <conflicts.rst>
1617
Style Guide <style_guide>
1718
Testing Guidelines <testing.rst>
1819
RocketPy with Docker <docker.rst>

docs/development/pro_tips.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ productive when developing in the project (or any other project).
88
Makefile
99
--------
1010

11-
We have a `Makefile` in the repository that contains some useful commands to
11+
We have a ``Makefile`` in the repository that contains some useful commands to
1212
help you with the development process.
1313

1414
Some examples of commands are:
1515

1616
* ``make black``: runs the black formatter on the code.
1717
* ``make format``: runs the isort and black formatters on the code.
18-
* ``lint``: runs the flake8 and pylint tools.
19-
* ``build-docs``: This will build the documentation locally, so you can check if everything is working as expected.
20-
* ``pytest-slow``: runs only the slow tests (marked with the `@pytest.mark.slow` decorator).
18+
* ``make lint``: runs the flake8 and pylint tools.
19+
* ``make build-docs``: This will build the documentation locally, so you can check if everything is working as expected.
20+
* ``make pytest-slow``: runs only the slow tests (marked with the ``@pytest.mark.slow`` decorator).
2121

2222
These commands are meant to be system agnostic, so you can run them on any
2323
Operational System (OS).
@@ -35,12 +35,15 @@ the same editor.
3535

3636
Some of the features that can help you are:
3737

38-
...
38+
1. **Code navigation**: Jump to definitions, find references, etc.
39+
2. **Integrated tests**: Run tests directly from the editor.
40+
3. **Python Debugger**: Debug your code directly from the editor.
41+
4. **GitHub Pull Requests**: Open, review, comment, and merge pull requests directly from the editor
3942

4043
Extensions
4144
----------
4245

43-
We have listed some recommended extensions in the `.vscode/extensions.json` file.
46+
We have listed some recommended extensions in the ``.vscode/extensions.json`` file.
4447
These are general recommendations based on what our developers usually install
4548
in their VSCode.
4649
Obviously, it is not mandatory to install them, but they can help you to be more
@@ -81,8 +84,16 @@ Engaging with the community
8184

8285
The most important part of contributing to an open-source project is engaging
8386
with the community.
84-
Our developers are frequently available on the `Discord`_ server, and you can
87+
Our developers are frequently available on our server, and you can
8588
ask any questions you may have there.
8689
Either a question about the project, or a question about how to contribute, or
8790
even a suggestion of a new feature.
8891
Any kind of interaction is welcome.
92+
93+
94+
.. tip::
95+
96+
The official supported language in our server is English. \
97+
However, the RocketPy Team is lucky to have developers from all around the \
98+
world, so you may find people speaking other languages as well. \
99+
Don't let the language barrier keep you from engaging with the community.

docs/development/rocketpy_as_developer.rst

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
Introduction to RocketPy
33
========================
44

5-
This tutorial part shows how to open rocketpy files and run a simple simulation.
5+
This tutorial section shows how to open rocketpy files and run a simple simulation
6+
in a local environment.
7+
It is intended for developers who want to contribute to the project or for users
8+
who want to run simulations with the library.
9+
610

711
Opening rocketpy folder
812
=======================
@@ -51,11 +55,29 @@ To create the folder, type on the terminal:
5155
5256
And, to add it on .gitignore, type:
5357

54-
.. code-block:: console
58+
.. tabs::
59+
60+
.. tab:: Windows
61+
62+
.. code-block:: console
63+
64+
echo <folder name>/ >> .gitignore
65+
66+
.. tab:: Linux
67+
68+
.. code-block:: console
69+
70+
echo "<folder name>/" >> .gitignore
71+
72+
.. tab:: MacOS
73+
74+
.. code-block:: console
75+
76+
echo "<folder name>/" >> .gitignore
5577
56-
echo <folder name>/ >> .gitignore
5778
58-
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.
79+
It is important to remember that all the files inside this folder will not be
80+
included in any commit so, if it is important to the solution, do not add them inside it.
5981

6082
Running a simulation with RocketPy
6183
==================================
@@ -78,13 +100,13 @@ Alternatively you can use the following command to pip install the local library
78100
sys.path.append('../') # if you are using a notebook
79101
sys.path.append('../rocketpy') # if you are using a script
80102
81-
Import the classes that will be used, in case:
103+
Import the classes that will be used, in this case:
82104

83105
.. code-block:: python
84106
85107
from rocketpy import Environment, SolidMotor, Rocket, Flight, Function
86108
87-
If it is the first time you are using rocketpy and you do not have all required libraries installed, you could use the command:
109+
If this is the first time you are using rocketpy and you do not have all required libraries installed, you could use the command:
88110

89111
.. code-block:: python
90112
@@ -281,4 +303,3 @@ For example, to access Flight class parameters, you can use:
281303
help(Flight)
282304
283305
More documentation materials can be found at `read the docs <https://docs.rocketpy.org/en/latest/?badge=latest>`_.
284-
It can also be found on RocketPy's GitHub page on the badge "docs".

0 commit comments

Comments
 (0)