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

Convert magnet to use pydantic model #104

Merged
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6c09845
magnets and screen conversion from csv to dictionary structures worki…
MattKing06 Oct 19, 2023
eb6035d
add functionality for extracting multiple areas at once
MattKing06 Oct 20, 2023
f67780a
add PVs to yaml magnets extraction
MattKing06 Oct 20, 2023
6e7e844
removing unneeded file
Oct 20, 2023
7cabe21
Merge branch 'main' of https://github.com/slaclab/lcls-tools into 92_…
Oct 20, 2023
49f6638
working on adding image pvs to yaml files
Oct 21, 2023
55ea490
working on image device code
nneveu Oct 23, 2023
ef18291
Merge remote-tracking branch 'slaclab/main' into 92_automatic_yaml_ge…
Oct 23, 2023
265e8de
Merge branch '92_automatic_yaml_generation' of https://github.com/Mat…
Oct 23, 2023
61aaf98
flake8 and black formatting
Oct 23, 2023
fc56656
make construction function self, add error handling for MEME timeout
Oct 24, 2023
cc6aef5
formatting
Oct 24, 2023
c20d114
make area a list in screens
Oct 24, 2023
2640fbf
add pv_info to screen construction
Oct 24, 2023
62b7f9a
restrict wildcard search in meme
Oct 24, 2023
21b2979
added models for magnet and associated fields
Oct 30, 2023
8234e57
Merge branch 'main' into 100_convert_magnet_to_use_pydantic_model
Nov 1, 2023
8b39ec4
Merge branch 'main' into 100_convert_magnet_to_use_pydantic_model
Nov 1, 2023
ddb82d8
start to move magnet functions over to pydantic model
Nov 1, 2023
324f527
magnet pydantic model working with reader now
Nov 2, 2023
c3bf551
updated yaml test files to reflect new yaml for devices
Nov 2, 2023
eeac14d
magnet and reader tests up to date with pydantic changes, minimal fun…
Nov 2, 2023
1faa869
make MagnetPVSet have frozen attributes.#
Nov 2, 2023
c8ca6b1
make MagnetPVSet have frozen attributes.
Nov 2, 2023
f9752b5
frozen for controls_information base class
Nov 2, 2023
4e40d49
missed return for area property!
Nov 2, 2023
4f56c47
add setter for bdes
Nov 2, 2023
a302af0
working on being able to set bdes values for several mags
nneveu Nov 2, 2023
bfd92ff
find file by area in reader
Nov 2, 2023
8573c33
use area over location for scope
Nov 2, 2023
4997a15
change yaml path.
Nov 2, 2023
94cbd27
remove path
Nov 2, 2023
3e2caed
first attempt at function to scan mags
nneveu Nov 3, 2023
611f6f0
magnet and device now using pydantic model
Nov 6, 2023
6b5a4a6
tests reflect model changes, need to check coverage
Nov 6, 2023
99d0a47
add check for function in scan
Nov 7, 2023
8b957b0
remove custom exception, pydantic handles mandatory information now
Nov 7, 2023
00f62d6
coverage up to 100% for each new class now
Nov 7, 2023
0dff20f
formatting
Nov 7, 2023
baba392
add pydantic to requirements
Nov 7, 2023
93c5d3c
remove superceeded yaml
Nov 7, 2023
7bd449f
add comments for units in tolerance/length
Nov 7, 2023
6ed29da
add comment explaining adding name for device here
Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add check for function in scan
matt authored and matt committed Nov 7, 2023
commit 99d0a478d8a1b9afa68d6f1b5b239da0766b7575
11 changes: 8 additions & 3 deletions lcls_tools/common/devices/magnet/magnet.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,12 @@
SerializeAsAny,
field_validator,
)
from typing import Dict, Optional, Union
from typing import (
Dict,
List,
Optional,
Union,
)
from lcls_tools.common.devices.device import (
Device,
ControlInformation,
@@ -202,7 +207,7 @@ def set_bdes(self, magnet_dict: Dict[str, float]):
f"{magnet} was not set to {bval}.",
)

def scan(self, scan_settings: [Dict[str, float]], function: Optional[callable]):
def scan(self, scan_settings: List[Dict[str, float]], function: Optional[callable] = None):
for setting in scan_settings:
self.set_bdes(setting)
function()
function() if function else None