Skip to content

Update test suite to handle when scipy is not installed - #7388

Merged
jarrodmillman merged 9 commits into
networkx:mainfrom
rossbar:fix-gh7383
Apr 3, 2024
Merged

jarrodmillman merged 9 commits into
networkx:mainfrom
rossbar:fix-gh7383

Conversation

@rossbar

@rossbar rossbar commented Apr 3, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #7383, or at least the actionable part of that issue.

These changes don't really affect user code/experience at all, the main motivation is to make it more visible when functions are added/changed that depend on scipy. Though we don't generally expect to have users with environments where only some of the default dependencies are installed, it's useful during review to automatically catch these cases and can be useful at a high-level to get a sense of just how much of the codebase depends on the default dependencies, with numpy and scipy being "special" in that they both provide data structures (arrays and sparse arrays, respectively) that are used quite a bit throughout NX.

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like a good action that tests with default libraries but without scipy. It adds about a 2m action to the total test time.
All the additions look good -- and the test doesn't show that any others exist.
I approve this PR

Thanks!

@jarrodmillman
jarrodmillman merged commit 0d878d8 into networkx:main Apr 3, 2024
@jarrodmillman jarrodmillman added this to the 3.3 milestone Apr 3, 2024
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
* Skip cycle independence check with scipy not present.

* importorskip scipy for resistance_distance tests.

* importorskip scipy kemeny_constant tests.

* importorskip scipy for effective_graph_resistance.

* importorskip scipy to number_of_spanning_trees tests.

* Add modules to ignore for doctest when scipy not installed.

* Update test_draw to catch scipy not installed case.

* Update importorskip in current_flow_betweenness_partition.

* Add CI job for default deps without scipy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3.2.1: pytest fails in networkx/drawing/tests/test_pylab.py with module 'matplotlib' has no attribute 'use'

3 participants