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

Fixed the _color_arg_to_dict function #402

Merged
merged 8 commits into from
Jun 30, 2023
Merged

Fixed the _color_arg_to_dict function #402

merged 8 commits into from
Jun 30, 2023

Conversation

nwlandry
Copy link
Collaborator

This fixes #389.

@thomasrobiglio
Copy link
Collaborator

The only error in the test that I was able to reproduce is the one at this line (which is present in the branch but not present in the main 🤯) I guess than the others are then 'consequences' (e.g. the test function does not reach plt.close() maybe). Is this possible?

@nwlandry
Copy link
Collaborator Author

MVP!!!!! Thanks so much, @thomasrobiglio. That was the issue. I'll add a couple of tests and then undraft this PR.

@nwlandry nwlandry marked this pull request as ready for review June 14, 2023 19:57
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch coverage: 84.00% and project coverage change: -0.04 ⚠️

Comparison is base (00e14ec) 90.94% compared to head (1982067) 90.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #402      +/-   ##
==========================================
- Coverage   90.94%   90.90%   -0.04%     
==========================================
  Files          47       47              
  Lines        3888     3916      +28     
==========================================
+ Hits         3536     3560      +24     
- Misses        352      356       +4     
Impacted Files Coverage Δ
xgi/drawing/draw.py 76.72% <83.33%> (+0.08%) ⬆️
xgi/convert.py 94.75% <100.00%> (+0.14%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nwlandry nwlandry requested a review from maximelucas June 19, 2023 10:18
@nwlandry nwlandry requested review from thomasrobiglio and removed request for maximelucas June 27, 2023 13:04
Copy link
Collaborator

@thomasrobiglio thomasrobiglio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good :)

xgi/drawing/draw.py Outdated Show resolved Hide resolved
xgi/drawing/draw.py Outdated Show resolved Hide resolved
xgi/drawing/draw.py Outdated Show resolved Hide resolved
xgi/drawing/draw.py Outdated Show resolved Hide resolved
Comment on lines +780 to +781
minval = 0.1
maxval = 0.9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are these decided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values are so that the colors don't fade into the background but I suppose we could add them as an arg in the future?

xgi/drawing/draw.py Outdated Show resolved Hide resolved
@maximelucas
Copy link
Collaborator

maximelucas commented Jun 28, 2023

Nice good job!

Just a few questions to make sure the docs are clear.
Also, I found the "Returns" a bit confusing ("An ID: attribute dictionary."), I wasn't sure what was returned. Maybe "An {ID: attribute} dictionary." or "A dictionary keyed by node/edge IDs and values as attributes. Also attribute->arg/color since we never use "attribute" in the function I think. Same for _scalar_to_dict.

Btw: do you think we have similar problems (cmap/sizes not used from list) in _scalar_to_dict?

@nwlandry
Copy link
Collaborator Author

nwlandry commented Jun 30, 2023

Nice good job!

Just a few questions to make sure the docs are clear. Also, I found the "Returns" a bit confusing ("An ID: attribute dictionary."), I wasn't sure what was returned. Maybe "An {ID: attribute} dictionary." or "A dictionary keyed by node/edge IDs and values as attributes. Also attribute->arg/color since we never use "attribute" in the function I think. Same for _scalar_to_dict.

Btw: do you think we have similar problems (cmap/sizes not used from list) in _scalar_to_dict?

I updated _scalar_arg_to_dict() while I was at it. It's not really possible to perform the same fix for the scalar case, because in the color case, you know that colors are specified with tuples or strings, whereas if you're outputting a list of scalars, it's unclear whether you want those precise values or whether you want to interpolate between the min and max allowable values. I'll add it as an issue.

@nwlandry nwlandry merged commit 087cb61 into main Jun 30, 2023
@nwlandry nwlandry deleted the fix-cmap branch June 30, 2023 13:47
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

Successfully merging this pull request may close these issues.

viz: node_fc_cmap does not work if node_fc is not a NodeStat
3 participants