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

Implement "copy" functionality for FGraph #52

Open
DoganCK opened this issue Sep 25, 2023 · 2 comments
Open

Implement "copy" functionality for FGraph #52

DoganCK opened this issue Sep 25, 2023 · 2 comments
Labels
Difficulty: Intermediate Hackathon projects with intermediate difficulty enhancement New feature or request FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon Status: In Progress

Comments

@DoganCK
Copy link
Collaborator

DoganCK commented Sep 25, 2023

Description
Our ultimate goal is to leave the decision to use mutation or not to the user. Mutation makes sense for heavy duty operations that run on the cloud. But while developing and working with smaller graphs mutation gets in the way and can be unwieldy to use. The initial step for this is to have a deep copy functionality.

Pointers
https://learn.microsoft.com/en-us/dotnet/api/system.object.memberwiseclone?view=net-7.0

@DoganCK DoganCK added enhancement New feature or request Difficulty: Intermediate Hackathon projects with intermediate difficulty Status: Available FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon labels Sep 25, 2023
@DoganCK DoganCK added this to the Graphoscope Hackathon milestone Sep 25, 2023
@timu
Copy link
Contributor

timu commented Sep 30, 2023

I'll be working on this one

@timu
Copy link
Contributor

timu commented Sep 30, 2023

The implementation is a shared effort from myself and @yigitl.

We now have an implementation that creates clones of undirected graphs.

Currently, the function will create a deep copy if the NodeData/EdgeData generics are value types, and it will create a shallow copy if these are reference types.

This implementation should be revised after a decision on how to handle EdgeData/NodeData generics. There are three ways of handling these generics:

  1. Enforce IClonable, so that the user has to use data types that implement _.Clone(), or implement _.Clone() for their own data types.
  2. Constraint these generics to be value types. This means that records should have [<Struct>] flag.
  3. Do nothing, just tell the user is cloning might not work if the generics are reference types.

Implementation of these options is relatively trivial and can be applied as soon as a decision has been reached.

timu added a commit to timu/Graphoscope that referenced this issue Sep 30, 2023
LibraChris added a commit that referenced this issue Sep 30, 2023
#52 adds clone capability to undirected graphs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Intermediate Hackathon projects with intermediate difficulty enhancement New feature or request FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon Status: In Progress
Projects
Status: No status
Development

No branches or pull requests

3 participants