ni / ni/nimi-python

convert_timedelta_to_milliseconds_int32 internally assumes int32 input would be in seconds

Open
#2,148 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen enhancement
Dominant language
Python
Stars
128
Forks
110
Avg merge
5d 14h
Merged PRs (30d)
10

Description

Description of issue

convert_timedelta_to_milliseconds_int32 internally calls into _convert_timedelta with a scaling factor of 1000. This assumes that a float input will always be in seconds. ie if I pass 10 to this method, it returns 10000 as the converted value in millisecond. This makes it not useful for an API method parameter which takes in value as milliseconds and should allow the value to be passed as raw milliseconds along with hightime.timedelta type.

Because of this issue, below API methods would get passed a wrong milliseconds value if the user passes a float value in milliseconds based on the parameter documentation:

  • nidmm
    • fetch
    • fetch_multi_point
    • fetch_waveform
    • fetch_waveform_into
    • read
    • read_multi_point
    • read_waveform
  • nifgen
    • wait_until_done
  • nirfsg
    • wait_until_settled
  • nise
    • wait_for_debounce
  • niswitch
    • wait_for_debounce
    • wait_for_scan_complete
System report

NA

Steps to reproduce issue

NA

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

Start by tracing convert_timedelta_to_milliseconds_int32 and its call to _convert_timedelta, then inspect the listed nidmm, nifgen, nirfsg, nise, and niswitch methods that accept millisecond values. Verify the behavior for integer, float, and hightime.timedelta inputs, and consider the issue done when documented millisecond values are converted consistently across all affected APIs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.