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

Compatibility with networkx 2.5 #1645

Merged
merged 1 commit into from
Jun 11, 2021
Merged

Conversation

thatch
Copy link
Contributor

@thatch thatch commented Apr 18, 2021

Fixes #1644

Description of proposed changes

networkx 2.5 has been out for a while now, and some deprecated apis were removed in 2.4 or so. This code should be compatible with any version in the 2.2-2.5 range, although there is a test failure near the "Singleton clique" comments.

Related issue(s)

Fixes #1644

Test plan

Ran the unittests. tox -e py37. One failure, noted above, which I could use help understanding.

Checklist

Need help on these? Just ask!

  • I have read the CONTRIBUTING document.
  • [n/a] I have updated the documentation accordingly.
  • [n/a] I have added tests to cover my changes.
  • [n/a] I have run tox -e complex and/or tox -e spark if appropriate.
  • All new and existing tests passed.

@brahmaneya
Copy link
Collaborator

Hi @thatch ,

The test is failing because nx.chordal_graph_cliques is now returning the singleton cliques in a different order. You can fix the test by replacing lines 200-208 in snorkel/test/labeling/model/test_label_model.py with

        for j in range(m):
            node = lm.c_tree.nodes[i]
            self.assertEqual(len(node['members']), 1)
            if 1 in node['members']:
                self.assertEqual(L_aug[0, node["start_index"]], 1)
            if 2 in node['members']:
                self.assertEqual(L_aug[0, 1 + node["start_index"]], 0)

@thatch thatch force-pushed the master branch 2 times, most recently from a7872b2 to d84ecff Compare April 27, 2021 22:46
@codecov
Copy link

codecov bot commented May 1, 2021

Codecov Report

Merging #1645 (a33011c) into master (b3b0669) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1645   +/-   ##
=======================================
  Coverage   97.31%   97.31%           
=======================================
  Files          68       68           
  Lines        2157     2157           
  Branches      348      348           
=======================================
  Hits         2099     2099           
  Misses         30       30           
  Partials       28       28           
Impacted Files Coverage Δ
snorkel/labeling/model/graph_utils.py 100.00% <100.00%> (ø)
snorkel/labeling/model/label_model.py 96.30% <100.00%> (ø)

@thatch
Copy link
Contributor Author

thatch commented May 17, 2021

Tests pass now, @brahmaneya

@bhancock8 bhancock8 merged commit 051816d into snorkel-team:master Jun 11, 2021
akode pushed a commit to akode/snorkel that referenced this pull request Jun 10, 2022
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.

test_augmented_L_construction failure after updating for networkx 2.5
3 participants