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

feat: Implement ykush auxiliary #225

Merged
merged 7 commits into from
Jan 23, 2023
Merged

feat: Implement ykush auxiliary #225

merged 7 commits into from
Jan 23, 2023

Conversation

yannpoupon
Copy link
Contributor

Auxiliary that connect to an Ykush device : https://www.yepkit.com/products/ykush .
The auxiliary give the possibility to switch ports on and off individually and get the state of the port.

@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #225 (869199f) into master (ae4202a) will increase coverage by 0.09%.
The diff coverage is 99.29%.

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
+ Coverage   95.43%   95.53%   +0.09%     
==========================================
  Files          72       73       +1     
  Lines        5547     5688     +141     
==========================================
+ Hits         5294     5434     +140     
- Misses        253      254       +1     
Impacted Files Coverage Δ
src/pykiso/lib/auxiliaries/ykush_auxiliary.py 99.29% <99.29%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

:return: True if succesful
"""
log.internal_info("Create auxiliary instance")
self.set_all_ports_on()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the auxiliary switch ports implicitly?

"""Power on all port to restore the ports.
:return: always True
"""
self.set_all_ports_on()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the auxiliary switch ports implicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought if for example you do a test with the ykush auxiliary where you put a port off and it stays off at the end of the test. And after you want to do other tests without the auxiliary then you will not be able to communicate with the device on the port off. Which is why I reset port at the end of the test.

.. automodule:: pykiso.lib.auxiliaries.ykush_auxiliary
:members:

.. note::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. note::
.. warning::

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

examples/test_suite_ykush/test_ykush.py Show resolved Hide resolved
src/pykiso/lib/auxiliaries/ykush_auxiliary.py Show resolved Hide resolved
docs/modules_usage/ykush_control.rst Outdated Show resolved Hide resolved
docs/whats_new/version_ongoing.rst Outdated Show resolved Hide resolved
pass


class YkushAuxiliary(DTAuxiliaryInterface):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I feel like a neat API would be:

ykush_aux.ports[0].on()
ykush_aux.ports[0].is_on()

for port in ykush_aux.ports:
     port.off()

src/pykiso/lib/auxiliaries/ykush_auxiliary.py Outdated Show resolved Hide resolved
src/pykiso/lib/auxiliaries/ykush_auxiliary.py Outdated Show resolved Hide resolved
src/pykiso/lib/auxiliaries/ykush_auxiliary.py Outdated Show resolved Hide resolved
@yannpoupon yannpoupon requested review from sebclrsn and removed request for Pog3k January 16, 2023 13:12
@Pog3k Pog3k merged commit 4a8384c into eclipse:master Jan 23, 2023
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.

5 participants