Skip to content

Commit

Permalink
Ensure copy of ACATable is a deep copy
Browse files Browse the repository at this point in the history
Previously astropy Table was making a deep copy
of meta attributes but this changed for improved
efficiency.
  • Loading branch information
taldcroft committed Feb 3, 2020
1 parent 186897d commit accaae9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proseco/catalog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import traceback
import numpy as np
from itertools import count
import copy

from astropy.table import Column, Table

Expand Down Expand Up @@ -190,6 +191,12 @@ class ACATable(ACACatalogTable):
t_ccd_eff_acq = MetaAttribute(is_kwarg=False)
t_ccd_eff_guide = MetaAttribute(is_kwarg=False)

def __copy__(self):
# Astropy Table now does a light key-only copy of the `meta` dict, so
# copy.copy(aca) does not copy the underlying table attributes. Force
# a deepcopy instead.
return copy.deepcopy(self)

@property
def t_ccd(self):
# For top-level ACATable object use the guide temperature, which is always
Expand Down

0 comments on commit accaae9

Please sign in to comment.