Skip to content

added indexing to handle tuple - #468

Merged
callumforrester merged 6 commits into
mainfrom
connection-resilience
May 31, 2024
Merged

callumforrester merged 6 commits into
mainfrom
connection-resilience

Conversation

@ZohebShaikh

@ZohebShaikh ZohebShaikh commented May 17, 2024 •

Copy link
Copy Markdown
Contributor

closes #444

With PR for dodal at DiamondLightSource/dodal#550

@ZohebShaikh

Copy link
Copy Markdown
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

@callumforrester callumforrester left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/blueapi/core/context.py Resolved
Comment thread src/blueapi/core/context.py Outdated
Comment on lines +111 to +114
for device in devices.values():
self.device(device)

num_failed = len(exceptions)

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Tests will pass following a dodal release

@codecov

codecov Bot commented May 31, 2024 •

Copy link
Copy Markdown

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.

Comment thread src/blueapi/core/context.py Outdated
# 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")

@DiamondJoseph DiamondJoseph May 31, 2024 •

Copy link
Copy Markdown
Contributor

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

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