Skip to content

Commit

Permalink
Fix outputs function (#208)
Browse files Browse the repository at this point in the history
-rl params were not written when not in learning
-should be for eval
-error handling was wrong

---------

Co-authored-by: Florian Maurer <[email protected]>
  • Loading branch information
nick-harder and maurerle authored Sep 26, 2023
1 parent e913958 commit ac75b59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
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:
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")

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

0 comments on commit ac75b59

Please sign in to comment.