-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Deprecate hmn
and lgc
modules from the node_classification
package
#5166
Merged
jarrodmillman
merged 6 commits into
networkx:main
from
rossbar:node-classification-module
Nov 6, 2021
Merged
Deprecate hmn
and lgc
modules from the node_classification
package
#5166
jarrodmillman
merged 6 commits into
networkx:main
from
rossbar:node-classification-module
Nov 6, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Condense all node-classification tests into single test module one level up.
Add a deprecation warning whenever the hmn or lgc attributes are accessed.
dschult
approved these changes
Nov 3, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
jarrodmillman
approved these changes
Nov 6, 2021
dschult
pushed a commit
to dschult/networkx
that referenced
this pull request
Jan 25, 2022
…age (networkx#5166) * Reorganize tests. Condense all node-classification tests into single test module one level up. * Add tests for deprecation warnings. * Prevent test crosstalk. * Refactor pkg with __getattr__ and __dir__. Add a deprecation warning whenever the hmn or lgc attributes are accessed. * Add deprecation reminder to developer docs. * Add release note.
MridulS
pushed a commit
to MridulS/networkx
that referenced
this pull request
Feb 4, 2023
…age (networkx#5166) * Reorganize tests. Condense all node-classification tests into single test module one level up. * Add tests for deprecation warnings. * Prevent test crosstalk. * Refactor pkg with __getattr__ and __dir__. Add a deprecation warning whenever the hmn or lgc attributes are accessed. * Add deprecation reminder to developer docs. * Add release note.
cvanelteren
pushed a commit
to cvanelteren/networkx
that referenced
this pull request
Apr 22, 2024
…age (networkx#5166) * Reorganize tests. Condense all node-classification tests into single test module one level up. * Add tests for deprecation warnings. * Prevent test crosstalk. * Refactor pkg with __getattr__ and __dir__. Add a deprecation warning whenever the hmn or lgc attributes are accessed. * Add deprecation reminder to developer docs. * Add release note.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Deprecates the
hmn
andlgc
modules in thenode_classification
package. These names are not particularly descriptive, and are more of an implementation detail than useful objects or namespaces.Refactors the
node_classification/__init__.py
with__getattr__
and__dir__
so that the same functions are visible/accessible from the package, but a deprecation warning is raised if a user tries to access thehmn
orlgc
attributes specifically. Access to the functions they define (harmonic_function
andlocal_and_global_consistency
, respectively) should be exactly the same as before.This deprecation is in preparation for refactoring
node_classification
from a package to a module for NetworkX 3.0. The functions defined inlgc.py
andhmn.py
, along with an internal function in the currently unexposedutils.py
, will be moved to anode_classification.py
module, which will replace the current package. I've taken the liberty of combining thehmn
andlgc
tests into one top-leveltest_node_classification.py
file that lives one level up. I left the tests themselves entirely unchanged.I've also added tests to ensure that deprecation warnings are raised at the appropriate times.