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

Fix outputs function #208

Merged
merged 6 commits into from
Sep 26, 2023
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
3 changes: 3 additions & 0 deletions assume/common/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ async def on_stop(self):
df = pd.read_sql(query, self.db)
except (OperationalError, ProgrammingError):
continue
except Exception as e:
nick-harder marked this conversation as resolved.
Show resolved Hide resolved
logger.error("could not read query: %s", e)
continue

dfs.append(df)

Expand Down
1 change: 1 addition & 0 deletions assume/common/units_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def write_learning_to_output(self, start: datetime, marketconfig: MarketConfig):

db_aid = self.context.data_dict.get("learning_output_agent_id")
db_addr = self.context.data_dict.get("learning_output_agent_addr")

nick-harder marked this conversation as resolved.
Show resolved Hide resolved
if db_aid and db_addr:
self.context.schedule_instant_acl_message(
receiver_id=db_aid,
Expand Down
2 changes: 2 additions & 0 deletions assume/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ def add_unit_operator(
unit_operator_agent._role_context.data_dict = {
"output_agent_addr": self.output_agent_addr[0],
"output_agent_id": self.output_agent_addr[1],
"learning_output_agent_addr": self.output_agent_addr[0],
"learning_output_agent_id": self.output_agent_addr[1],
}

async def async_add_unit(
Expand Down