Skip to content

Commit

Permalink
Merge pull request #65 from PrediktorAS/feature/exceptional-site-data…
Browse files Browse the repository at this point in the history
…-testing

Feature/exceptional site data testing
  • Loading branch information
MeenaBana authored Aug 15, 2024
2 parents bb3d2cf + cddeda4 commit b793bfc
Show file tree
Hide file tree
Showing 13 changed files with 2,572 additions and 357 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
- uses: actions/checkout@master
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and Commit
uses: sphinx-notes/pages@v2
- name: Push changes
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
python -VV
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions pytest
python -m pip install -r requirements.txt
python -m pip install -e .
echo "*** pyodbc version"
python -c "import pyodbc; print(pyodbc.version)"
Expand Down
10 changes: 0 additions & 10 deletions notebooks/Example_Data_Downloading.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,6 @@
"model.get_objects_of_type(\"InverterType\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sites_json = model.get_objects_of_type(\"SiteType\")\n",
"sites_json"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
43 changes: 22 additions & 21 deletions notebooks/Exploring_API_Functions_Authentication.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"import datetime\n",
"import os\n",
"from dotenv import load_dotenv \n",
"from pathlib import Path"
"from pathlib import Path\n",
"import nest_asyncio\n",
"\n",
"nest_asyncio.apply()"
]
},
{
Expand Down Expand Up @@ -256,15 +259,11 @@
"metadata": {},
"outputs": [],
"source": [
"# History data\n",
"inverters_hist_df = opc_data.get_historical_aggregated_values(\n",
" start_time=datetime.datetime.now() - datetime.timedelta(2),\n",
" end_time=datetime.datetime.now() - datetime.timedelta(1),\n",
" pro_interval=600000,\n",
" agg_name=\"Average\",\n",
" variable_list=inverters.variables_as_list([\"DCPower\"]),\n",
"# Live value data of trackers\n",
"live_value = opc_data.get_values(\n",
" trackers.variables_as_list([\"AngleMeasured\"])\n",
")\n",
"inverters_hist_df"
"live_value"
]
},
{
Expand All @@ -273,11 +272,15 @@
"metadata": {},
"outputs": [],
"source": [
"# Live value data of trackers\n",
"live_value = opc_data.get_values(\n",
" trackers.variables_as_list([\"AngleMeasured\"])\n",
"# 1 day aggregated historical data\n",
"one_day_historical_data = opc_data.get_historical_aggregated_values(\n",
" start_time=(datetime.datetime.now() - datetime.timedelta(30)),\n",
" end_time=(datetime.datetime.now() - datetime.timedelta(29)),\n",
" pro_interval=60*1000,\n",
" agg_name=\"Average\",\n",
" variable_list=string_sets_for_first_park.variables_as_list([\"DCPower\"])\n",
")\n",
"live_value"
"one_day_historical_data"
]
},
{
Expand All @@ -286,15 +289,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Historic value data of trackers, 1 days worth of data 30 days ago\n",
"one_day_historic_tracker_data = opc_data.get_historical_aggregated_values(\n",
" start_time=(datetime.datetime.now() - datetime.timedelta(30)),\n",
" end_time=(datetime.datetime.now() - datetime.timedelta(29)),\n",
" pro_interval=3600000,\n",
" agg_name=\"Average\",\n",
" variable_list=trackers.variables_as_list([\"AngleMeasured\"]),\n",
"# 1 day raw historical data\n",
"one_day_raw_historical_data = opc_data.get_raw_historical_values(\n",
" start_time = datetime.datetime(2024, 7, 13, 00, 00),\n",
" end_time = datetime.datetime(2024, 7, 13, 23, 59),\n",
" variable_list=string_sets_for_first_park.variables_as_list([\"DCPower\"])\n",
")\n",
"one_day_historic_tracker_data"
"one_day_raw_historical_data"
]
},
{
Expand Down
Loading

0 comments on commit b793bfc

Please sign in to comment.