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

DM-24404: Squash warnings from astropy's failure to close ecsv files. #192

Merged
merged 1 commit into from
Apr 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/lsst/meas/algorithms/defects.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import math
import numbers
import os.path
import warnings
import astropy.table

import lsst.geom
Expand Down Expand Up @@ -613,7 +614,12 @@ def readText(cls, filename):
defects : `Defects`
Defects read from a FITS table.
"""
table = astropy.table.Table.read(filename)
with warnings.catch_warnings():
# Squash warnings due to astropy failure to close files; we think
# this is a real problem, but the warnings are even worse.
# https://github.com/astropy/astropy/issues/8673
warnings.filterwarnings("ignore", category=ResourceWarning, module="astropy.io.ascii")
table = astropy.table.Table.read(filename)

# Need to convert the Astropy table to afw table
schema = lsst.afw.table.Schema()
Expand Down