I found that the is_association function of stdatamodels.jwst.datamodels.util checks if an object is an association based on the fact that it is a dict. However, the association created by jwst.associations.asn_from_list.asn_from_list by default is not a dict but jwst.associations.lib.rules_level3_base.DMS_Level3_Base. This would cause a problem when creating a ModelContainer from a DMS_Level3_Base association.
I found that the
is_association
function ofstdatamodels.jwst.datamodels.util
checks if an object is an association based on the fact that it is adict
. However, the association created byjwst.associations.asn_from_list.asn_from_list
by default is not adict
butjwst.associations.lib.rules_level3_base.DMS_Level3_Base
. This would cause a problem when creating a ModelContainer from aDMS_Level3_Base
association.https://github.com/spacetelescope/stdatamodels/blob/49955c01d2e353edd16b95f3cb465e582a6b7b37/src/stdatamodels/jwst/datamodels/util.py#L387
Here is the code to reproduce this problem.
But it works if bypassing the
is_association
check.