Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Should mandatory Entries be enforced? #244

Open
tangkong opened this issue May 11, 2022 · 0 comments
Open

Should mandatory Entries be enforced? #244

tangkong opened this issue May 11, 2022 · 0 comments

Comments

@tangkong
Copy link
Contributor

Expected Behavior

I'd normally expect mandatory fields to be mandatory on item/device instantiation

In [29]: class SubItem(HappiItem):
    ...:     needed = EntryInfo('attr', optional=False, enforce=str)
    ...: 

In [30]: subitem = SubItem()

< Some exception about missing the 'needed' information > 

Current Behavior

Currently "mandatory" (read optional=False) attributes/entries in a HappiItem are only enforced upon insertion through the CLI

I suppose this makes sense if the point of access is always the CLI, but if someone makes an entry interactively from Python (or is following the documentation's examples), this kwarg seems like a noop

Possible Solution

Be more consistent with complaining about missing, mandatory information?

Context

Briefly discussed during the 2022 Epics Codeathon, but put aside.

Your Environment

pcds-5.3.1

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

No branches or pull requests

1 participant