Skip to content

graph.Graph #1413

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

Closed
IvarStefansson opened this issue Apr 13, 2025 · 4 comments · Fixed by #1429
Closed

graph.Graph #1413

IvarStefansson opened this issue Apr 13, 2025 · 4 comments · Fixed by #1429

Comments

@IvarStefansson
Copy link
Contributor

I find one usage only. Can it be replaced with networkx functionality?

@keileg
Copy link
Contributor

keileg commented Apr 23, 2025

The Graph class is used to find disconnected clusters of cells during splitting of nodes (there will be two clusters for a standard fracture node, three for a T-intersection etc.). This can also be done by the method connected_components from networkx.

It turns out we have already done that change for the main splitting routine some years ago, see L779 in split_grid.py. The old graph class is used only in a hidden option to visualize the split grid with an offset in the nodes (function duplicate_nodes_with_offset in split_grid). Ideally, I should have seen this when searching for candidates for deprecation, but as mentioned elsewhere, the whole folder is too untidy for me to get a proper overview.

Options:

  1. Leave as is.
  2. Deprecate the visualization option. This will get rid of the graph class, and the last ~300 lines in split_grid
  3. Update the visualization procedure to use networkx. Ideally, we should get rid of the parallel functions to duplicate nodes, but it is hard to estimate the work needed here. I do not recall the history, but suspect that there use to be a single function prior to the introduction of networkx, and that some combination of implementation complexity, convenience and laziness on my part led to the function not being updated.

Option 2 is by far the most convenient one, but I have no feeling for whether the offset option is being used. What do you think?

@IvarStefansson
Copy link
Contributor Author

I vote for 2 or 3. If I am to provide a more thorough evaluation, I think we should discuss. Is there reason to believe that the answer could be influenced by the fact that we're planning to revive the propagation work?

@keileg
Copy link
Contributor

keileg commented May 15, 2025

@IvarStefansson Let's discuss this in person.

@keileg
Copy link
Contributor

keileg commented May 19, 2025

Resolution:

  1. The graph class is deprecated, DEPR: Marked the Graph class for future deletion #1429
  2. A rework of the relevant parts of split_grid is outlined in Revisit functionality for visualization of splitting of grids #1428

@keileg keileg linked a pull request May 19, 2025 that will close this issue
13 tasks
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 a pull request may close this issue.

2 participants