nidaqmx-python icon indicating copy to clipboard operation
nidaqmx-python copied to clipboard

ipython task.timing.cfg_samp_clk? help fails after task started

Open ggggggggg opened this issue 2 years ago • 3 comments

Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import nidaqmx as ni 
   ...: import nidaqmx.stream_readers 
   ...: import nidaqmx.constants 
   ...: task = ni.Task() 
   ...: task.ai_channels.add_ai_voltage_chan('Dev1/ai0') 
   ...: task.timing.cfg_samp_clk_timing(rate=10000, source="OnboardClock",  
   ...: sample_mode=nidaqmx.constants.AcquisitionType.CONTINUOUS) 
   ...: reader =  ni.stream_readers.AnalogMultiChannelReader(task.in_stream) 
   ...: task.start() 
   ...:                                                                         

In [2]: task.timing.cfg_samp_clk_timing?                                        
/usr/lib/python3.8/subprocess.py:946: ResourceWarning: subprocess 265146 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Using the help works at any point before calling task.start() in the above example. It should keep working after as well.

ggggggggg avatar Mar 30 '22 22:03 ggggggggg

I suspect this is related to #161, but we haven't had a chance to figure that one out, yet.

zhindes avatar Mar 31 '22 14:03 zhindes

It doesn't seem like asking for help should be calling out to subprocess, just looking up something in a dict.

ggggggggg avatar Mar 31 '22 16:03 ggggggggg

This may be related to the fact that nidaqmx changes the global warning filter to enable ResourceWarning: #325

bkeryan avatar Jan 18 '24 14:01 bkeryan