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

Upgrade specutils and astropy dependencies for python > 3.10 #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

noahfranz13
Copy link

Hi datalab core developers!

I am working on a package and want to use the datalab queryClient but have been finding the astropy requirements to be too strict for my use case. For example, the astropy affiliated synphot package requires astropy >= 6.1 while the datalab package couldn't have astropy>=5.4.

I investigated this a little and I think the reasons for these constraints was because astropy changed their API for the VOTable so the tests for the helper.util.convert method were failing and because the specutils was not allowing astropy>6 until recently. After installing the newer version of specutils and astropy and fixing the test cases for this package I think everything still appears stable (at least all of the unit tests pass and my code using the queryClient works still!).

But, I know I may be missing something here for why the astropy version requirement was so strict previously. I look forward to your feedback and working with you on this!

@noahfranz13 noahfranz13 mentioned this pull request Jul 7, 2024
4 tasks

# astropy changed stuff with the votable in version 6.0.0
# https://github.com/astropy/astropy/blob/main/CHANGES.rst#astropyiovotable-3
if astropy.__version__ >= '6.0.0':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi ! Astropy dev here.
Note that comparing version strings directly doesn't work as you'd expect and is not recommended

>>> '10.0.0' > '2.0.0'
False

Fortunately, astropy provides a more robust way to implement this:
using

from astropy.utils import minversion
ASTROPY_GE_6_0 = minversion("astropy", "6.0.0")

you can rewrite this conditional as

Suggested change
if astropy.__version__ >= '6.0.0':
if ASTROPY_GE_6_0:

@chaduhduh chaduhduh added the question Further information is requested label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants