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

Switch from intelligent save to intelligent load #697

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Switch from intelligent save to intelligent load #697

merged 3 commits into from
Dec 11, 2024

Conversation

coretl
Copy link
Collaborator

@coretl coretl commented Dec 6, 2024

Fixes #16

@coretl coretl requested a review from olliesilvester December 6, 2024 17:11
@coretl coretl force-pushed the load-save branch 4 times, most recently from c47998c to 1e0a320 Compare December 9, 2024 10:38
@coretl coretl marked this pull request as ready for review December 9, 2024 10:47
Use the concept of Settings that can be:
- Created from a Device
- Stored to YAML
- Retrieved from YAML
- Added to other Settings
- Applied to a Device
Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really neat! Most of my comments are just to help with readability

src/ophyd_async/core/_settings.py Show resolved Hide resolved
src/ophyd_async/core/_settings.py Outdated Show resolved Hide resolved
src/ophyd_async/core/_settings.py Show resolved Hide resolved
src/ophyd_async/core/_settings.py Outdated Show resolved Hide resolved
src/ophyd_async/plan_stubs/_panda.py Outdated Show resolved Hide resolved
src/ophyd_async/plan_stubs/_wait_for_one.py Outdated Show resolved Hide resolved
src/ophyd_async/plan_stubs/_settings.py Show resolved Hide resolved
src/ophyd_async/plan_stubs/_settings.py Show resolved Hide resolved
src/ophyd_async/plan_stubs/_settings.py Show resolved Hide resolved
src/ophyd_async/plan_stubs/_settings.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@olliesilvester
Copy link
Contributor

It would also be a good idea to test this on a real PandA before merging

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on slack, after testing this on a real panda, it seems like panda.children() only gives the children for the blocks which have been type hinted. This means that anything outside of the signals in

class CommonPandaBlocks(Device):
    pulse: DeviceVector[PulseBlock]
    seq: DeviceVector[SeqBlock]
    pcomp: DeviceVector[PcompBlock]
    pcap: PcapBlock
    data: DataBlock

don't get saved

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@coretl
Copy link
Collaborator Author

coretl commented Dec 11, 2024

As discussed on slack, after testing this on a real panda, it seems like panda.children() only gives the children for the blocks which have been type hinted.

This is resolved as discussed offline

@coretl coretl changed the title Load save Switch from intelligent save to intelligent load Dec 11, 2024
@coretl coretl merged commit e27b6d7 into main Dec 11, 2024
22 checks passed
@coretl coretl deleted the load-save branch December 11, 2024 16:16
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

Successfully merging this pull request may close these issues.

Add save/load
2 participants