Skip to content

Commit

Permalink
Use pkgutil.get_data instead of __file__
Browse files Browse the repository at this point in the history
  • Loading branch information
niklassiemer committed Oct 17, 2023
1 parent 660de11 commit 8612dab
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pyiron_atomistics/atomistics/structure/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Distributed under the terms of "New BSD License", see the LICENSE file.

from __future__ import print_function, unicode_literals
import pkgutil
import io
import numpy as np
import os
import mendeleev
import pandas
from functools import lru_cache
import pyiron_atomistics

__author__ = "Joerg Neugebauer, Sudarsan Surendralal, Martin Boeckmann"
__copyright__ = (
Expand Down Expand Up @@ -397,10 +397,8 @@ def _get_periodic_table_df(file_name):
"""
if not file_name:
return pandas.read_csv(
os.path.join(
os.path.dirname(pyiron_atomistics.__file__),
"_data",
"periodic_table.csv",
io.BytesIO(
pkgutil.get_data("pyiron_atomistics", "_data/periodic_table.csv")
),
index_col=0,
)
Expand Down

0 comments on commit 8612dab

Please sign in to comment.