Remove pkg_resources dependency from sambar.py#380
Open
marouenbg wants to merge 2 commits intonetZoo:develfrom
Open
Remove pkg_resources dependency from sambar.py#380marouenbg wants to merge 2 commits intonetZoo:develfrom
marouenbg wants to merge 2 commits intonetZoo:develfrom
Conversation
Replace pkg_resources.resource_filename() with os.path.join() relative to __file__ for locating package data files. This removes the dependency on setuptools/pkg_resources which is deprecated and scheduled for removal. Fixes netZoo#363
- test_cobra: use numpy array for mean computation instead of pandas Series integer access (KeyError: 0 with string column index) - condor: use .iloc for positional access on iterrows() Series (KeyError: 2 with string column labels) - condor: use ki.sum() instead of float(sum(ki)) to avoid TypeError with np.matrix column vectors in newer numpy
This file contains hidden or 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
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.
Summary
Replace
pkg_resources.resource_filename()withos.path.join(os.path.dirname(__file__), ...)insambar.pyfor locating package data files.Motivation
pkg_resources(from setuptools) is deprecated and scheduled for removal. It also creates an implicit dependency on setuptools which isn't part of the standard library and may not be available in all environments (e.g. pixi).The replacement uses
os.pathwhich is in the standard library and already imported in the file.Fixes #363
Changes
netZooPy/sambar/sambar.py: replacedimport pkg_resourcesand 4 calls topkg_resources.resource_filename()withos.path.join()relative to__file__.