Skip to content

Commit

Permalink
Simple Standoff Calculation Done
Browse files Browse the repository at this point in the history
  • Loading branch information
tobin-ford committed Feb 29, 2024
1 parent 5ce53b4 commit 347cf81
Showing 1 changed file with 85 additions and 9 deletions.
94 changes: 85 additions & 9 deletions pvdeg_tutorials/tutorials/Scenario.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"results_dict dtype : <class 'pandas.core.frame.DataFrame'>\n",
"{'standoff': x T98_0 T98_inf T98\n",
"0 1.072183 73.564889 50.121688 70.0}\n"
]
}
],
"source": [
"simple_scenario = pvdeg.Scenario(\n",
" name='standoff calculation'\n",
Expand All @@ -71,7 +81,9 @@
" func=pvdeg.standards.standoff,\n",
" func_params=params,\n",
" see_added_function = False # allows us to see the details of the updated pipeline element\n",
" )"
" )\n",
"\n",
"simple_scenario.runPipeline()"
]
},
{
Expand All @@ -84,7 +96,7 @@
"output_type": "stream",
"text": [
"Name : standoff calculation\n",
"pipeline: [{'job': <function standoff at 0x0000019454E28940>, 'params': {'weather_df': Year Month Day Hour Minute Dew Point dhi \\\n",
"pipeline: [{'job': <function standoff at 0x00000241638B8940>, 'params': {'weather_df': Year Month Day Hour Minute Dew Point dhi \\\n",
"2005-01-01 00:30:00-05:00 2005 1 1 0 30 17.0 0.0 \n",
"2005-01-01 01:30:00-05:00 2005 1 1 1 30 17.0 0.0 \n",
"2005-01-01 02:30:00-05:00 2005 1 1 2 30 17.0 0.0 \n",
Expand Down Expand Up @@ -124,6 +136,9 @@
"1999-12-31 23:30:00-05:00 94.0 6.4 73.288965 \n",
"\n",
"[8760 rows x 15 columns], 'meta': {'Source': 'NSRDB', 'Location ID': '1060699', 'City': '-', 'State': '-', 'Country': '-', 'Time Zone': -5, 'Dew Point Units': 'c', 'DHI Units': 'w/m2', 'DNI Units': 'w/m2', 'GHI Units': 'w/m2', 'Temperature Units': 'c', 'Pressure Units': 'mbar', 'Wind Direction Units': 'Degrees', 'Wind Speed Units': 'm/s', 'Surface Albedo Units': 'N/A', 'Version': '3.2.0', 'latitude': 25.77, 'longitude': -80.18, 'altitude': 0, 'timezone': -5, 'wind_height': 2}}}]\n",
"pipeline results : standoff x T98_0 T98_inf T98\n",
"0 1.0...\n",
"dtype: object\n",
"gid file : None\n",
"test modules :\n"
]
Expand All @@ -133,6 +148,14 @@
"simple_scenario.viewScenario()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Results Series ##\n",
"We will use a series to store the various return values of functions run in our pipeline. These can partially obfuscate the dataframes within them so to access the dataframes, use the function name to access it"
]
},
{
"cell_type": "code",
"execution_count": 5,
Expand All @@ -142,17 +165,70 @@
"name": "stdout",
"output_type": "stream",
"text": [
" x T98_0 T98_inf T98\n",
"0 1.072183 73.564889 50.121688 70.0\n",
"<class 'pandas.core.frame.DataFrame'>\n"
"standoff x T98_0 T98_inf T98\n",
"0 1.0...\n",
"dtype: object\n",
"We can't see out data in here so we need to do another step\n",
"\n",
"this is the list of all available frames in results : Index(['standoff'], dtype='object')\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>x</th>\n",
" <th>T98_0</th>\n",
" <th>T98_inf</th>\n",
" <th>T98</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1.072183</td>\n",
" <td>73.564889</td>\n",
" <td>50.121688</td>\n",
" <td>70.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" x T98_0 T98_inf T98\n",
"0 1.072183 73.564889 50.121688 70.0"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"output_dict = simple_scenario.runPipeline()\n",
"print(simple_scenario.results)\n",
"print(\"We can't see out data in here so we need to do another step\", end=\"\\n\\n\")\n",
"\n",
"# to see all available ouputs of results do\n",
"print(f\"this is the list of all available frames in results : {simple_scenario.results.index}\")\n",
"\n",
"print(output_dict['standoff'])\n",
"print(type(output_dict['standoff']))"
"display(simple_scenario.results['standoff'])"
]
}
],
Expand Down

0 comments on commit 347cf81

Please sign in to comment.