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

added indexing to handle tuple #468

Merged
merged 6 commits into from
May 31, 2024
Merged

added indexing to handle tuple #468

merged 6 commits into from
May 31, 2024

Conversation

ZohebShaikh
Copy link
Contributor

@ZohebShaikh ZohebShaikh commented May 17, 2024

closes #444

With PR for dodal at DiamondLightSource/dodal#550

@ZohebShaikh
Copy link
Contributor Author

The tests are failing now because it is testing it with the old version of dodal

@ZohebShaikh ZohebShaikh marked this pull request as ready for review May 17, 2024 07:35
Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

Tests would be useful, even they are just copy/pastes of the dodal tests for now, we can work on consolidation later.

src/blueapi/core/context.py Outdated Show resolved Hide resolved
Comment on lines 111 to 114
for device in devices.values():
self.device(device)

num_failed = len(exceptions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we register devices that had exceptions?

Copy link
Contributor

Choose a reason for hiding this comment

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

exceptions is literally a dictionary of str -> Exception rather than str -> Device. There is nothing to register.

Copy link
Contributor

Choose a reason for hiding this comment

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

Has the signature of make_all_devices changed? Seems it used to return dict[str, Device] but now returns tuple[dict[str, Device], dict[str, Exception]]?

Copy link
Contributor

Choose a reason for hiding this comment

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

It changes in the corresponding dodal PR, see description: DiamondLightSource/dodal#550

@callumforrester
Copy link
Contributor

Tests will pass following a dodal release

Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.46%. Comparing base (dbe9634) to head (b695858).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   90.43%   90.46%   +0.02%     
==========================================
  Files          40       40              
  Lines        1694     1699       +5     
==========================================
+ Hits         1532     1537       +5     
  Misses        162      162              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# If exceptions have occurred, we log them but we do not make blueapi
# fall over
if len(exceptions) > 0:
LOGGER.warning(f"{len(exceptions)} device(s) failed to connect")
Copy link
Contributor

@DiamondJoseph DiamondJoseph May 31, 2024

Choose a reason for hiding this comment

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

nit:

Suggested change
LOGGER.warning(f"{len(exceptions)} device(s) failed to connect")
LOGGER.warning(f"{len(exceptions)} exceptions while attempting to connect")

As discussed, any Errors from method signatures also get inserted

@callumforrester callumforrester merged commit 8bb9388 into main May 31, 2024
24 checks passed
@callumforrester callumforrester deleted the connection-resilience branch May 31, 2024 13:46
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.

Don't Fall Over if a Device Does not Connect
3 participants