-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Update iter_bytes to be the same as what's used in pyvisa-sim
#389
Conversation
pyvisa_py/serial.py
Outdated
def iter_bytes( | ||
data: bytes, mask: Optional[int] = None, send_end: Optional[bool] = False | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if serial.iter_bytes
was used by any external projects, so I opted to keep the API around. LMK if you'd rather I just remove it.
send_end, _ = self.get_attribute(ResourceAttribute.send_end_enabled) | ||
end_out, _ = self.get_attribute(ResourceAttribute.asrl_end_out) | ||
data_bits, _ = self.get_attribute(constants.ResourceAttribute.asrl_data_bits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reordered end_out
and send_end
so that they match pyvisa_sim
: https://github.com/pyvisa/pyvisa-sim/blob/17323c60b9e50f8cca4b983d42dd26a6ada877e3/pyvisa_sim/sessions/serial.py#L76-L78
I opted to not rename end_out
to asrl_end
to keep the diff down.
Sorry this completely escaped my attention. I would say we can scrape iter_bytes from serial. It was not really meant to be public. But its disappearance should be mentioned. I am planning to release soon since there has been multiple bug fixes. Do you think you can make the changes before next week ? |
Updated, PTAL |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
==========================================
+ Coverage 23.14% 24.22% +1.07%
==========================================
Files 23 24 +1
Lines 3318 3356 +38
Branches 458 469 +11
==========================================
+ Hits 768 813 +45
+ Misses 2532 2524 -8
- Partials 18 19 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Isort and flake8 are unhappy. CI do not run automatically because you are a first time contributor. |
This ports pyvisa/pyvisa-sim#81 to this project per request in pyvisa/pyvisa-sim#81 (comment), closing #374.
iter_bytes
changes for serial communication #374black . && isort -c . && flake8
with no errors