Skip to content
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

JupyterViz grid display should be optional, since not all models use a grid or agent space #1778

Closed
rlskoeser opened this issue Aug 24, 2023 · 3 comments

Comments

@rlskoeser
Copy link
Contributor

What's the problem this feature will solve?
currently JupyterViz breaks if model.grid is not defined

Describe the solution you'd like
model.grid should continue to be optional; space should only be drawn when the model has a grid.

From testing locally, it looks like it is sufficient to modify the make_space method to check for the grid attribute and do nothing when it is defined. I'm willing to open a PR with this change if this solution is sufficient.

Additional context
Some discussion on #1772

@rht
Copy link
Contributor

rht commented Aug 25, 2023

I can see your point, where some models don't have an explicit grid/space, but my concern is that some users might blunder by forgetting to create a space, and the explicit error/breakage helps to remind them. The other option is to have a flag that lets user explicitly disable drawing space.

@rlskoeser
Copy link
Contributor Author

@rht that sounds fine to me; seems good to require users to explicitly opt out of displaying the space. Could you suggest a simple way to implement this? What about defining an argument for the JupyterViz space_drawer parameter that would disable it instead of getting the default display? Would False work, or is there a better way to explicitly indicate it should be disabled?

@rht
Copy link
Contributor

rht commented Sep 9, 2023

Fixed in #1783.

@rht rht closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants