From 0d57206ad42de34d8bcab100611a7bdca7d4f6a9 Mon Sep 17 00:00:00 2001 From: Lucas de Oliveira Prates Date: Wed, 31 Jan 2024 12:08:39 -0300 Subject: [PATCH] DOC: Replacing git clone command with curl in notebooks. --- .../deployable_payload_example.ipynb | 30 +++++++------------ .../dispersion_analysis.ipynb | 14 +++++---- .../parachute_drop_from_helicopter.ipynb | 14 +++++---- docs/notebooks/getting_started_colab.ipynb | 30 ++++++------------- 4 files changed, 36 insertions(+), 52 deletions(-) diff --git a/docs/notebooks/deployable_payload_example.ipynb b/docs/notebooks/deployable_payload_example.ipynb index fb96eb06d..38549ea72 100644 --- a/docs/notebooks/deployable_payload_example.ipynb +++ b/docs/notebooks/deployable_payload_example.ipynb @@ -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:" ] @@ -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" ] }, { @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb b/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb index a7794f7d5..418589a28 100644 --- a/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb +++ b/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb @@ -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." ] }, { @@ -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" ] }, { diff --git a/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb b/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb index e9709ff14..fd9e34663 100644 --- a/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb +++ b/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb @@ -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." ] }, { @@ -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" ] }, { diff --git a/docs/notebooks/getting_started_colab.ipynb b/docs/notebooks/getting_started_colab.ipynb index 4ba05dd70..54f267ad7 100644 --- a/docs/notebooks/getting_started_colab.ipynb +++ b/docs/notebooks/getting_started_colab.ipynb @@ -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:" ] @@ -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" ] }, { @@ -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", @@ -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", @@ -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",