Skip to content

Commit

Permalink
Merge pull request #224 from ImperialCollegeLondon/reset_data
Browse files Browse the repository at this point in the history
Reset data after model has completed resetting and is ready
  • Loading branch information
AdrianDAlessandro authored Feb 15, 2024
2 parents 465806a + bfcb7e7 commit 0bd095c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datahub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ def set_model_signals(start: bool) -> str:
def signal_model_ready(ready: bool) -> str:
"""POST method function for indicating when the model has reset and is ready to run.
This will reset the data in the DataHub to it's initial (empty) values when the
ready signal is received as True.
It has the query parameter:
- `ready`: A boolean to indicate the model has completed setup and is ready.
Expand All @@ -297,6 +300,9 @@ def signal_model_ready(ready: bool) -> str:
log.info(message)
dt.model_resetting = not ready

if ready:
dt.reset_data()

return message


Expand Down

0 comments on commit 0bd095c

Please sign in to comment.