Conversation
|
Performance benchmarks:
|
quaquel
reviewed
Mar 5, 2026
mesa/datacollection.py
Outdated
| """ | ||
| if table_name not in self.tables: | ||
| raise Exception("Table does not exist.") | ||
| raise ValueError(f"Table '{table_name}' does not exist.") |
Member
There was a problem hiding this comment.
I am wondering whether we should not use a custom exception here instead?
quaquel
reviewed
Mar 5, 2026
quaquel
requested changes
Mar 5, 2026
Member
quaquel
left a comment
There was a problem hiding this comment.
One suggestion, but looks fine otherwise.
Contributor
Author
I have updated the PR with custom exceptions. |
quaquel
reviewed
Mar 9, 2026
Co-authored-by: Jan Kwakkel <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
self.time: float = 0.0assignment inModel.__init__Model._advance_time()andModel.run_until()— the condition checksuntil <= self.timebut the message said "is larger than" (should say "is not larger than")DataCollector.get_model_vars_dataframe()andget_agent_vars_dataframe()— they usedraise UserWarning(...)which crashes the caller instead of issuing a warning. Changed towarnings.warn()with a gracefulreturn pd.DataFrame()raise Exception(...)withraise ValueError(...)inadd_table_row()andget_table_dataframe()for better exception specificity