Skip to content

Commit

Permalink
fix (?) pkg_resources in py3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
j-faria committed Nov 14, 2023
1 parent 5f16761 commit eef6d87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iCCF/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ def find_myself():

def load_example_data():
""" Load the example CCF stored in iCCF/example_data """
from pkg_resources import resource_stream
data = np.load(resource_stream(__name__, 'example_data/CCF1.npy'))
try:
from pkg_resources import resource_stream
data = np.load(resource_stream(__name__, 'example_data/CCF1.npy'))
except ModuleNotFoundError:
path = os.path.join(find_myself(), 'iCCF/example_data/CCF1.npy')
data = np.load(path)
return data


Expand Down

0 comments on commit eef6d87

Please sign in to comment.