-
Notifications
You must be signed in to change notification settings - Fork 944
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
Creating threads to update visualization asynchronously #2656
Open
HMNS19
wants to merge
25
commits into
projectmesa:main
Choose a base branch
from
HMNS19:issue-2604
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4722447
Optimize UI responsiveness by Offloading model execution to separate …
HMNS19 ac55736
adding thread without implementing render_interval
HMNS19 4182285
visualisation thread
HMNS19 2561df8
render _interval functioning
HMNS19 00c3c93
Update solara_viz.py
HMNS19 a68b4fd
Update solara_viz.py
HMNS19 8e72a05
terminating threads
HMNS19 a08bdcb
removing asynchornous task to avoid cancelledError exception
HMNS19 fd17584
bidirectional synchronization
HMNS19 d1c7965
takes care of valueError and CancelledError
HMNS19 8b8cd19
final changes
HMNS19 1c276aa
Display message for adjusting play interval when using threads
HMNS19 fec0861
updating SimulatorConrtoller
HMNS19 775eaa9
Update solara_viz.py
HMNS19 1ef0cb9
Merge branch 'projectmesa:main' into issue-2604
HMNS19 5e5b2cf
solving the 'non rendering of plots while using threads' bug
HMNS19 b1ffeff
Fix code indentation
HMNS19 0fcf2b2
Fix code indentation
HMNS19 791d70b
threading for simulator
HMNS19 6cd0f22
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3ba3593
Change from use_thread to use_task in SimulatorController for better …
HMNS19 2d4e7d7
Merge branch 'main' into issue-2604
HMNS19 e5579ad
ensuring event objects dont reset during re-renders and removing asyn…
HMNS19 da8d67b
Merge branch 'main' into issue-2604
HMNS19 d771f7f
removing lambda
HMNS19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@HMNS19 Thanks for the PR!
I will leave the more focused review to @quaquel and @Corvince, however if possible I like to avoid
lambda
functions in Mesa as they are generally viewed as less readable, harder to read in the traceback and create issues with serialization. As this is part of the visual I appreciate the last 2 are less of a concernHowever a simple function is also fairly easy to add
See PEP 8
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.
Thanks for the feedback! I’ve replaced the lambda with a named function as you suggested. Let me know if there’s anything else to improve. Also curious—would lambda functions in the play_interval and render_interval sliders have similar concerns?