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
Add functions to C library wrapper #23
Conversation
acspy/acsc.py
Outdated
@@ -277,27 +300,20 @@ def toPointM(hcomm, flags, axes, target, wait=SYNCHRONOUS): | |||
call_acsc(acs.acsc_ToPointM, hcomm, flags, axes_c, target_c, wait) | |||
|
|||
|
|||
def enable(hcomm, axis, wait=SYNCHRONOUS): | |||
def enableMotor(hcomm, axis:int, wait=SYNCHRONOUS): |
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.
We shouldn't rename this in case others are depending on it (like some of my apps!) You can create an alias if you'd like, but I've just been mirroring the ACS function names, which here is just enable
.
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.
Hi Pete, ok! On it. Thanks for your answer.
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.
Thanks for the contribution! A couple things:
- Existing APIs should be left in place, following the "open/closed principle" (open for extension, closed for change). You can add new functions, but don't delete or change existing ones in ways that could break any code depending on this library.
- Please run
black -l79
on the code. I should automate that with GitHub Actions, but haven't got around to it yet.
Hi Pete, great. Thanks for the explanation. I'm going to fix this to follow the open/closed principle then. |
acspy/acsc.py
Outdated
@@ -192,6 +192,11 @@ def setJerk(hcomm, axis: int, jerk: double, wait=SYNCHRONOUS): | |||
call_acsc(acs.acsc_SetJerk, hcomm, axis, double(jerk), wait) | |||
|
|||
|
|||
def setRPosition(hcomm, axis: int, rpos: double, wait=SYNCHRONOUS): |
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.
The type hints for these should be Python types, since we convert to ctypes internally
def setRPosition(hcomm, axis: int, rpos: double, wait=SYNCHRONOUS): | |
def setRPosition(hcomm, axis: int, rpos: float, wait=SYNCHRONOUS): |
Hi Pete, I'm interested in contributing to your repo. Here are a couple of functions. I would like to check with you if I understood correctly how to wrap them from the C API. Thanks in advance.