-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
739 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
push: | ||
tags: [ 'v*.*.*' ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# Specifying a GitHub environment is optional, but strongly encouraged | ||
environment: release | ||
permissions: | ||
# This permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Ruff | ||
on: [push, pull_request] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build" | |
|
||
[project] | ||
name = "elliptec" | ||
version = "0.0.3" | ||
version = "0.0.5" | ||
authors = [ | ||
{ name="David Roesel", email="[email protected]" }, | ||
] | ||
|
@@ -25,4 +25,14 @@ dependencies = [ | |
[project.urls] | ||
"Homepage" = "https://github.com/roesel/elliptec" | ||
"Documentation" = "https://elliptec.readthedocs.io" | ||
"Bug Tracker" = "https://github.com/roesel/elliptec/issues" | ||
"Bug Tracker" = "https://github.com/roesel/elliptec/issues" | ||
|
||
[tool.ruff] | ||
# Allow lines to be as long as 119 characters. | ||
line-length = 119 | ||
# Ignore errors of unused module imports in __init__.py | ||
ignore-init-module-imports = true | ||
|
||
[tool.black] | ||
# Allow lines to be as long as 119 characters. | ||
line-length = 119 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
''' This file contains a dictionary of commands that the devices can accept in | ||
""" This file contains a dictionary of commands that the devices can accept in | ||
three different categories: get, set, move. For each command, it returns the | ||
instruction code to send to the device. ''' | ||
instruction code to send to the device. """ | ||
|
||
# TODO: Each type of device should get it's own list of supported commands. | ||
|
||
get_ = { | ||
'info' : b'in', | ||
'status' : b'gs', | ||
'position': b'gp', | ||
'stepsize' : b'gj', | ||
'home_offset' : b'go', | ||
'motor_1_info' : b'i1', | ||
'motor_2_info' : b'i2', | ||
} | ||
|
||
set_ = { | ||
'stepsize' : b'sj', | ||
'isolate' : b'is', | ||
'address' : b'ca', | ||
'home_offset': b'so' | ||
} | ||
"info": b"in", | ||
"status": b"gs", | ||
"position": b"gp", | ||
"stepsize": b"gj", | ||
"home_offset": b"go", | ||
"motor_1_info": b"i1", | ||
"motor_2_info": b"i2", | ||
} | ||
|
||
set_ = {"stepsize": b"sj", "isolate": b"is", "address": b"ca", "home_offset": b"so"} | ||
|
||
mov_ = { | ||
'home_clockwise' : b'ho0', | ||
'home_anticlockwise' : b'ho1', | ||
'forward' : b'fw', | ||
'backward' : b'bw', | ||
'absolute' : b'ma', | ||
'relative' : b'mr' | ||
} | ||
"home_clockwise": b"ho0", | ||
"home_anticlockwise": b"ho1", | ||
"forward": b"fw", | ||
"backward": b"bw", | ||
"absolute": b"ma", | ||
"relative": b"mr", | ||
} | ||
|
||
do_ = { | ||
"save_user_data": b"us", | ||
} | ||
|
||
|
||
def commands(): | ||
return {"get":get_, "set":set_, "move":mov_} | ||
"""Returns a dictionary of commands that the devices can accept.""" | ||
return {"get": get_, "set": set_, "move": mov_, "do": do_} | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
cmds = commands() | ||
print(cmds) | ||
print(cmds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.