-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix spatial variation of water level in rainfall example #108
Conversation
Codecov ReportBase: 79.50% // Head: 79.50% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
=======================================
Coverage 79.50% 79.50%
=======================================
Files 6 6
Lines 610 610
Branches 99 99
=======================================
Hits 485 485
Misses 108 108
Partials 17 17 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -19,7 +19,13 @@ def cell_portrayal(cell: LakeCell) -> Tuple[float, float, float, float]: | |||
if cell.water_level == 0: | |||
return cell.elevation, cell.elevation, cell.elevation, 1 | |||
else: | |||
return 0, 0, 255, 1 | |||
# return scaled blue color for water level | |||
return ( |
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.
Is this supposed to be a color gradient? I couldn't spot any noticeable gradient. What if you exaggerate the gradient further?
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.
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 see. You probably need to add a comment explaining that an array returns a color gradient.
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.
Something like the recent update?
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.
Not enough info. People are not likely to be aware that an array instead of a scalar means gradient.
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 how about now
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.
Huh it does mean a single color after all. I thought we have color varying across space, and within a cell. In https://github.com/projectmesa/mesa/blob/fed83543487f6834b172f3a7c88754733e12c539/examples/shape_example/shape_example/server.py#L18, if you specify 2 color in an array, it becomes a gradient of color within 1 portrayal.
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.
Looks better, merging.
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.
Yes sorry about the confusion 😅
ac6af24
to
34b547e
Compare
34b547e
to
92613a9
Compare
Use scaled blue color to represent water level. The differences between cells are small so it may be hard to visualize the spatial variation.
Before the fix:
Now: