Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from PVSC-Python-Tutorials/mikofski-colab
Browse files Browse the repository at this point in the history
add colab to pydata
  • Loading branch information
kandersolar authored Feb 24, 2023
2 parents 894f1b2 + 7abc410 commit 21f4d3d
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Tutorial 0 - Overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
10 changes: 10 additions & 0 deletions Tutorial 1 - TMY Weather Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@
"To get a better feel for TMY data, we'll first explore an example TMY dataset that is bundled with pvlib."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
10 changes: 10 additions & 0 deletions Tutorial 2 - POA Irradiance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
"As mentioned earlier, pvlib makes it easy to calculate POA irradiance. First, let's load in the example TMY dataset from the previous tutorial:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
10 changes: 10 additions & 0 deletions Tutorial 3 - Array Power.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
"We'll read in weather data, run the irradiance transposition, and model cell temperature as in previous tutorials:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
10 changes: 10 additions & 0 deletions Tutorial A - Single Diode Model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
18 changes: 14 additions & 4 deletions Tutorial B - pvfree.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@
"\n",
"# Tutorial B - pvfree\n",
"\n",
"Another option to get CEC module parameters is to use [pvfree](https://pvfree.herokuapp.com). \n",
"Another option to get CEC module parameters is to use [pvfree](https://pvfree.azurewebsites.net/). \n",
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"<b>Let's Explore:</b> <a href='https://pvfree.herokuapp.com'> Click here to see the pvfree Website</a></div>\n",
"<b>Let's Explore:</b> <a href='https://pvfree.azurewebsites.net/'> Click here to see the pvfree Website</a></div>\n",
"\n",
"![pvfree_table](images/pvfree_table.png)\n",
"\n",
"You can search the table of the [CEC modules](https://pvfree.herokuapp.com/cec_modules/). Once you find the desired module, you can get a JSON dictionary of the CEC module parameters from the API. For example, [Canadian Solar Inc. CS5P-220M](https://pvfree.herokuapp.com/cec_modules/1733/) can be downloaded from the API here: https://pvfree.herokuapp.com/api/v1/cecmodule/1733/?format=json. You can copy and paste or use python to call the API. The API also has search filters you can use. For example: https://pvfree.herokuapp.com/api/v1/cecmodule/?format=json&Name__istartswith=canadian&STC__gt=219&STC__lt=221 searches for all modules starting with \"canadian\" and with nameplate between 219-W and 221-W which returns a list of 6 modules in a JSON dictionary. Limiting the short circuit currentl (Isc) to less than 6-A reduces this list to 2 modules."
"You can search the table of the [CEC modules](https://pvfree.azurewebsites.net/cec_modules/). Once you find the desired module, you can get a JSON dictionary of the CEC module parameters from the API. For example, [Canadian Solar Inc. CS5P-220M](https://pvfree.azurewebsites.net/cec_modules/1733/) can be downloaded from the API here: https://pvfree.azurewebsites.net/api/v1/cecmodule/1733/?format=json. You can copy and paste or use python to call the API. The API also has search filters you can use. For example: https://pvfree.azurewebsites.net/api/v1/cecmodule/?format=json&Name__istartswith=canadian&STC__gt=219&STC__lt=221 searches for all modules starting with \"canadian\" and with nameplate between 219-W and 221-W which returns a list of 6 modules in a JSON dictionary. Limiting the short circuit currentl (Isc) to less than 6-A reduces this list to 2 modules."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
Expand Down Expand Up @@ -107,7 +117,7 @@
" 'Name__istartswith': 'canadian',\n",
" 'STC__gt': 219, 'STC__lt': 221,\n",
" 'I_sc_ref__lt': 6})\n",
"with urllib.request.urlopen(f'https://pvfree.herokuapp.com/api/v1/cecmodule/?{params}') as fp:\n",
"with urllib.request.urlopen(f'https://pvfree.azurewebsites.net/api/v1/cecmodule/?{params}') as fp:\n",
" cs_220_mods = json.load(fp)\n",
"print(f\"Total count of Canadian Solar 220-W with Isc < 6A: {cs_220_mods['meta']['total_count']}\")\n",
"cs_220_mods['objects']"
Expand Down
10 changes: 10 additions & 0 deletions Tutorial C - Modeling Module's Performance Advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@
"Attribution: [NREL Dobos, Freeman 2019](https://www.nrel.gov/docs/fy19osti/68637.pdf)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a1ada6cc-8ed9-4568-8959-111d81ef4e9d",
"metadata": {},
"outputs": [],
"source": [
"# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n",
"# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/pyData-2021-Solar-PV-Modeling/main/requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ html:

launch_buttons:
thebe: true
colab_url: "https://colab.research.google.com"

0 comments on commit 21f4d3d

Please sign in to comment.