USRA-STI / gdt-fermi

Gamma-ray Data Tools - Fermi mission components
Apache License 2.0
2 stars 4 forks source link

Time.gbm_bn does not work in Astropy 6.0 #21

Closed AdamGoldstein-USRA closed 4 months ago

AdamGoldstein-USRA commented 7 months ago

Example:

from gdt.missions.fermi.time import Time
Time.now().gbm_bn

Results in the error

AttributeError: 'GbmBurstNumber' object has no attribute 'mask_if_needed'

This appears to be due to a change in Astropy 6.0. I have verified this works in Astropy 5.2.2.

derekocallaghan commented 7 months ago

Coincidentally I ran into the same issue on Friday. Looking at the astropy commit where mask_if_needed() was removed, in all cases it seems that it should be sufficient to simply remove the calls as done in the astropy.time.formats classes.

Here's my local change in gdt.missions.fermi.time:

137,138c160
<         # TODO mask_if_needed is no longer in astropy, log gdt-fermi issue - return self.mask_if_needed(iterator.operands[-1])
<         return iterator.operands[-1]
---
>         return self.mask_if_needed(iterator.operands[-1])
BillCleveland-USRA commented 4 months ago

The deprecated function was removed on Apr 4, 2024 and was part of the merge to master for the v2.1.0 release.