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

default settings in draw() ignored if one of them is passed as argument #443

Closed
maximelucas opened this issue Aug 1, 2023 · 2 comments · Fixed by #476
Closed

default settings in draw() ignored if one of them is passed as argument #443

maximelucas opened this issue Aug 1, 2023 · 2 comments · Fixed by #476
Labels
bug Something isn't working viz

Comments

@maximelucas
Copy link
Collaborator

Running

H = xgi.random_hypergraph(10, ps=[0.6, 0.05, 0.001], seed=3)
settings = {"min_node_size": 5}
xgi.draw_nodes(H, settings=settings)

raises KeyError: 'node_fc_cmap' for settings["node_fc_cmap"].

This is because the function starts with

if settings is None:
        settings = {
            "min_node_size": 10.0,
            "max_node_size": 30.0,
            "min_node_lw": 1.0,
            "max_node_lw": 5.0,
            "node_fc_cmap": cm.Reds,
            "node_ec_cmap": cm.Greys,
        }

so that if you pass a settings argument with a single one of those (or that is just not None), all other default values are never defined.

I guess default settings should always be defined, and only updated by the arguments?

@maximelucas
Copy link
Collaborator Author

#441 solved this for drawing nodes. Still needs fixing for drawing hyperedges.

@maximelucas
Copy link
Collaborator Author

#456 fixed if for draw_hyperedges(). Still needs fixing for draw_dihypergraph().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working viz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant