-
Notifications
You must be signed in to change notification settings - Fork 16
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
Extend simulation infrastructure with Now()
#509
Extend simulation infrastructure with Now()
#509
Conversation
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.
LGTM, left one non-critical question
if TYPE_CHECKING: | ||
from .infrastructure import CoreblocksCommand |
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.
Could you elaborate why this needs to be conditioned on typechecking?
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.
Because in infrastructure.py
file I import symbols from functions.py
. So without this if
there is a circular dependency.
432fa00
to
04a6015
Compare
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.
Let's finally merge some testing extensions.
In some places it is useful to have direct access to the current cycle number. Till now we could manually count cycles, but this required using
call_try
everywhere. This commit ports simulation framework extension from #395. There is added new classNow()
which can be yielded during testing. In return a current cycle will be returned.This feature is needed to extend and port
CondVar
from #395coreblocks/test/common.py
Lines 429 to 433 in ddb21b5
Current
CondVar
notification requires to wait a cycle onnotify
. With usage ofNow()
it should be possible to omit this waiting.