Exopy / exopy_hqc_legacy

Transition package to smooth transition from HQCMeas to Exopy.
BSD 3-Clause "New" or "Revised" License
0 stars 10 forks source link

Fail the measurement when InstrJob timeout #62

Open lcontami opened 4 years ago

lcontami commented 4 years ago

I did not stop the measurement stopping in the InstrJob for two reasons;

In the end it seemed more logical to me to stop the measurement in the Task when the job fails rather than in the Job itself, but feel free to change if you want.

lcontami commented 4 years ago

I tried to integrate your TimeOut again, not very clear to me what stops the measurement when a stop signal is manually sent but what I was aiming at is:

if timeout, then stop the sweep and turn off sw heater, return a ValueError if the measure is manually stopped, stop and do nothing more

lcontami commented 4 years ago

Did not look at Travis error yet...

MatthieuDartiailh commented 4 years ago

Why don't you want to close the switch heater when the user interrupt the scan ?

Once again my argument about cancel is not about whether or not to close the switch in the context of this particular case, but that more generally stopping a field sweep does not necessarily imply that the switch heater should be closed.

At the beginning of each task (if the feature has not been disabled) the should_stop event is checked and if set the execution abort, this quickly lead to stopping the measurement.

lcontami commented 4 years ago

If the idea of closing the sw heater is to save He when the measurement stop by itself overnight, this is not necessary if I am in front of the computer and I am stopping the measurement. Besides, turning off the sw heater takes some time which is annoying

lcontami commented 4 years ago

Honestly Madar I am lost between all these comments, I don't understand what is bothering you but I really don't have a strong opinion on how the code is organised. I just have an opinion on how the measurement should behave so if you want to or want me to move some bits around tell me as long as the behavior stays the same.

MatthieuDartiailh commented 4 years ago

I get your argument for not closing the switch heater after a manual stop. Currently there is one issue I believe: when stopping the measurement the job will return false but since it it not cancelled the magnet will keep ramping which seems surprising.

To fix that I believe no matter the reason we stop waiting for you should cancel the job. However cancelling should leave the switch heater alone and you could deal with the switch only in the case of a timeout.

For the test I left a comment.

lcontami commented 4 years ago

Thanks, I had not realized I had indeed changed the way a measurement stop was handled, in a bad manner. Tell me if what I have proposed suits you, I have edited mainly the InstrJob but I can also put these edits in the task if you think it best. Correct me if I'm wrong but when the measurement has been stopped manually I don't need to write self.root.should_stop.set() since it is already.

Unfortunately the fridge is not cold anymore so I won't be able to test this code...

lcontami commented 4 years ago

This does not work anymore... When the measurement is manually stopped the sweep stops (activity = 'Hold') but the measurement stays in "stopping" and does not stop.

MatthieuDartiailh commented 4 years ago

Do you have a log, config file or something similar I could look at ?