question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please test against astropy v5.2rc1 and report back

See original GitHub issue

Hello. astropy v5.2rc1 is out. Please test against it and report back success or failure before v5.2 is really released. Thank you for your help!

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
barentsencommented, Dec 7, 2022

But just to double check, does this use the new “cloud FITS” feature that you added to astropy recently?

At this time Lightkurve only uses the MAST TessCut API via Astroquery, so it does not directly depend on “cloud FITS” yet.

(But it could be a great performance improvement in the future!)

0reactions
bmorris3commented, Dec 21, 2022

Not sure if this is related or not, but using astropy 5.2 and lightkurve 2.3, I’m trying to do a simple median on the flux:

from lightkurve import search_lightcurve

name = "KIC 8006161"

light_curve = search_lightcurve(
    name, mission='Kepler',
    cadence='short'
).download_all()
np.median(light_curve[0].flux)

which returns

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [4], line 1
----> 1 np.median(light_curve[0].flux)

File <__array_function__ internals>:200, in median(*args, **kwargs)

File ~/miniconda3/envs/research/lib/python3.9/site-packages/astropy/units/quantity.py:1818, in Quantity.__array_function__(self, function, types, args, kwargs)
   1805 # A function should be in one of the following sets or dicts:
   1806 # 1. SUBCLASS_SAFE_FUNCTIONS (set), if the numpy implementation
   1807 #    supports Quantity; we pass on to ndarray.__array_function__.
   (...)
   1815 # function is in none of the above, we simply call the numpy
   1816 # implementation.
   1817 if function in SUBCLASS_SAFE_FUNCTIONS:
-> 1818     return super().__array_function__(function, types, args, kwargs)
   1820 elif function in FUNCTION_HELPERS:
   1821     function_helper = FUNCTION_HELPERS[function]

File ~/miniconda3/envs/research/lib/python3.9/site-packages/astropy/utils/masked/core.py:864, in MaskedNDArray.__array_function__(self, function, types, args, kwargs)
    862 dispatched_function = DISPATCHED_FUNCTIONS[function]
    863 try:
--> 864     dispatched_result = dispatched_function(*args, **kwargs)
    865 except NotImplementedError:
    866     return self._not_implemented_or_raise(function, types)

File ~/miniconda3/envs/research/lib/python3.9/site-packages/astropy/utils/masked/function_helpers.py:592, in median(a, axis, out, **kwargs)
    590 if NUMPY_LT_1_25:
    591     keepdims = kwargs.pop("keepdims", False)
--> 592     r, k = np.lib.function_base._ureduce(
    593         a, func=_masked_median, axis=axis, out=out, **kwargs
    594     )
    595     return (r.reshape(k) if keepdims else r) if out is None else out
    597 else:

File ~/miniconda3/envs/research/lib/python3.9/site-packages/astropy/units/quantity.py:1255, in Quantity.__iter__(self)
   1253 def __iter__(self):
   1254     if self.isscalar:
-> 1255         raise TypeError(
   1256             f"'{self.__class__.__name__}' object with a scalar value is not"
   1257             " iterable"
   1258         )
   1260     # Otherwise return a generator
   1261     def quantity_iter():

TypeError: 'MaskedQuantity' object with a scalar value is not iterable

This can be avoided if you intentionally dodge the astropy.utils.masked.Masked object like this:

np.nanmedian(light_curve[0].flux.unmasked)

which returns the expected result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

v5.2rc1 astropy.test also runs tests in astropy.extern if installed ...
Also, I am curious, do the tests still fail if you run the two different test suites back to back but in some...
Read more >
Known Issues — Astropy v5.2
Issues listed on this page are grouped into two categories: The first is known ... This also includes cases where the test suite...
Read more >
astropy v5.1rc1 ready for testing - Google Groups
Hi everyone, The first release candidate (RC) of the core astropy package for the v5.1 release is now available and ready for testing!...
Read more >
List of supported software - EasyBuild documentation
A software package for algebraic, geometric and combinatorial problems on linear ... The Astropy Project is a community effort to develop a single...
Read more >
Installation — Astropy v1.0.4
Binary installers are available on Windows for Python 2.6, 2.7, and >= 3.3 at PyPI. Testing an installed Astropy¶. The easiest way to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found