pcdshub / pcdsdaq

Utilities for using the DAQ's pydaq, pycdb, and pyami libraries in conjunction with Bluesky
https://pcdshub.github.io/pcdsdaq
Other
0 stars 9 forks source link

FIX: move warning to class instantiation #11

Closed ZLLentz closed 6 years ago

ZLLentz commented 6 years ago

Motivation and Context

This warning fires every time we import daq.py, even if it's an incidental import that doesn't make a Daq object. I think this warning is important, but I don't think it should run on import.

An interesting side effect is that we don't get the warning if we've acknowledged the lack of pydaq by setting up the sim daq.

codecov-io commented 6 years ago

Codecov Report

Merging #11 into master will increase coverage by 0.55%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   98.89%   99.44%   +0.55%     
==========================================
  Files           2        2              
  Lines         362      362              
==========================================
+ Hits          358      360       +2     
+ Misses          4        2       -2
Impacted Files Coverage Δ
pcdsdaq/daq.py 99.69% <100%> (+0.61%) :arrow_up:

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 63d3185...94cc0e7. Read the comment docs.

teddyrendahl commented 6 years ago

Thoughts on updating to a full error? You should never be instantiating a read DAQ object without pydaq? In fact why not just import pydaq in the class and we'll raise an ImportError there?

ZLLentz commented 6 years ago

Good point, the warning made sense when it was on import but now you really want to know if your class is broken or not