Skip to content

Commit

Permalink
try to bypass key error
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jan 7, 2025
1 parent f79d97c commit e43d296
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions py/desiutil/iers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@ def _check_interpolate_indices(self, indices_orig, indices_clipped,
else:
astropy.utils.iers.conf.iers_degraded_accuracy = 'warn'
# Sanity check.
auto_class = astropy.utils.iers.IERS_Auto.open()
if auto_class is not iers:
raise RuntimeError('Frozen IERS is not installed as the default ({0} v. {1}).'.format(auto_class.__class__, iers.__class__))
# In Astropy 7 this appears to be broken due to the iers_frozen.ecsv being out of date.
# The *format* of that file no longer matches what is expected by astropy.util.iers.
try:
auto_class = astropy.utils.iers.IERS_Auto.open()
if auto_class is not iers:
raise RuntimeError('Frozen IERS is not installed as the default ({0} v. {1}).'.format(auto_class.__class__, iers.__class__))
except KeyError:
# Temporary Astropy 7/IERS workaround.
warnings.warn("Temporarily skipping IERS integrity check.", UserWarning)

if ignore_warnings:
try:
Expand Down
2 changes: 1 addition & 1 deletion py/desiutil/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_yamlify(self):
'num2': np.int64(4), 'bool': np.bool_(True),
'lst': ['tst2', np.int16(2)],
'tup': (1, 3), 'dct': {'a': 'tst3', 'b': np.float32(6.)},
'npstring' : np.str_('abcd'),
'npstring': np.str_('abcd'),
'array': np.zeros(10)}
self.assertIsInstance(fdict['name'], str)
# Run
Expand Down

0 comments on commit e43d296

Please sign in to comment.