-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mqtt fixes #222
Mqtt fixes #222
Conversation
this allows to just use a different simulation body
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
==========================================
+ Coverage 78.03% 78.10% +0.07%
==========================================
Files 40 40
Lines 4198 4198
==========================================
+ Hits 3276 3279 +3
+ Misses 922 919 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
I hardly get what is happening here. Nice though if it works. I am looking forward to next development meeting :) |
@@ -397,7 +397,10 @@ async def clear_market(self, market_products: list[MarketProduct]): | |||
|
|||
for meta in market_meta: | |||
logger.debug( | |||
f'clearing price for {self.marketconfig.name} is {meta["price"]:.2f}, volume: {meta["demand_volume"]}' | |||
"clearing price for %s is %.2f, volume: %f", | |||
self.marketconfig.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please stick to one format for strings? In the whole code we are using f"{}" format. it would be confusing to have it different in some places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this view too for quite a while.
But unfortunately, formatting with f-strings is evaluated every time - even if the logger is set to warning (so the price is formatted even if the line is not printed).
Using it with the % notation does only execute the formatting when loglevel is set to debug.
But I would not like to switch to the %s notation on all other places.. 🤷
So I think we can't really do anything but to use the %s format in logger situations and format strings everywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, good to know, let's keep it this way
Weird that |
This includes fixes to running the MQTT container with docker for a distributed simulation.
For distributed simulations, one can start
python examples/distributed_world_manager.py
in one terminal and runpython examples/distributed_world_agent.py
in another one.A registry of which agents are available (and must be online before simulation can start) and a central yaml config are still needed.
So this is an early fix set, which should not change anything to existing behavior