pcdshub / transfocate

Automated calculation of beryllium lens focusing optics
https://pcdshub.github.io/transfocate
Other
1 stars 7 forks source link

ENH: added constant energy wrapper #37

Closed jsheppard95 closed 6 years ago

jsheppard95 commented 6 years ago

Added constant_energy(func) wrapper function to transfocator.py that will be applied to the calculator function later. constant_energy() checks the req_energy PV before and after the execution of func() (later will be a calculation function) and ensures that the PV did not change during execution. Also added two testing functions to tests/test_transfocate.py: test_constant_energy_no_change() and test_constant_energy_with_change() that test the wrapper using functions (taking the place of func()) that either do or do not modify the req_energy pv.

Closes #34

ZLLentz commented 6 years ago

Sorry that this is still failing on pcdsdevices import, I'll tag before I leave for the day

teddyrendahl commented 6 years ago

@jsheppard95 closing and opening to restart tests with new version of pcdsdevices

codecov-io commented 6 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@70dbd6b). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #37   +/-   ##
=========================================
  Coverage          ?   94.94%           
=========================================
  Files             ?        3           
  Lines             ?      198           
  Branches          ?        0           
=========================================
  Hits              ?      188           
  Misses            ?       10           
  Partials          ?        0
Impacted Files Coverage Δ
transfocate/transfocator.py 95.74% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 70dbd6b...ebcb137. Read the comment docs.