Closed taldcroft closed 4 years ago
Thanks @taldcroft . This helps. My brain is still trying to wrap around the bootstrapping it was doing before. I see you've added a test; does that wrap up the action items?
The FidTable
class was getting the allowed_kwargs
attribute as a reference from the base ACACatalogTable
. When a MetaAttribute
or AliasAttribute
attribute is defined, it puts that name into allowed_kwargs
. Now FidTable
has a t_ccd
property, but in set_attrs_from_kwargs
it was only checking allowed_kwargs
to see if a kwarg t_ccd
could be passed into __init__
. So when you only import fid.py
there was no t_ccd
in allowed_kwargs
. BUT, if you imported acq.py
first, the AcqTable
has a t_ccd
AliasAttribute
and that put t_ccd
into the base allowed_kwargs
, at which point the t_ccd
property setter could be called.
Yup, it is a bit twisted.
Description
This fixes #330, primarily by 82b3910 which allows setting something that is a class property even if it is not in the
allowed_kwargs
set.However, along the way I discovered a more serious problem which was that the class inheritance from
ACACatalogTable
was re-using (for FidTable and ACATable) the base classallowed_kwargs
. This was the source of the ordering issue in #330 becauseFidTable
was trying to sett_ccd
but relying ont_ccd
showing up inallowed_kwargs
because of importingcatalog
(which definedACACatalogTable
and addedt_ccd
toallowed_kwargs
). So I fixed this problem by making sure each class has a private copy ofallowed_kwargs
.Testing
Fixes #330