-
Notifications
You must be signed in to change notification settings - Fork 3
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
ENH: add restore functionality to snapshot restore page #97
ENH: add restore functionality to snapshot restore page #97
Conversation
17e9d3b
to
50d03fb
Compare
Dialog shows table of PV names and values to be restored. Rows can be removed, but currently can't be added. Dialog appears to only close when PVs are done being written.
If a PV appears in the demo fixture entries multiple times, the IOC will hold the last value.
50d03fb
to
687802d
Compare
|
||
@staticmethod | ||
def prepare_attrs(entries: Iterable[Entry]) -> Mapping[str, pvproperty]: | ||
def prepare_attrs(entries: Iterable[Entry], client: Client) -> Mapping[str, pvproperty]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'm on board with requiring the IocFactory
to also be passed a client, when all it's doing is gathering leaf entries. That means if we want to use this elsewhere, we need to construct a valid Client
with a backend that holds the entries.
I know it's a bit repetitious, but here I think it could be justified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it either. I don't mind re-implementing the gather method if we have to, but the entries being passed had UUID children that needed to be resolved. I can look into why the UUIDs were swapped in, but lazy loading feels like it's causing duplicate code in multiple places, and maybe we should revisit its implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 100%. I think throughout the UI it's not unreasonable to expect the client to exist, and call its .fill()
method or something similar. (Maybe we add a filled=True
optional argument to Client.search()
or something as well)
I think in the test suite unless elsewise specified it's ok to have all the Entry's be filled. I think if you ever use the Filestore backend you'll end up getting lazy Entry
's
close() allows the garbage collector to manage cleanup, and the change doesn't affect performance to the user
Description
Motivation and Context
Restoring snapshots and other sets of values are a core feature of the application.
A dialog represents an action being configured and then activated, so I've used it to coordinate the restore action for now. Alternatives include filtering the
RestorePage
main PV table, but this could muddy the app's state in the mind of the user unless it's done well.PVs can be removed from the restore dialog, but currently not added in. This covers cases where a whole or partial
Snapshot
needs to be restored, but not multipleSnapshot
s or cases where the user accidentally removes a PV. This is an acceptable first pass while the dialog / restore page continue to be developed.An alternative is to replace the "Remove" push button with a radio button that marks the PV as active or inactive: inactive PVs would stay in the dialog table but only active PVs would be included in the restore. This is an easy way to make PVs re-includable, but may be visually busy for large snapshots. This method also lends itself to being used in the main table, obviating the need for a dialog at all.
How Has This Been Tested?
Interactively:
superscore demo
RestorePage
PV tableA second "linac" snapshot with different values has been added for comparing to the original snapshot.
I also added two test cases in
test_page.py
.Where Has This Been Documented?
Screenshots (if appropriate):
Restore page before restore:
Restore dialog:
Restore page after restore:
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page