-
Notifications
You must be signed in to change notification settings - Fork 939
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
ADDS ALTAIR PLOT COMPONENT AND SOME OTHER FIXES #2644
base: main
Are you sure you want to change the base?
Conversation
Performance benchmarks:
|
Thanks for the PR! A few of the automated checks broke, could you look into what caused that? I will leave the review to others. |
@nissu99 also please look at #2643 and #2641 As you are @sanika-n are working in the same space As it looks like you two are looking over the entire altair implementation I would also recommend looking at #2642 discussion It is always good to collaborate and think together you may address some larger visualization challenges. |
"alt defined"
for more information, see https://pre-commit.ci
@tpike3 When I run the tests locally, they don't fail, but they are failing here. |
I am not sure why your tests are passing locally, however for tests to pass they need to updated. It is expecting
|
"removed a line"
"updated toml"
"removed suppress"
for more information, see https://pre-commit.ci
"doc string "
for more information, see https://pre-commit.ci
"operator bug"
Thank You, the issue got resolved by adding altair to the toml file. |
Removing stuff that has become redundant is fine. |
@quaquel i have added all the stuff,can you review it? |
I'll try to review it over the weekend, but I am rather bussy at the moment. This is a part of the code base I am not intimately familiar with and his been a while since I used Altair, so reviewing will take more time than parts of the code base I know inside out. |
Sure, works for me |
|
||
def _get_agent_data_new_discrete_space(space: DiscreteSpace, agent_portrayal): | ||
"""Format agent portrayal data for new-style discrete spaces. | ||
def get_agent_data(space, agent_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.
For matplotlib, we use a slightly different approach in particular for networks and hexgrids: we update the location inside the respective plotting functions.
Would it be possible to have a single overarching get_agent_data method that is valid for both matplotlib and altair?
space: the mesa.experiment.cell_space.Grid instance | ||
agent_portrayal: the agent portrayal callable | ||
space: Mesa space object | ||
agent_portrayal: Function defining agent visualization properties |
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.
please check the docs for get_agent_data in mpl_space_drawing
space: the ContinuousSpace instance | ||
agent_portrayal: the agent portrayal callable | ||
# New DiscreteSpace | ||
if isinstance(space, Grid): |
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 you rewrite this to use case switch statements? See draw_space in mpl_space_drawing.
Can you elaborate on the "other fixes" from the title? |
#2435
@quaquel @EwoutH I’ve added a new component, make_altair_plot_component. Could you kindly check if it aligns well with the project?
P.S working on space support.