Skip to content

Consider making nodes public #557

@braingram

Description

@braingram

@schlafly asked about saving a datamodel to an ASDF file. The following does not work:

>> import roman_datamodels.datamodels as rdm
>> m = rdm.ImageModel.create_fake_data()
>> import asdf
>> af = asdf.AsdfFile({"foo": m})
>> af.validate()
ValidationError: <roman_datamodels.datamodels._datamodels.ImageModel object at 0x1091d78f0> is not of type 'object'

Failed validating 'type' in schema:

and instead the saving the node is required:

>> af = asdf.AsdfFile({"foo": m._instance})
>> af.validate()

However _instance is not public.

This seems like a useful pattern to support with public API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions