load_asn¶
-
jwst.associations.load_asn(serialized, format=None, first=True, validate=True, registry=<class 'jwst.associations.registry.AssociationRegistry'>, **kwargs)[source]¶ Load an Association from a file or object
Parameters: - serialized (object) – The serialized form of the association.
- format (str or None) – The format to force. If None, try all available.
- validate (bool) – Validate against the class’ defined schema, if any.
- first (bool) – A serialization potentially matches many rules. Only return the first succesful load.
- registry (AssociationRegistry or None) – The
AssociationRegistryto use. If None, no registry is used. Can be passed just a registry class instead of instance. - kwargs (dict) – Other arguments to pass to the
loadmethods defined in theAssociation.IORegistry
Returns: Return type: The Association object
Raises: AssociationNotValidError– Cannot create or validate the association.Notes
The
serializedobject can be in any format supported by the registered I/O routines. For example, forjsonandyamlformats, the input can be either a string or a file object containing the string.If no registry is specified, the default
Association.loadmethod is used.