Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed function and updated relevant usages. #66

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions notebooks/Example_Data_Downloading.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,24 +218,6 @@
"one_day_historic_inverter_data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 1 day aggregated historical inverter data in asyncio process\n",
"one_days_historic_inverter_data2 = await tsdata.get_historical_aggregated_values_async(\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=inverters.variables_as_list(inv_var_list),\n",
" batch_size=500\n",
")\n",
"one_days_historic_inverter_data2"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
10 changes: 5 additions & 5 deletions notebooks/Exploring_API_Functions_Authentication.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"outputs": [],
"source": [
"# Selecting the single site\n",
"site_id = sites.list_of_ids()\n",
"site_id = sites.list_of_ids()[0]\n",
"site_id"
]
},
Expand All @@ -200,7 +200,7 @@
"source": [
"# Get all stringsets for one park\n",
"string_sets_for_first_park_as_json = model_data.get_object_descendants(\n",
" \"StringSetType\", site_id, \"PV_Assets\"\n",
" \"StringSetType\", [site_id], \"PV_Assets\"\n",
")\n",
"string_sets_for_first_park = AnalyticsHelper(string_sets_for_first_park_as_json)\n",
"string_sets_for_first_park.dataframe"
Expand All @@ -214,7 +214,7 @@
"source": [
"# All inverter data for the site\n",
"inverter_json = model_data.get_object_descendants(\n",
" \"InverterType\", site_id, \"PV_Assets\"\n",
" \"InverterType\", [site_id], \"PV_Assets\"\n",
")\n",
"inverters = AnalyticsHelper(inverter_json)"
]
Expand Down Expand Up @@ -261,7 +261,7 @@
"source": [
"# Live value data of trackers\n",
"live_value = opc_data.get_values(\n",
" trackers.variables_as_list([\"AngleMeasured\"])\n",
" inverters.variables_as_list([\"DCPower\"])\n",
")\n",
"live_value"
]
Expand Down Expand Up @@ -290,7 +290,7 @@
"outputs": [],
"source": [
"# 1 day raw historical data\n",
"one_day_raw_historical_data = opc_data.get_raw_historical_values(\n",
"one_day_raw_historical_data = opc_data.get_historical_raw_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",
Expand Down
6 changes: 3 additions & 3 deletions src/pyprediktormapclient/opc_ua.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ async def process_batch(variables, time_batch):
return combined_df


async def get_raw_historical_values_asyn(
async def get_historical_raw_values_asyn(
self,
start_time: datetime,
end_time: datetime,
Expand Down Expand Up @@ -487,8 +487,8 @@ async def get_raw_historical_values_asyn(
}
return self._process_df(combined_df, columns)

def get_raw_historical_values(self, *args, **kwargs):
result = self.helper.run_coroutine(self.get_raw_historical_values_asyn(*args, **kwargs))
def get_historical_raw_values(self, *args, **kwargs):
result = self.helper.run_coroutine(self.get_historical_raw_values_asyn(*args, **kwargs))
return result


Expand Down
2 changes: 1 addition & 1 deletion tests/test_opc_ua.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ async def make_historical_request():

async def make_raw_historical_request():
tsdata = OPC_UA(rest_url=URL, opcua_url=OPC_URL)
return await tsdata.get_raw_historical_values_asyn(
return await tsdata.get_historical_raw_values_asyn(
start_time=(datetime.datetime.now() - datetime.timedelta(30)),
end_time=(datetime.datetime.now() - datetime.timedelta(29)),
variable_list=list_of_ids,
Expand Down
Loading