Skip to content
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

DataModel kwargs documentation does not mention attribute assignment #239

Open
braingram opened this issue Dec 6, 2023 · 0 comments
Open

Comments

@braingram
Copy link
Collaborator

braingram commented Dec 6, 2023

The kwargs documentation for DataModel:

kwargs : dict
Additional keyword arguments passed to lower level functions. These arguments
are generally file format-specific. Arguments of note are:
- FITS
skip_fits_update - bool or None
`True` to skip updating the ASDF tree from the FITS headers, if possible.
If `None`, value will be taken from the environmental SKIP_FITS_UPDATE.
Otherwise, the default value is `True`.
"""

does not mention that providing key-value pairs will result in attribute assignment:

# initialize arrays from keyword arguments when they are present
for attr, value in kwargs.items():
if value is not None:
subschema = properties._get_schema_for_property(self._schema,
attr)
if 'datatype' in subschema:
setattr(self, attr, value)

This is used (see here for one example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant