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

Importing nidcpower.session into output voltage measurement #399

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

DelpireNI
Copy link
Contributor

@DelpireNI DelpireNI commented Sep 22, 2023

What does this Pull Request accomplish?

When running the OutputVoltageMeasurement I got the following error:

Traceback (most recent call last):
File "C:\Users\DelpireTest1\Desktop\measurementlink-python\measurementlink-python\examples\output_voltage_measurement\measurement.py", line 177, in
channels: nidcpower._SessionBase,
AttributeError: module 'nidcpower' has no attribute '_SessionBase'

I am not sure what has happened with nidcpower._SessionBase. A search in the ni/nimi-python repo shows this class for our other drivers, DMM, Scope, Switch, etc., but I do not see it for nidcpower.

Importing nidcpower.session and fixing type hint.

Why should this Pull Request be merged?

Currently it seems the measurement cannot be run out of the box. This should fix it.

What testing has been done?

Was able to run the measurement successfully and it worked with both InstrumentStudio and TestStand.

@github-actions
Copy link

github-actions bot commented Sep 22, 2023

Test Results

     12 files  ±0       12 suites  ±0   2m 33s ⏱️ -12s
   215 tests ±0     186 ✔️ ±0    29 💤 ±0  0 ±0 
2 568 runs  ±0  2 220 ✔️ ±0  348 💤 ±0  0 ±0 

Results for commit 5c236b3. ± Comparison against base commit 93f19ff.

♻️ This comment has been updated with latest results.

@bkeryan
Copy link
Collaborator

bkeryan commented Sep 22, 2023

I don't know what caused this. _SessionBase is still right there in the nimi-python main branch:

https://github.com/ni/nimi-python/blob/4437fdd53856ba886d543aa01dd6fc86ada383c9/generated/nidcpower/nidcpower/session.py#L95

I filed a bug about the fact that this public API returns an internal type: ni/nimi-python#2019

@DelpireNI DelpireNI changed the title Replacing _SessionBase with Session in Output Voltaget Measurement ex… Adding from __future__ import annotations to Output Voltage Measurement example Sep 22, 2023
@DelpireNI DelpireNI changed the title Adding from __future__ import annotations to Output Voltage Measurement example Importing nidcpower.session into output voltage measurement Sep 22, 2023
@DelpireNI DelpireNI requested a review from bkeryan September 22, 2023 21:49
@DelpireNI DelpireNI merged commit d53f08d into main Sep 22, 2023
@DelpireNI DelpireNI deleted the users/cdelpire/fix-output-voltage-measurement-example branch September 22, 2023 22:11
DelpireNI added a commit that referenced this pull request Sep 25, 2023
* Replacing _SessionBase with Session in Output Voltaget Measurement example.

Signed-off-by: Chris Delpire <[email protected]>

* Switching back to _SessionBase and adding import statement to fix issue.

* importing nidcpower.session and fixing type hint.

Signed-off-by: Chris Delpire <[email protected]>

---------

Signed-off-by: Chris Delpire <[email protected]>
DelpireNI added a commit that referenced this pull request Sep 25, 2023
…ement (#399) (#406)

Importing nidcpower.session into output voltage measurement (#399)

* Replacing _SessionBase with Session in Output Voltaget Measurement example.



* Switching back to _SessionBase and adding import statement to fix issue.

* importing nidcpower.session and fixing type hint.



---------

Signed-off-by: Chris Delpire <[email protected]>
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