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

Fix C4G error #72

Closed rassouly closed 4 years ago

rassouly commented 4 years ago

I don't fully understand the interaction between @instrument_property and inheritance but copying the getter from the parent class seemed to fix the problem.

This patch fixes the last driver error present when launching exopy on my system.

The call to ask will need to be changed into query once #71 is merged.

MatthieuDartiailh commented 4 years ago

instrument_property behaves like a regular property and there is no way this code ever worked. Your code works, another way to avoid duplicating would be something like:

field_sweep_rate = copy.deepcopy(CS4.field_sweep_rate)

@field_sweep_rate.setter
@secure_communication()
def field_sweep_rate(self, rate):
        # converted from T/min to A/s
        rate /= 60 * self.field_current_ratio
        self.write('RATE 0 {};'.format(rate))

but I am fine with your version. Can you ping anybody in Takis lab to validate this ? not sure @galactikvoyager has time for this.

rassouly commented 4 years ago

I don't think anyone at Takis lab was using this branch because it has been like this for a while. I will try to contact Marius anyways.

MatthieuDartiailh commented 4 years ago

@lcontami has tried several time to do stuff but I forgot how it ended.

rassouly commented 4 years ago

Since I couldn't get anyone in Paris to review this patch, I suggest we merge it now and fix the (potential) bugs later.

MatthieuDartiailh commented 4 years ago

Fair enough. Can you rebase this on top of #71 and use query rather than ask ? I will merge once it is done.

MatthieuDartiailh commented 4 years ago

Could you rebase one last time to clean a bit the history ?

rassouly commented 4 years ago

Should be good to merge now.