Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first_samp_timestamp_val property does not work because LibraryInterpreter is missing a method #639

Open
bkeryan opened this issue Oct 3, 2024 · 2 comments
Labels

Comments

@bkeryan
Copy link
Collaborator

bkeryan commented Oct 3, 2024

The nidaqmx.Timing.first_samp_timestamp_val property does not work because LibraryInterpreter is missing the get_timing_attribute_timestamp method.

>>> t = nidaqmx.Task()
>>> t.timing.first_samp_timestamp_val
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\dev\nidaqmx-python\generated\nidaqmx\task\_timing.py", line 424, in first_samp_timestamp_val
    val = self._interpreter.get_timing_attribute_timestamp(self._handle, 0x313a)
AttributeError: 'LibraryInterpreter' object has no attribute 'get_timing_attribute_timestamp'

Workaround: use task.wait_for_valid_timestamp(TimestampEvent.FIRST_SAMPLE) to get the timestamp.

@bkeryan bkeryan added the bug label Oct 3, 2024
@bkeryan
Copy link
Collaborator Author

bkeryan commented Oct 3, 2024

@zhindes @WayneDroid We should have added a test for this in #592 . Is there any reason we didn't?

Also, I think mypy would have caught this if the constructor arguments in https://github.com/ni/nidaqmx-python/blob/c09f2e286b8486272086d96f6a9846b20fa14520/generated/nidaqmx/task/_timing.py had type hints. We should try adding them, and if that enables mypy to catch errors like this, we should add these type hints to all of the subobject classes.

@WayneDroid
Copy link
Collaborator

@zhindes @WayneDroid We should have added a test for this in #592 . Is there any reason we didn't?

Also, I think mypy would have caught this if the constructor arguments in https://github.com/ni/nidaqmx-python/blob/c09f2e286b8486272086d96f6a9846b20fa14520/generated/nidaqmx/task/_timing.py had type hints. We should try adding them, and if that enables mypy to catch errors like this, we should add these type hints to all of the subobject classes.

I can't recall why no test case added for those properties, maybe overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants