fkiwy / Finder_charts

A Python module to create finder charts from image data of various sky surveys
MIT License
2 stars 0 forks source link

Non retrocompatible change to requests causing issue ? #3

Closed jgagneastro closed 3 months ago

jgagneastro commented 3 months ago

I have encountered a problem when trying to run this tutorial segment:

from Finder_charts import create_finder_charts, Crosshair, Survey, Target
from astropy.time import Time
import tempfile

ra, dec = 152.9226066, 28.7632385
pmra, pmdec = -124.825, -713.244
ref_epoch = Time(2016.0, format='jyear')

create_finder_charts(ra, dec, img_size=100, overlays=True, overlay_color='red', dss=True, twomass=True, spitzer=True, wise=True,
                     ukidss=True, uhs=True, vhs=True, vvv=True, viking=True, ps1=True, decam=True, neowise=True, neowise_contrast=5,
                     gaia_images=True, gaia_entries=True, gaia_pm_vectors=True, gaia_pm_years=50, gaia_color='green', targets=None,
                     pmra=pmra, pmdec=pmdec, ref_epoch=ref_epoch, crosshair_type=Crosshair.CROSS_NO_CENTER, propagate_gaia_positions=True,
                     chrono_order=True, object_info=True, directory=tempfile.gettempdir(), cache=True, show_progress=True, timeout=300,
                     open_file=True, file_format='png', save_result_tables=True, result_tables_format='ipac', result_tables_extension='dat')

I am obtaining the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jonathan/Downloads/Finder_charts/Finder_charts.py", line 1563, in create_finder_charts
    finder_charts(ra, dec, targets)
  File "/Users/jonathan/Downloads/Finder_charts/Finder_charts.py", line 590, in finder_charts
    job = Gaia.cone_search_async(coords, radius.to(u.deg))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GaiaClass.cone_search_async() takes 2 positional arguments but 3 were given

The code runs correctly when I just create a finder chart with ra, dec. I suspect this may have been caused by a non retrocompatible change to the requests or astropy package ? Specifying the versions you are supporting explicitly in the setup.py with e.g., astropy==1.something could fix this.

jgagneastro commented 3 months ago

I think I have fixed this with a fresh reinstall of Finder_charts in a new conda environment. I am not sure why it worked out differently the first time around - I think at some point I had installed "requests" with conda after my Finder_charts installation, which might have broken something. Here is the current versions of every package I ended up with in the conda environment where my Finder_charts installation works (the only thing I did was python setup.py install from Finder_charts's current repo, and then conda install pandas for my own use in the same env) :

asciitree==0.3.3
astropy==6.1.1
astropy-iers-data==0.2024.7.8.0.31.19
astropy_healpix==1.0.3
astroquery==0.4.8.dev9321
beautifulsoup4==4.13.0b2
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
contourpy==1.2.1
crc32c==2.4.1
cycler==0.12.1
dask==2024.7.0
donfig==0.8.1.post1
fasteners==0.19
Finder_charts==1.1.0
fonttools==4.53.1
fsspec==2024.6.1
html5lib==1.1
idna==3.7
iniconfig==2.0.0
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.functools==4.0.1
keyring==25.2.1
kiwisolver==1.4.5
locket==1.0.0
matplotlib==3.9.1
more-itertools==10.3.0
numcodecs==0.12.1
numpy==2.0.0
packaging==24.1
pandas @ file:///Users/runner/miniforge3/conda-bld/pandas_1715897635637/work
partd==1.4.2
pillow==10.4.0
pluggy==1.5.0
pyerfa==2.0.1.4
pyparsing==3.1.2
pytest==8.2.2
python-dateutil==2.9.0.post0
pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1706886791323/work
pyvo==1.5.2
PyYAML==6.0.2rc1
reproject==0.13.1
requests==2.32.3
scipy==1.14.0
setuptools==70.1.1
six==1.16.0
soupsieve==2.5
tdqm==0.0.1
toolz==0.12.1
tqdm==4.66.4
typing_extensions==4.12.2
tzdata @ file:///home/conda/feedstock_root/build_artifacts/python-tzdata_1707747584337/work
urllib3==2.2.2
webencodings==0.5.1
wheel==0.43.0
zarr==3.0.0a0
zstandard==0.22.0