From 825202fc7fe57f02f2850f063bb015b9a264fc8f Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 30 Oct 2025 13:00:58 +0200 Subject: [PATCH 1/2] Ancient unclosed SED file warning --- astLib/__init__.py | 2 +- astLib/astSED.py | 11 +++++------ setup.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/astLib/__init__.py b/astLib/__init__.py index 5cbf861..d948c7a 100644 --- a/astLib/__init__.py +++ b/astLib/__init__.py @@ -13,4 +13,4 @@ """ __all__=['astCalc', 'astCoords', 'astImages', 'astPlots', 'astStats', 'astWCS', 'astSED'] -__version__ = '0.13.1' +__version__ = '0.13.2' diff --git a/astLib/astSED.py b/astLib/astSED.py index de05bbb..2889aac 100644 --- a/astLib/astSED.py +++ b/astLib/astSED.py @@ -657,9 +657,9 @@ def __init__(self, normalise = False): VEGA_SED_PATH=astLib.__path__[0]+os.path.sep+"data"+os.path.sep+"bohlin2006_Vega.sed" # from HST CALSPEC - inFile=open(VEGA_SED_PATH, "r") - lines=inFile.readlines() - + with open(VEGA_SED_PATH, "r") as inFile: + lines=inFile.readlines() + wavelength=[] flux=[] for line in lines: @@ -698,9 +698,8 @@ class StellarPopulation: """ def __init__(self, fileName, ageColumn = 0, wavelengthColumn = 1, fluxColumn = 2): - inFile=open(fileName, "r") - lines=inFile.readlines() - inFile.close() + with open(fileName, "r") as inFile: + lines=inFile.readlines() self.fileName=fileName diff --git a/setup.py b/setup.py index e85cfe8..3dbfa8f 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ def build_extensions(self): build_ext.build_extensions(self) setup(name='astLib', - version='0.13.1', + version='0.13.2', packages=['astLib', 'PyWCSTools'], package_data={'astLib': ['data/*']}, cmdclass={"build_ext": build_PyWCSTools_ext}, From bac9bac2dad295cf34e798b876a691b43e4142de Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 12 Feb 2026 11:32:20 +0200 Subject: [PATCH 2/2] Fix for pkg_resources removal --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 3dbfa8f..1d2f540 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ from setuptools.command.build_ext import build_ext from setuptools.extension import Extension import sysconfig -from pkg_resources import require topDir = os.getcwd() sourceDir = "PyWCSTools"+os.path.sep+"wcssubs-3.9.7"+os.path.sep