Skip to content

czbiohub-sf/PyMotors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMotors

Introduction

This repository provides code for a pymotors library that contains Python classes and/or functions that have been designed for various motor control applications in the CZ Biohub - SF Bioengineering team. All utilities support Python 3.7.

Maintenance of this repo is the responsibility of the Bioengineering team of CZ Biohub - SF. Please direct any communication to the group via creation of an issue.

Copyright Chan Zuckerberg Biohub - San Francisco 2023.

Contents

  • StepperBase - A generalized base class for stepper motors.
  • TicStepper - An implementation specific stepper motor class based off of the T500 stepper driver.
  • TicStage - An enhancement to TicStepper that includes features for motorized stages.
  • DcBase - A generalized base class for DC motors.
  • LimitedDc - A class that provides control over DC motor with limit switch feedback.

Installation and Use

Installing Module

  1. Create and/or activate a virtual environment in a convenient location with Python3
  2. Download / clone this repository
  3. Navigate to the base of the repository
  4. Install setuptools (pip install setuptools)
  5. Test the module for completeness (python setup.py test)
  6. Install module (pip install .)

NOTE: Developers may want to install the module with pip install -e . so that changes they make to the module are immediately reflected when subsequently imported.

Installing without cloning the repository

  1. Create and/or activate a virtual environment in a convenient location with Python3
  2. Install module (pip install git+https://github.com/czbiohub-sf/PyMotors)

NOTE: It is unclear that module can be tested for completeness if directly installed.

Updating Module from Repository

  1. Pull changes from remote repository
  2. Activate virtual environment with previous install
  3. Navigate to the module directory
  4. Test the module for completeness (python setup.py test)
  5. Update module (pip install . --upgrade)

Updating Without Cloning

  1. Update module (pip install git+https://github.com/czbiohub-sf/PyMotors --upgrade)

Using Module

  1. Edit files to include import pymotors or a variant such as from pymotors import TicStepper
  2. Activate virtual environment with module installed
  3. Execute python script or application

Testing Module for Completeness

Before using this code or updating to newer versions, it would be wise to check for completeness. Breaking changes that can impact your work occasionally occur during development. Although major and minor versioning of code helps indicate when specific interfaces may no longer be compatible with previous versions, there can also be smaller code breaks that cause methods to silently fail.

This repository includes unit tests that can be used to assess the health of the code. Whenever a new feature is added, new tests are made to confirm that the feature behaves correctly. Whenever a feature is changed, the old tests should be updated to reflect the new behavior. If an author breaks code and does not fix the issue, the previously written tests should fail. You can evaluate these tests for yourself by running the command make in the outer directory of the repository.