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

reuse function added, but not working yet #15

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FalafelGood
Copy link

Hi,

As promised, I spent some time today looking over the code and giving my best stab at the reuse function we discussed in issues. It doesn't work yet, (I can't get the argument types to match) but I figured I would make a PR anyways to share my progress and get feedback.

To reiterate: This function does not work! Do not accept this PR without advising or fixing first!!

If there's a better way in the future for me to share code without PR, please let me know. This feels incorrect.
Cheers,

  • Falfafel

@bramtayl
Copy link
Collaborator

Thanks for giving it a shot! I was imagining using keyword arguments instead. The Dict wouldn't be type stable because the values are typed as Any.

Copy link
Member

@gdalle gdalle left a comment

Choose a reason for hiding this comment

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

Hey @FalafelGood! This looks like a very general reuse method, which may work on basically any mutable struct. Maybe coding something more specific to MetaGraphs would be easier? Perhaps using keyword arguments like this:

function reuse(
    g::MetaGraph{...,GraphData,...},
    new_graph_data::GraphData=g.graph_data
) where {GraphData}
    # do stuff
end

@gdalle gdalle marked this pull request as draft February 21, 2023 09:07
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.

None yet

3 participants