Skip to content

Commit

Permalink
Refactored asyncio functions to allow synchronous calls in Jupyter No…
Browse files Browse the repository at this point in the history
…tebooks.
  • Loading branch information
MeenaBana committed Aug 12, 2024
1 parent 579cad3 commit 788beb1
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 295 deletions.
12 changes: 6 additions & 6 deletions notebooks/Exploring_API_Functions_Authentication.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@
"outputs": [],
"source": [
"# 1 day raw historical data\n",
"one_day_raw_historical_data = await opc_data.get_raw_historical_values_async(\n",
" start_time = datetime.datetime(2023, 11, 13, 00, 00),\n",
" end_time = datetime.datetime(2023, 11, 13, 23, 59),\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_raw_historical_data"
Expand All @@ -285,9 +285,9 @@
"outputs": [],
"source": [
"# 1 day aggregated historical data\n",
"one_day_historical_data = await opc_data.get_historical_aggregated_values_async(\n",
" start_time = datetime.datetime(2023, 11, 13, 00, 00),\n",
" end_time = datetime.datetime(2023, 11, 13, 23, 59),\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",
Expand Down
3 changes: 1 addition & 2 deletions notebooks/api_performance_testing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@
" \"ReadValueIds\": variables,\n",
" \"AggregateName\": agg_name\n",
" }\n",
" print(body)\n",
"\n",
" for attempt in range(max_retries):\n",
" try:\n",
Expand Down Expand Up @@ -558,7 +557,7 @@
" agg_name=agg_name,\n",
" variable_list=variable_list,\n",
" max_data_points=10000,\n",
" max_concurrent_requests=40\n",
" max_concurrent_requests=35\n",
")\n",
"one_day_historical_data"
]
Expand Down
Loading

0 comments on commit 788beb1

Please sign in to comment.