Skip to content

Commit

Permalink
DOC: Replacing git clone command with curl in notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Prates committed Jan 31, 2024
1 parent 2fee77e commit 0d57206
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 52 deletions.
30 changes: 11 additions & 19 deletions docs/notebooks/deployable_payload_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"\n",
"* RocketPy\n",
"* netCDF4 (to get weather forecasts)\n",
"* Data files (we will clone RocketPy's repository for these)\n",
"* Data files (we will download RocketPy's data from github)\n",
"\n",
"Therefore, let's run the following lines of code:"
]
Expand All @@ -45,18 +45,10 @@
"outputs": [],
"source": [
"!pip install rocketpy netCDF4\n",
"!git clone https://github.com/RocketPy-Team/RocketPy.git"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"os.chdir(\"RocketPy/docs/notebooks\")"
"!curl -o NACA0012-radians.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/NACA0012-radians.csv\n",
"!curl -o Cesaroni_M1670.eng https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/motors/Cesaroni_M1670.eng\n",
"!curl -o powerOffDragCurve.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/powerOffDragCurve.csv\n",
"!curl -o powerOnDragCurve.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/powerOnDragCurve.csv"
]
},
{
Expand Down Expand Up @@ -237,7 +229,7 @@
"outputs": [],
"source": [
"Pro75M1670 = SolidMotor(\n",
" thrust_source=\"../../data/motors/Cesaroni_M1670.eng\",\n",
" thrust_source=\"Cesaroni_M1670.eng\",\n",
" dry_mass=1.815,\n",
" dry_inertia=(0.125, 0.125, 0.002),\n",
" nozzle_radius=33 / 1000,\n",
Expand Down Expand Up @@ -392,8 +384,8 @@
" radius=127 / 2000,\n",
" mass=rocket_mass + rocket_mass,\n",
" inertia=(6.321, 6.321, 0.034),\n",
" power_off_drag=\"../../data/calisto/powerOffDragCurve.csv\",\n",
" power_on_drag=\"../../data/calisto/powerOnDragCurve.csv\",\n",
" power_off_drag=\"powerOffDragCurve.csv\",\n",
" power_on_drag=\"powerOnDragCurve.csv\",\n",
" center_of_mass_without_motor=0,\n",
" coordinate_system_orientation=\"tail_to_nose\",\n",
")\n",
Expand All @@ -417,7 +409,7 @@
" span=0.110,\n",
" position=-1.04956,\n",
" cant_angle=0.5,\n",
" airfoil=(\"../../data/calisto/NACA0012-radians.csv\",\"radians\"),\n",
" airfoil=(\"NACA0012-radians.csv\",\"radians\"),\n",
")\n",
"\n",
"rocket_with_payload.add_tail(\n",
Expand Down Expand Up @@ -536,8 +528,8 @@
" radius=127 / 2000,\n",
" mass=rocket_mass,\n",
" inertia=(6.321, 6.321, 0.034),\n",
" power_off_drag=\"../../data/calisto/powerOffDragCurve.csv\",\n",
" power_on_drag=\"../../data/calisto/powerOnDragCurve.csv\",\n",
" power_off_drag=\"powerOffDragCurve.csv\",\n",
" power_on_drag=\"powerOnDragCurve.csv\",\n",
" center_of_mass_without_motor=0,\n",
" coordinate_system_orientation=\"tail_to_nose\",\n",
")\n",
Expand Down
14 changes: 8 additions & 6 deletions docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Clone repository if using Google Colab\n",
"## Download data files if using Google Colab\n",
"\n",
"If you are running this using Binder, or you are running locally with the necessary files, you do not need to run this.\n",
"On the other hand, if you are running on Google Colab, make sure to run the cell below to clone the repository and download the necessary files."
"On the other hand, if you are running on Google Colab, make sure to run the cell below to download the necessary files."
]
},
{
Expand All @@ -37,10 +37,12 @@
"metadata": {},
"outputs": [],
"source": [
"!git clone https://github.com/RocketPy-Team/RocketPy.git\n",
"import os\n",
"\n",
"os.chdir(\"RocketPy/docs/notebooks/dispersion_analysis\")"
"!curl -o dispersion_analysis_inputs/Cd_PowerOff.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Cd_PowerOff.csv\n",
"!curl -o dispersion_analysis_inputs/Cd_PowerOn.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Cd_PowerOn.csv\n",
"!curl -o dispersion_analysis_inputs/LASC2019_reanalysis.nc --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/LASC2019_reanalysis.nc\n",
"!curl -o dispersion_analysis_inputs/thrustCurve.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/thrustCurve.csv\n",
"!curl -o dispersion_analysis_inputs/Valetudo_basemap_final.jpg --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Valetudo_basemap_final.jpg\n",
"!mkdir -p dispersion_analysis_outputs"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Clone repository if using Google Colab\n",
"## Clone data files if using Google Colab\n",
"\n",
"If you are running this using Binder, or you are running locally with the necessary files, you do not need to run this.\n",
"On the other hand, if you are running on Google Colab, make sure to run the cell below to clone the repository and download the necessary files."
"On the other hand, if you are running on Google Colab, make sure to run the cell below to download the necessary files."
]
},
{
Expand All @@ -31,10 +31,12 @@
"metadata": {},
"outputs": [],
"source": [
"!git clone https://github.com/giovaniceotto/RocketPy.git\n",
"import os\n",
"\n",
"os.chdir(\"RocketPy/docs/notebooks/dispersion_analysis\")"
"!curl -o dispersion_analysis_inputs/Cd_PowerOff.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Cd_PowerOff.csv\n",
"!curl -o dispersion_analysis_inputs/Cd_PowerOn.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Cd_PowerOn.csv\n",
"!curl -o dispersion_analysis_inputs/LASC2019_reanalysis.nc --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/LASC2019_reanalysis.nc\n",
"!curl -o dispersion_analysis_inputs/thrustCurve.csv --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/thrustCurve.csv\n",
"!curl -o dispersion_analysis_inputs/Valetudo_basemap_final.jpg --create-dirs https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/docs/notebooks/dispersion_analysis/dispersion_analysis_inputs/Valetudo_basemap_final.jpg\n",
"!mkdir -p dispersion_analysis_outputs"
]
},
{
Expand Down
30 changes: 9 additions & 21 deletions docs/notebooks/getting_started_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"We start by setting up our environment. To run this notebook, we will need:\n",
"\n",
"- RocketPy\n",
"- Data files (we will clone RocketPy's repository for these)\n",
"- Data files (we will download RocketPy's data from github)\n",
"\n",
"Therefore, let's run the following lines of code:"
]
Expand All @@ -38,22 +38,10 @@
"outputs": [],
"source": [
"!pip install rocketpy\n",
"!git clone https://github.com/giovaniceotto/RocketPy.git"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "pY5XGge5OoGJ"
},
"outputs": [],
"source": [
"import os\n",
"\n",
"os.chdir(\"RocketPy/docs/notebooks\")"
"!curl -o NACA0012-radians.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/NACA0012-radians.csv\n",
"!curl -o Cesaroni_M1670.eng https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/motors/Cesaroni_M1670.eng\n",
"!curl -o powerOffDragCurve.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/powerOffDragCurve.csv\n",
"!curl -o powerOnDragCurve.csv https://raw.githubusercontent.com/RocketPy-Team/RocketPy/master/data/calisto/powerOnDragCurve.csv"
]
},
{
Expand Down Expand Up @@ -2485,7 +2473,7 @@
"outputs": [],
"source": [
"Pro75M1670 = SolidMotor(\n",
" thrust_source=\"../../data/motors/Cesaroni_M1670.eng\",\n",
" thrust_source=\"Cesaroni_M1670.eng\",\n",
" dry_mass=1.815,\n",
" dry_inertia=(0.125, 0.125, 0.002),\n",
" nozzle_radius=33 / 1000,\n",
Expand Down Expand Up @@ -3499,8 +3487,8 @@
" radius=127 / 2000,\n",
" mass=14.426,\n",
" inertia=(6.321, 6.321, 0.034),\n",
" power_off_drag=\"../../data/calisto/powerOffDragCurve.csv\",\n",
" power_on_drag=\"../../data/calisto/powerOnDragCurve.csv\",\n",
" power_off_drag=\"powerOffDragCurve.csv\",\n",
" power_on_drag=\"powerOnDragCurve.csv\",\n",
" center_of_mass_without_motor=0,\n",
" coordinate_system_orientation=\"tail_to_nose\",\n",
")\n",
Expand Down Expand Up @@ -3579,7 +3567,7 @@
" span=0.110,\n",
" position=-1.04956,\n",
" cant_angle=0.5,\n",
" airfoil=(\"../../data/calisto/NACA0012-radians.csv\",\"radians\"),\n",
" airfoil=(\"NACA0012-radians.csv\",\"radians\"),\n",
")\n",
"\n",
"tail = calisto.add_tail(\n",
Expand Down

0 comments on commit 0d57206

Please sign in to comment.