Skip to content

Add data-free methods for add_vertex! and add_edge! #48

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 8 commits into from
Mar 3, 2023

Conversation

thchr
Copy link
Contributor

@thchr thchr commented Mar 3, 2023

Following discussion with @gdalle on Slack, here's a suggestion to have data-free versions of add_vertex! and add_edge! if the corresponding data-types are Nothing.

@gdalle mentioned that this could potentially be for any union type, but I wasn't completely clear on the implications of that. This was intended as the case where e.g., VertexData = Union{T, Nothing} where T? Should we add that?

@gdalle
Copy link
Member

gdalle commented Mar 3, 2023

@gdalle mentioned that this could potentially be for any union type, but I wasn't completely clear on the implications of that. This was intended as the case where e.g., VertexData = Union{T, Nothing} where T? Should we add that?

On second thought this might be confusing, since T can also have a default value the user wants to use. Let's stick to pure Nothing for now

@gdalle
Copy link
Member

gdalle commented Mar 3, 2023

Could you maybe add some small tests?

@thchr
Copy link
Contributor Author

thchr commented Mar 3, 2023

I added some tests now. I didn't add them to the tutorials, partly because I'm not familiar with the tooling there, partly because this seems not sufficiently important to include in a tutorial.

@gdalle
Copy link
Member

gdalle commented Mar 3, 2023

I added some tests now. I didn't add them to the tutorials, partly because I'm not familiar with the tooling there, partly because this seems not sufficiently important to include in a tutorial.

I agree :) Could you maybe just put these tests in a separate file, like test/misc.jl, which you include from test/runtests.jl?

@thchr
Copy link
Contributor Author

thchr commented Mar 3, 2023

I agree :) Could you maybe just put these tests in a separate file, like test/misc.jl, which you include from test/runtests.jl?

Sure: done.

@gdalle
Copy link
Member

gdalle commented Mar 3, 2023

I fixed the constructors because your tests used the old version, don't forget to run the tests locally before asking CI to do the same 😉 we should be good to merge once they pass

@thchr
Copy link
Contributor Author

thchr commented Mar 3, 2023

I've been shamelessly writing this entirely on Github's editor - so nothing checked locally :D. Anyway, more formatting issues finally made me download it locally to run JuliaFormatter; tests now also pass locally.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #48 (4ab0b2c) into master (f546d96) will increase coverage by 0.10%.
The diff coverage is 100.00%.

❗ Current head 4ab0b2c differs from pull request most recent head a10deba. Consider uploading reports for the commit a10deba to get more accurate results

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
+ Coverage   92.72%   92.83%   +0.10%     
==========================================
  Files           7        7              
  Lines         275      279       +4     
==========================================
+ Hits          255      259       +4     
  Misses         20       20              
Impacted Files Coverage Δ
src/graphs.jl 87.61% <100.00%> (+0.49%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gdalle gdalle merged commit 7b034c2 into JuliaGraphs:master Mar 3, 2023
@thchr thchr deleted the patch-1 branch March 3, 2023 12:41
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