From 7d456af4f8b86fad93e485b45a39c50ae3b6750d Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Thu, 6 Feb 2025 10:51:52 -0800 Subject: [PATCH 1/2] get bugfix for astroquery still in dev --- poetry.lock | 16 ++++++++++------ pyproject.toml | 2 +- tom_catalogs/harvesters/simbad.py | 5 +++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/poetry.lock b/poetry.lock index 60bac188..79456a0a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -309,15 +309,13 @@ test = ["hypothesis", "pytest", "pytest-remotedata"] [[package]] name = "astroquery" -version = "0.4.9.post1" +version = "0.4.10.dev9803" description = "Functions and classes to access online astronomical data resources" optional = false python-versions = ">=3.9" groups = ["main"] -files = [ - {file = "astroquery-0.4.9.post1-py3-none-any.whl", hash = "sha256:d3e4af26bc57ce1822c1a89963f5096e89f3b8eb414341e0643cb235fee32f50"}, - {file = "astroquery-0.4.9.post1.tar.gz", hash = "sha256:5c116bf19036d71e9321d4a049875af55349a4888e24844558fe9984b9f57197"}, -] +files = [] +develop = false [package.dependencies] astropy = ">=5.0" @@ -333,6 +331,12 @@ all = ["astropy-healpix", "boto3", "mocpy (>=0.12)", "regions (>=0.5)"] docs = ["fsspec[http]", "matplotlib", "scipy", "sphinx-astropy (>=1.5)", "sphinx-automodapi (<0.18)"] test = ["fsspec[http]", "matplotlib", "moto[s3]", "pytest-astropy", "pytest-dependency", "pytest-rerunfailures"] +[package.source] +type = "git" +url = "https://github.com/astropy/astroquery.git" +reference = "e2db773" +resolved_reference = "e2db773ac2c9aaf4e2d79bcd0961b9cbb22f166e" + [[package]] name = "async-timeout" version = "5.0.1" @@ -2909,4 +2913,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"] [metadata] lock-version = "2.1" python-versions = ">=3.9.0,<3.13" -content-hash = "8720f742a36e2bf3b8b452260c73d83fa47b36d65204a9033fccec1b6410e27c" +content-hash = "1272df5258c20c8953226c1ff814a31ef5afbb48058b76249f0e21d8b3630f25" diff --git a/pyproject.toml b/pyproject.toml index c08751ba..14836388 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dynamic = ["version"] requires-python = ">=3.9.0,<3.13" dependencies = [ "numpy >1.24,<2.2", - "astroquery <1", + "astroquery @ git+https://github.com/astropy/astroquery.git@e2db773", "astroplan >=0.8,<0.11", "astropy >=5.3.3,<7 ; python_version >= '3.10'", "astropy >=5.3.3,<6 ; python_version < '3.10'", diff --git a/tom_catalogs/harvesters/simbad.py b/tom_catalogs/harvesters/simbad.py index 7b1946fd..16616bd2 100644 --- a/tom_catalogs/harvesters/simbad.py +++ b/tom_catalogs/harvesters/simbad.py @@ -26,6 +26,7 @@ def to_target(self): target = super().to_target() votable_fields = ['RA', 'DEC', 'PMRA', 'PMDEC', 'MAIN_ID', 'MESDISTANCE.dist', 'MESDISTANCE.unit'] result = {} + print(self.catalog_data) for key in votable_fields: if str(self.catalog_data[key.lower()][0]) not in ['--', '']: result[key] = self.catalog_data[key.lower()][0] @@ -36,9 +37,9 @@ def to_target(self): target.pm_dec = result.get('PMDEC') result_id = result.get('MAIN_ID', b'') # Convert Distance to pc - if 'kpc' in result.get('MESDISTANCE.unit').lower(): + if 'kpc' in result.get('MESDISTANCE.unit', '').lower(): target.distance = result.get('MESDISTANCE.dist') * 1000 - elif 'mpc' in result.get('MESDISTANCE.unit').lower(): + elif 'mpc' in result.get('MESDISTANCE.unit', '').lower(): target.distance = result.get('MESDISTANCE.dist') * 1000000 else: target.distance = result.get('MESDISTANCE.dist') From 8471e6c31bad6bb6f889ad3f9df8b1116b7d3b23 Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Thu, 6 Feb 2025 11:03:43 -0800 Subject: [PATCH 2/2] remove print --- tom_catalogs/harvesters/simbad.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tom_catalogs/harvesters/simbad.py b/tom_catalogs/harvesters/simbad.py index 16616bd2..2f0167f7 100644 --- a/tom_catalogs/harvesters/simbad.py +++ b/tom_catalogs/harvesters/simbad.py @@ -26,7 +26,6 @@ def to_target(self): target = super().to_target() votable_fields = ['RA', 'DEC', 'PMRA', 'PMDEC', 'MAIN_ID', 'MESDISTANCE.dist', 'MESDISTANCE.unit'] result = {} - print(self.catalog_data) for key in votable_fields: if str(self.catalog_data[key.lower()][0]) not in ['--', '']: result[key] = self.catalog_data[key.lower()][0]