Skip to content

Commit

Permalink
Merge pull request #46 from IMMM-SFA/dev
Browse files Browse the repository at this point in the history
Migrate Jupyter to AWS
  • Loading branch information
crvernon authored Jun 18, 2022
2 parents 9c13142 + fa9835a commit 6a0b0ec
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/02_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ jobs:
- name: Get current datetime in ISO format
id: date
run: echo "::set-output name=date::$(date -u +'%Y-%m-%d')"
- uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
SOURCE_DIR: 'notebooks'
DEST_DIR: 'notebooks'
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Create GitHub release
id: gh_release
uses: softprops/action-gh-release@v1
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
# -- Notebook URLs -----------------------------------------------------------

rst_prolog = """
.. _nb_logistic_regression: https://mybinder.org/v2/gh/IMMM-SFA/msd_uncertainty_ebook/main?labpath=notebooks%2Fbasin_users_logistic_regression.ipynb
.. _nb_saltelli_sobol: https://mybinder.org/v2/gh/IMMM-SFA/msd_uncertainty_ebook/main?labpath=notebooks%2Fsa_saltelli_sobol_ishigami.ipynb
.. _nb_hymod: https://mybinder.org/v2/gh/IMMM-SFA/msd_uncertainty_ebook/main?labpath=notebooks%2Fhymod.ipynb
.. _nb_fishery_dynamics: https://mybinder.org/v2/gh/IMMM-SFA/msd_uncertainty_ebook/main?labpath=notebooks%2Ffishery_dynamics.ipynb
.. _nb_logistic_regression: https://uc-ebook.msdlive.org/user-redirect/lab/tree/examples/basin_users_logistic_regression.ipynb
.. _nb_saltelli_sobol: https://uc-ebook.msdlive.org/user-redirect/lab/tree/examples/sa_saltelli_sobol_ishigami.ipynb
.. _nb_hymod: https://uc-ebook.msdlive.org/user-redirect/lab/tree/examples/hymod.ipynb
.. _nb_fishery_dynamics: https://uc-ebook.msdlive.org/user-redirect/lab/tree/examples/fishery_dynamics.ipynb
"""


Expand Down
16 changes: 13 additions & 3 deletions notebooks/basin_users_logistic_regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
"In this tutorial, we will be loading in data that has been produced in Hadjimichael et al. (2020). Before we start our analysis, we'll load the relevant Python libraries, example data, and information for the three users."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### **NOTE:** If you are running this notebook locally, run the following command to install the required package data:\n",
"\n",
"```python\n",
"msdbook.install_package_data()\n",
"```\n",
"\n",
"##### Otherwise, proceed with the following"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -51,9 +64,6 @@
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# load example data from Hadjimichael et al. (2020)\n",
"msdbook.install_package_data()\n",
"\n",
"# Select the IDs for the three users that we will perform the analysis for\n",
"all_IDs = ['7000550','7200799','3704614'] \n",
"usernames = ['Medium seniority irrigation',\n",
Expand Down
16 changes: 13 additions & 3 deletions notebooks/fishery_dynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@
"In this tutorial, we will be loading in data that has been produced in Hadjimichael et al. (2020). Before we start our analysis, we'll load the relevant Python libraries. __NOTE__: To step through the notebook, execute each gray (code) box by typing \"Shift+Enter\"."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### **NOTE:** If you are running this notebook locally, run the following command to install the required package data:\n",
"\n",
"```python\n",
"msdbook.install_package_data()\n",
"```\n",
"\n",
"##### Otherwise, proceed with the following"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -81,9 +94,6 @@
"from SALib.analyze import sobol\n",
"from matplotlib import patheffects as pe\n",
"\n",
"# load example data\n",
"msdbook.install_package_data()\n",
"\n",
"%matplotlib inline\n",
"%config InlineBackend.print_figure_kwargs = {'bbox_inches':None}\n"
]
Expand Down
16 changes: 13 additions & 3 deletions notebooks/hymod.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@
"In the following section of code, we'll load the necessary python libraries and read in the input file. For this exercise we'll only use the first eleven years of data. The first five rows of the input dataset are printed to show what they look like:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### **NOTE:** If you are running this notebook locally, run the following command to install the required package data:\n",
"\n",
"```python\n",
"msdbook.install_package_data()\n",
"```\n",
"\n",
"##### Otherwise, proceed with the following"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -120,9 +133,6 @@
"from sklearn import metrics\n",
"from matplotlib import pyplot as plt\n",
"\n",
"# load example data\n",
"msdbook.install_package_data()\n",
"\n",
"# load the Leaf River HYMOD input file\n",
"leaf_data = msdbook.load_hymod_input_file()\n",
"\n",
Expand Down

0 comments on commit 6a0b0ec

Please sign in to comment.