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

Support networkx 3.1 #35584

Merged
merged 2 commits into from May 28, 2023
Merged

Support networkx 3.1 #35584

merged 2 commits into from May 28, 2023

Conversation

tornaria
Copy link
Contributor

📚 Description

The functions number_of_cliques() and cliques_containing_node() are deprecated in networkx 3.1.

This commit reimplements both functions based on method cliques_maximal().

This PR is critical to upgrade networkx to 3.1 in void linux.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have created tests covering the changes.

@tornaria
Copy link
Contributor Author

Lint failure is unrelated:

Run tox -e pycodestyle-minimal
pycodestyle-minimal: freeze> python -m pip freeze --all
pycodestyle-minimal: pip==23.1.2,setuptools==67.7.2,wheel==0.40.0
pycodestyle-minimal: commands[0]> tox -c /home/runner/work/sage/sage/src/tox.ini -e pycodestyle-minimal --
pycodestyle-minimal: install_deps /home/runner/work/sage/sage/src> python -I -m pip install pycodestyle
pycodestyle-minimal: commands[0] /home/runner/work/sage/sage/src> pycodestyle --select E111,E211,E271,E306,E401,E502,E701,E702,E703,W291,W391,W605,E711,E712,E713,E721,E722
pycodestyle-minimal: commands[1] /home/runner/work/sage/sage/src> pycodestyle --select E111,E306,E401,E703,W293,W391,W605,E712,E713,E714,E721,E722 --filename '*.pyx'
./sage/rings/real_double.pyx:1525:1: W293 blank line contains whitespace
./sage/rings/real_mpfr.pyx:2995:1: W293 blank line contains whitespace
2       W293 blank line contains whitespace
pycodestyle-minimal: exit 1 (20.78 seconds) /home/runner/work/sage/sage/src> pycodestyle --select E111,E306,E401,E703,W293,W391,W605,E712,E713,E714,E721,E722 --filename '*.pyx' pid=1864
  pycodestyle-minimal: FAIL code 1 (92.31=setup[1.42]+cmd[70.11,20.78] seconds)
  evaluation failed :( (92.38 seconds)
pycodestyle-minimal: exit 1 (92.55 seconds) /home/runner/work/sage/sage> tox -c /home/runner/work/sage/sage/src/tox.ini -e pycodestyle-minimal -- pid=1739
  pycodestyle-minimal: FAIL code 1 (93.75=setup[1.20]+cmd[92.55] seconds)
  evaluation failed :( (93.91 seconds)
Error: Process completed with exit code 1.

Is this a bug in 10.0.rc0 ? Or is this a case of workflow changing without making sure develop passes?

@tornaria
Copy link
Contributor Author

@vbraun @mkoeppe I rebased to rc1 but it's still failng lint. Can we get CI fixed please?

Copy link
Member

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

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

LGTM. I support merging it in 10.0 to make downstream packaging easier.

src/sage/graphs/graph.py Outdated Show resolved Hide resolved
src/sage/graphs/graph.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

it's to comply with the coding style

src/sage/graphs/graph.py Outdated Show resolved Hide resolved
src/sage/graphs/graph.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

LGTM.

The functions `number_of_cliques()` and `cliques_containing_node()` are
deprecated in networkx 3.1.

This commit reimplements both functions based on method `cliques_maximal()`.
The previous implementation was taken from the ones that are deprecated
in networkx 3.1.

We replace it by a better implementation suggested by David Coudert.
@tornaria
Copy link
Contributor Author

Rebased to 10.0.rc2 without any change (removes spurious "fix the linter commits")

@tornaria tornaria mentioned this pull request May 10, 2023
5 tasks
@github-actions
Copy link

Documentation preview for this PR is ready! 🎉
Built with commit: e599562

@vbraun vbraun merged commit be0aab7 into sagemath:develop May 28, 2023
6 of 7 checks passed
@tornaria tornaria deleted the networkx-3.1 branch May 29, 2023 18:08
vbraun pushed a commit that referenced this pull request Jun 11, 2023
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->
https://networkx.org/documentation/stable/release/index.html; still
supports Python >= 3.8 (see #35404)
- https://networkx.org/documentation/stable/release/release_3.1.html
- https://networkx.org/documentation/stable/release/release_3.0.html

python_igraph still supports Python >= 3.7.
- https://igraph.org/2023/01/27/igraph-0.10.4-c.html
- https://igraph.org/2022/12/30/igraph-0.10.3-c.html

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->
- Depends on #35584

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35671
Reported by: Matthias Köppe
Reviewer(s): David Coudert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants