ni / ni/nidaqmx-python

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

Open
#165 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
592
Forks
199
Avg merge
1d 16h
Merged PRs (30d)
10

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided Python/IPython session and compare task.timing.cfg_samp_clk_timing? before and after task.start(). Start at the cfg_samp_clk_timing API entry point and the help/introspection path it exposes; done means the same help request works after the task has started without leaving a subprocess running.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.