-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nonetype Entires Break Individual Image Metadata #406
Comments
Thanks, this is important. We should review what fields currently allow Nones that go into the individual image metadata. |
What do folks think about using a list (or dict) of dicts instead of a table for the individual metadata? Something like: level_2_metadata = []
for level_2_model in level_2_models:
# do stuff with model (resample, etc)
level_2_metadata.append(dict(level_2_model.meta))
level_3_model.meta.level_2_metadata = level_2_metadata The schemas aren't quite organized in a way that would easily allow reuse of just the level_2_metadata:
type: array
items:
$ref: level_2_metadata |
The alternative proposal we had once discussed was for this to be a list of the input L2 metadata; i.e., essentially what you have without the dict() wrapping the level_2_model. The tables are a quality of life improvement over that, but have been more maintenance. Is your objective here primarily to remove the astropy tables as potentially problematic for archiving, to make the code more robust, or something else? |
Thanks! I was mainly asking since the current metadata is quite nested and rich (with custom objects). Mapping this to a table loses this structure. For a user I'm not sure which is more convenient/useful. If they're used to level 2 metadata in level 2 files the table structure would be different. For developers, maintaining 2 structure seems more work than 1 (referenced twice). If the tables are primarily for users one option might be to make a helper function that takes a list of metadata and produces a table. That would remove the need for a schema to define this table and allow the pipeline to accumulate metadata with little more than an |
We decided on a table, because we wanted for an easy structure for users to be able to sort on whichever columns they want and see related data. This was viewed as more important than preserving any nesting. |
Proposal: somewhere around here roman_datamodels/src/roman_datamodels/datamodels/_datamodels.py Lines 97 to 100 in 053b844
replace None values with a valid null type / default value.
|
None
values in Metadata can cause validation errors:Multiple files then added into a mosaic via:
wfi_mosaic_model.append_individual_image_meta(wfi_imageX.meta)
Then trying to validate:
wfi_mosaic_model.validate()
Yields:
The text was updated successfully, but these errors were encountered: