Skip to content
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

Make compatible with astropy 4.3 #117

Merged
merged 3 commits into from
Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions specsim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

import astropy.units
import astropy.table
import astropy.utils.data
import astropy.coordinates
import astropy.time
import astropy.io.fits
import astropy.wcs

from pkg_resources import resource_filename

def is_string(x):
"""Test if x is a string type.
Expand Down Expand Up @@ -238,7 +238,7 @@ def update(self):
base_path = self.base_path
if base_path == '<PACKAGE_DATA>':
self._assign(
'abs_base_path', astropy.utils.data._find_pkg_data_path('data'))
'abs_base_path', resource_filename('specsim','data'))
else:
try:
self._assign('abs_base_path', base_path.format(**os.environ))
Expand Down Expand Up @@ -686,8 +686,8 @@ def load_config(name, config_type=Configuration):
if extension:
file_name = name
else:
file_name = astropy.utils.data._find_pkg_data_path(
'data/config/{0}.yaml'.format(name))
file_name = resource_filename('specsim',
'data/config/{0}.yaml'.format(name))
if not os.path.isfile(file_name):
raise ValueError('No such config file "{0}".'.format(file_name))

Expand Down