Skip to content

Latest commit

 

History

History
93 lines (61 loc) · 1.53 KB

migration_guide.md

File metadata and controls

93 lines (61 loc) · 1.53 KB

Migration Guide

This guide outlines how to convert existing code based on legacy PyTrinamic (<0.2.0) to newer versions.

Also check out the new examples. For almost all examples that were published for legacy PyTrinamic, new examples are provided.

Imports

All imports now use PyTrinamic in lowercase letters.

PyTrinamic < 0.2.0:

import PyTrinamic
from PyTrinamic.version import __version__

Now:

import pytrinamic
from pytrinamic.version import __version__

Shorter Import Paths

We introduced shorter imports.

PyTrinamic < 0.2.0:

from PyTrinamic.connections.ConnectionManager import ConnectionManager
from PyTrinamic.modules.TMCM1160.TMCM_1160 import TMCM_1160

Now:

from pytrinamic.connections import ConnectionManager
from pytrinamic.modules import TMCM1160

Module Naming

All modules now use snake_case naming convention.

PyTrinamic < 0.2.0:

from PyTrinamic.TMCL import ...

Now

from pytrinamic.tmcl import ...

Class Naming

All classes now use the PascalCase naming convention. We also removed any underscore in class names.

PyTrinamic < 0.2.0:

module = TMCM_1160(..)
.. = TMCL.TMCL_Command

Now:

module = TMCM1160(..)
.. = tmcl.TMCLCommand

Function Naming

All functions now use the snake_case naming convention.

PyTrinamic < 0.2.0:

module.getAxisParameter(TMCM_1160.APs.ActualPosition)

Now:

module.get_axis_parameter(TMCM1160._MotorTypeA.AP.ActualPosition)