Skip to content

Cleanup fluo and add sample shutter#114

Merged
DominicOram merged 6 commits intomainfrom
artemis_779_test_fluo
Jul 17, 2023
Merged

Cleanup fluo and add sample shutter#114
DominicOram merged 6 commits intomainfrom
artemis_779_test_fluo

Conversation

@olliesilvester
Copy link
Contributor

Fixes DiamondLightSource/hyperion#779

To test:
Check new PV names
Check and run new tests

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Some comments in code, otherwise good, thank you!


def sample_shutter(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> Attenuator:
Copy link
Contributor

Choose a reason for hiding this comment

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

Must: Type hint is wrong

Copy link
Contributor

Choose a reason for hiding this comment

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

Should: Can we have a docstring on this too?

Comment on lines +75 to +76
acquire: EpicsSignal = Component(EpicsSignal, "Acquire")
acquire_rbv: EpicsSignalRO = Component(EpicsSignal, "Acquire_RBV")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: You can use EpicsSignalWithRBV for this

def do_start(self) -> Status:
self.erase.put(EraseState.ERASE.value)
status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
# status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: Remove this rather than comment out

Comment on lines 98 to 104
def do_start(self) -> Status:
self.erase.put(EraseState.ERASE.value)
status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
# status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
# GDA code suggests this put does not callback until collection finished, for now just hold on to it
self.acquire_status = self.acquire.set(AcquireState.ACQUIRE.value)
return status
return self.acquire.set(AcquireState.ACQUIRE.value)

def arm(self) -> Status:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: I think we can just combine these two methods

self.erase.put(EraseState.ERASE.value)
status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
# status = self.channel_1.update_arrays.set(AcquireState.DONE.value)
# GDA code suggests this put does not callback until collection finished, for now just hold on to it
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 discovered on the beamline that this comment is wrong

arm_status = await_value_in_list(self.detector_state, self.detector_busy_states)
return arm_status
arm_status &= self.do_start()
arm_status.wait(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: Would be nice to pull this timeout into a constant

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #114 (943d996) into main (00872ca) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 943d996 differs from pull request most recent head 2dbcb05. Consider uploading reports for the commit 2dbcb05 to get more accurate results

@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   90.00%   90.11%   +0.11%     
==========================================
  Files          58       58              
  Lines        2010     2004       -6     
==========================================
- Hits         1809     1806       -3     
+ Misses        201      198       -3     
Impacted Files Coverage Δ
src/dodal/beamlines/i03.py 89.23% <100.00%> (+1.35%) ⬆️
src/dodal/devices/sample_shutter.py 100.00% <100.00%> (ø)
src/dodal/devices/xspress3_mini/xspress3_mini.py 98.50% <100.00%> (-0.09%) ⬇️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@DominicOram DominicOram merged commit 77d9ee6 into main Jul 17, 2023
@DominicOram DominicOram deleted the artemis_779_test_fluo branch July 17, 2023 16:38
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.

Test fluo optimisation

2 participants