-
Notifications
You must be signed in to change notification settings - Fork 4
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
PEP8 compliance for pyRF24 package #1
Comments
If you start fixing, use a Pull Request for it first, that way it can be reviewed. |
I'd also like to acknowledge why CircuitPython support is not possible with RF24* libraries.
|
If not CircuitPython, what about just MicroPython? Still not possible? |
it requires a separate wrapping implementation, and older micropython devices (like esp8266 and micro-bit's nRF52822) have been struggling with memory allocation errors because of the size of the firmware. |
@Avamander actually i was thinking a separate branch to merge PRs to, then merge to master when its ready. Additionally, this is a huge undertaking, and I am humbly not fully equipped to do it alone. |
A PR functionally already is a separate branch. |
oops I was thinking in terms of forks |
Consider this when changing the install instructions of python wrapper in docs.I ran into a Switching to virtual environments during testing. |
pyRF24Network module seems to want to inject itself into the namespace for the pyRF24 module using boost-python's The main problem here is that you need to git clone all RF24* repos then configure Maybe I could get setup.py to git clone all 3 RF24* repos and automate the compiling separately from this repo's context, but I think the python wrapper should go in its own repo for that (kinda like the RF24 libs docs are hosted by a separate repo). TBH I'd rather devote more time to my pure python porting of RF24Network & RF24Mesh into 1 CircuitPython package that can be used on any platform this python wrapper can be used. p.s. I took a quick peek at pyRF24Mesh wrapper, and it doesn't use boost-python's |
A note about using boost.pythonthe following error occured during testing a new python example:
It would seem that boost.python expects all arguments to be lvalues. So, passing a function call to use its rvalue as an parameter doesn't get evaluated like with normal python. p.s. I ran into a similar problem (no traceback error) when passing a EDITI just realized that the |
I started talking about the pyRF24 examples in relation to poor formatting (mostly readability) in nRF24/RF24#391, but that quickly got off topic. This issue will be my home for updating pyRF24 package as I have some concerns:
pyRF24
is ok as a folder name, but pypi.org expects package names to be all lowercase using-
as word delimiters. Furthermore, after installing of pyRF24, the wrapper is registered under the package name RF24 -- this is not ok. Package names should be as descriptive as possible and use the same convention pypi.org expects, except_
in place of-
since-
would be interpreted as a subtraction in python import statements. Not to mention the RF24 package can be confused with the RF24 class especially for namespace-ing reasons. On that note,from RF24 import *
is discouraged as risky. Tagging [Question] Distributing Python wrapper module with pip RF24#589 as this issue progresses that one._
as word delimiters. Currently pyRF24's classes & constants are PEP8 compliant. Technically the module names don't apply to pyRF24 because of the nature of wrapping C++. Function, parameter, & attributes names can be changed due to the nature of wrapping C++ with libboost-python. See PEP8 Naming Convention guidelines.__repr__()
) and private members (e.g._private_member
). However, libboost-python abstracts the "magic methods" for us, and Arduino convention recommends the same prefix for private members. This one isn't listed as part of the PEP8 convention, but it is a VERY COMMON practice in python.for i, val in enumerate(my_list):
instead offor i in range(len(my_list)):
)len
to describe the length of a buffer;len
in python is a builtin function that returns the length of an iterable object.apt
will install). To address this, we only need to remove install instructions for python2 from the docs if/when python2 stops shipping with debian-based distros or if/when libboost-python v1.70 becomes the default version installed byapt
. The setup.py files should also be adjusted at the same time.The text was updated successfully, but these errors were encountered: