Skip to content

Add code_for #7

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

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Add code_for #7

merged 1 commit into from
Jul 2, 2020

Conversation

bramtayl
Copy link
Collaborator

Thought this might be useful to have. Similar to the CameronBieganek's V function.

@codecov
Copy link

codecov bot commented Jun 26, 2020

Codecov Report

Merging #7 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master        #7   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          191       193    +2     
=========================================
+ Hits           191       193    +2     
Impacted Files Coverage Δ
src/MetaGraphsNext.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58d03ab...cdbb9a1. Read the comment docs.

julia> meta[:a] = nothing

julia> code_for(meta, :a)
1
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what this is supposed to do. Why does this return 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because vertex :a is at vertex number 1. Does that make sense? Could I update the docs to make it more clear?

Copy link
Contributor

Choose a reason for hiding this comment

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

Where did you add the vertex? Did it automatically get added on the setindex call on L338?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, well I guess I'll merge this. Let me know if I should add anything to the docs to clarify that vertices get automatically added.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's best if it were documented. Implicit mutation of a graph is a footgun.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ref edd0b91

@bramtayl bramtayl merged commit ef62f95 into master Jul 2, 2020
@gdalle gdalle deleted the bramtayl_code_for branch February 22, 2023 16:38
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.

2 participants