Skip to content

Fix deprecation warning from pkg_resources in sphstat.twosample#22

Open
Vlad-Kor wants to merge 1 commit intohacihabiboglu:masterfrom
Vlad-Kor:master
Open

Fix deprecation warning from pkg_resources in sphstat.twosample#22
Vlad-Kor wants to merge 1 commit intohacihabiboglu:masterfrom
Vlad-Kor:master

Conversation

@Vlad-Kor
Copy link

@Vlad-Kor Vlad-Kor commented Dec 1, 2025

Importing sphstat currently prints the following warning:

/home/vlad/.cache/pypoetry/virtualenvs/web-app-Dk6Rue85-py3.10/lib/python3.10/site-packages/sphstat/twosample.py:59: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources as pkg

This eliminates the warning, by using importlib.resources instead of pkg_resources.

tested by calling:

import sys
sys.path.insert(0, 'src')
from sphstat.twosample import a20, a21, a23
print('a20:', a20(N=12, alpha=0.05, Rbar=0.7))
print('a21:', a21(gamma=2, N=20, alpha=0.05, Rbar=0.1))
print('a23:', a23(nu=2, r=2))
a20: 0.793
a21: 0.355
a23: 39.0

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.

1 participant