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

Update fastcs version #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Update fastcs version #10

wants to merge 1 commit into from

Conversation

marcelldls
Copy link
Collaborator

@GDYendell Thoughts? (Especially w.r.t testing)

I would like to create a helper function from test_schema that could be reused by other devices and possibly placed in a fastcs.testing namespace. The only problem is I dont know how to do this with pytest. If I create a helper that does the assert, I seem to lose the dictionary diff capability

@marcelldls marcelldls requested a review from GDYendell December 19, 2024 13:46
@marcelldls marcelldls marked this pull request as draft December 19, 2024 13:46
@@ -140,7 +140,7 @@ async def update(
try:
if self.cache is not None:
response = await self.cache.get_response(
self.update_period,
self.update_period if self.update_period else 0.0,

Choose a reason for hiding this comment

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

An update period of None means this won't be added as a scan task at all! https://github.com/DiamondLightSource/FastCS/blob/main/src/fastcs/backend.py#L130

ref_schema = YAML(typ="safe").load(data / "schema.json")
options_model = _extract_options_model(ThorlabsMFF)
target_schema = options_model.model_json_schema()
assert ref_schema == target_schema

Choose a reason for hiding this comment

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

This looks good. You are probably going to want a convenient way to regenerate the checked in schema, like a vscode task, or a script. pvi does the latter https://github.com/epics-containers/pvi/blob/main/tests/regenerate_test_output.sh

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.

2 participants