Package: iqmotion
IQ Motion Python APIThis library is to talk to any IQ Control devices from mulititude of communication protocols.Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.To Learn more about this API, Read theCommunications API DocumentationPrerequisitesPipenvRead the second part ofthisandthisfor more information on pipenv.Windows and mac users:installing pipenvLinux users:installing pipenvInstallingYou can install this library using "pipenv" or "pip":pipenvinstalliqmotionorpipinstalliqmotionIf you want to edit this library and/or run some tests, You can clone this repository locally on your computer.SubmoduleIf you are using this repository as a submodule, make sure to make a symbolic link:ln-spython_api/iqmotioniqmotionIf you prefernotto use symbolic links, you could dynamically append the library to your system PATH at runtime by following along with the example below:├──examples│├──api_testing.py<---------------(currentpythonscript)│├──async_example.py
│├──multi_turn_example.py
│└──propeller_example.py
├──iqmotion<-----------------------(IQMOTIONAPILIBRARY)│├──client_entries
││├──client_entry_data.py
││├──client_entry.py
││├──dictionary_client_entry.py
││├──__init__.py
││└──process_client_entry.py
│├──clientsIf you wanted to run api_testing.py from the examples Directory, you would need to append the iqmotion library to the system path at the top of my api_testing.py script:importsys#  Adds the parent directory to the system path# (Same location that the iqmotion library is located)sys.path.append("../")Running the testsYou will need the following packages to run the tests:pytestpytest-covThey should be already installed with pipenv.You can then run the software tests with the following command:pytest./iqmotion/tests/--cov-config=.coveragerc--cov=iqmotion--cov-fail-under=100The test will fail if coverage is under 100%You can run the hardware tests with the following commands:pythonrun_hardware_tests.pyspeed--usb_handle=/dev/ttyUSB0
pythonrun_hardware_tests.pyservo--usb_handle=/dev/ttyUSB0
pythonrun_hardware_tests.pystep_dir--usb_handle=/dev/ttyUSB0Clean CodeFormattingWe useblackas a formatter. It does everything for you and it should be installed with the dev packages of pipenv.I recommend setting up your IDE to format with black when saving. Vscode has a known issue sometimes with new .py files where you need to run black in the terminal first
You can also run black from the terminal with:black./LintingWe usepylintas a linter. It does everything for you and it should be installed with the dev packages of pipenv.We have a.pylintrcfile that setups your pylint for you.I would recommend to set up your IDE to use pylint automatically (vscode should find the .pylintrc automatically).Sometimes pylint shouts at out some errors you do not wantc you can disbale a pylint error locally in a file/method/class with a comment like this:# pytlint: disable=my-errorYou can also run pylint from the terminal with the following command:pylintyour_project_directoryNew ReleasesIt is really easy to create a new release, simply run the following script and follow the prompt:(You might need to run the following command to use a bash script in windows):dos2unix./ci_scripts/new_release.sh./ci_scripts/new_release.shVersioningWe useSemVerfor versioning.ContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to us.AuthorsRaphael Van HoffelenMalik B. ParkerSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsAcknowledgmentsMatt Piccoli for helping out debugging the architecture and continuously testing the API.