Skip to content

add clear task method and made close an alias - #1000

Merged
zhindes merged 1 commit into
masterfrom
users/zhindes/clear_task
Aug 3, 2026
Merged

add clear task method and made close an alias#1000
zhindes merged 1 commit into
masterfrom
users/zhindes/clear_task

Conversation

@zhindes

@zhindes zhindes commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator
  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

I had some customer feedback that clear task was more familiar for people coming from other DAQmx APIs, which I agree with. In practice, tasks should almost always be used with Python context managers, but in the rare cases where they aren't, this method could be useful.

Why should this Pull Request be merged?

Simple rename of an existing method with an alias to the old name to not break compatibility.

What testing has been done?

Added a unit test, and ran all the existing ones. griffe says:

>poetry run griffe check -s generated\ -a 1.5.0 --verbose nidaqmx
generated\nidaqmx\task\_task.py:364: Task.close:
Public object points to a different kind of object:
  Old: function
  New: attribute

Their documentation says:

Changing the kind of an object is not really an API breakage, depending on our definition of API, since this won't always raise immediate errors like TypeError. The object is still here and accessed: the contract is fulfilled. But developers sometimes rely on the kind of an object, so changing it will lead to incorrect behavior, potentially making it difficult to detect, understand and fix the issue. That is why it is important to warn developers about such changes.

Comment thread generated/nidaqmx/task/_task.py Outdated
@zhindes
zhindes force-pushed the users/zhindes/clear_task branch from 2140ab1 to cfc9a3e Compare August 3, 2026 18:52
@zhindes
zhindes requested a review from bkeryan August 3, 2026 18:52
Comment thread tests/unit/test_task.py Outdated
@zhindes
zhindes force-pushed the users/zhindes/clear_task branch from cfc9a3e to 66c6539 Compare August 3, 2026 18:55
@zhindes zhindes changed the title add clear task method add clear task method and made close an alias Aug 3, 2026
@zhindes
zhindes force-pushed the users/zhindes/clear_task branch from 66c6539 to 95a4efd Compare August 3, 2026 18:58
Comment thread generated/nidaqmx/task/_task.py
@zhindes
zhindes force-pushed the users/zhindes/clear_task branch from 95a4efd to fe3ebc5 Compare August 3, 2026 19:31
@zhindes
zhindes requested a review from bkeryan August 3, 2026 19:32
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Results

    46 files  ± 0      46 suites  ±0   1h 17m 50s ⏱️ -45s
 3 211 tests + 2   2 558 ✅ + 2     653 💤 ±0  0 ❌ ±0 
62 022 runs  +56  49 192 ✅ +56  12 830 💤 ±0  0 ❌ ±0 

Results for commit fe3ebc5. ± Comparison against base commit e18602c.

@zhindes
zhindes merged commit ae7d60f into master Aug 3, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants