Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[codespell]
skip = ./.git/*,Pipfile.lock
skip = ./.git/*,uv.lock,.venv/*
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Feature request
about: Suggest an idea for this project
title: "[Feature]"
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/check-spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
name: Check Spelling
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Check Spelling
uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
11 changes: 9 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,33 @@ on:
branches:
- main

permissions:
contents: read
statuses: write

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0
persist-credentials: false

- name: Lint Code Base
uses: docker://ghcr.io/github/super-linter:slim-v4
uses: super-linter/super-linter/slim@v8.2.1
env:
LINTER_RULES_PATH: /
VALIDATE_ALL_CODEBASE: true
VALIDATE_JSCPD: false
VALIDATE_GITLEAKS: false
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
VALIDATE_PYTHON_RUFF_FORMAT: false
PYTHON_PYLINT_CONFIG_FILE: .pylintrc
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 8 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,13 +17,15 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
uv venv
Expand Down
24 changes: 11 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand All @@ -127,4 +126,3 @@ enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.

7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Contributing

:wave: Hi there!
We're thrilled that you'd like to contribute to this project.
Your help is essential for making it great.

## Submitting a pull request

[Pull Requests][pulls] are used for adding new code and documents to the repository, or editing the existing code or documentation.

**With write access**

1. Clone the repository (only if you have write access)
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change
1. Push and [submit a pull request][pr]
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.

**Without write access**

1. [Fork][fork] and clone the repository
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change
Expand All @@ -31,12 +35,15 @@ Draft pull requests are also welcome to get feedback early on, or if there is so
- Open a pull request

## Releasing

If you are the current maintainer of this code:

1. Update `README.md` to reflect new version number in the suggested workflow file section
2. Draft [Release](https://help.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) document explaining details of Release
3. Look for approval from @prestoncarman or @KirtOnthank

## Resources

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
- [GitHub Help](https://help.github.com)
Expand Down
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Tank Controller in Python

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<!-- ALL-CONTRIBUTORS-BADGE:END -->

## Project Motivations

Update the `TankController` code from C++ to Python and run on a Raspberry Pico.


## Requirements

To set up and run this project, the system must meet the following requirements:

- **uv**: The python project package manager must be installed. Learn more at [https://docs.astral.sh/uv/](https://docs.astral.sh/uv/).
Format contributions with `uv run black .`
Format contributions with `uv run black .`
- **tkinter**: The Python GUI to test locally. Often installed separately as `python3-tk`.
Verify with `python -m tkinter`. A small GUI window should appear if Tkinter is installed correctly.
Verify with `python -m tkinter`. A small GUI window should appear if Tkinter is installed correctly.

### Mac Requirements

Expand All @@ -31,40 +31,39 @@ brew install python-tk@3.14

To run in a local environment with mocked devices (with the UI State Machine integrated)

``` sh
```sh
./run_gui.sh
```

## Features

| View Commands | Set Commands |
| ----------------------- | ------------------- |
| View IP and MAC | pH calibration |
| View free memory | Clear pH calibra |
| View Google mins | Clear Temp calib |
| View log file | Set chill/heat |
| View pH slope | Set Google mins |
| View PID | Set KD |
| View tank ID | Set KI |
| View temp cal | Set KP |
| View time | Set pH target |
| View version | Set pH w sine |
| | Set Temp w sine |
| | PID on/off |
| | Set Tank ID |
| | Temp calibration |
| | Set temperature |
| | Set date/time |
| View Commands | Set Commands |
| ---------------- | ---------------- |
| View IP and MAC | pH calibration |
| View free memory | Clear pH calibra |
| View Google mins | Clear Temp calib |
| View log file | Set chill/heat |
| View pH slope | Set Google mins |
| View PID | Set KD |
| View tank ID | Set KI |
| View temp cal | Set KP |
| View time | Set pH target |
| View version | Set pH w sine |
| | Set Temp w sine |
| | PID on/off |
| | Set Tank ID |
| | Temp calibration |
| | Set temperature |
| | Set date/time |

## Testing

To perform Pytest tests for the devices and UI states.

``` sh
```sh
./test.sh
```


## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
2 changes: 2 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ uv run black .
uv run isort .
uv run flake8 .
uv run pylint main.py src/ tests/
uv run ruff check --fix .
uv run ruff format .

# Clean up
find . -name ".pytest_cache" -type d -exec /bin/rm -rf {} +
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ dev = [
"pytest",
"pytest-cov",
"pytest-mock",
"ruff",
]

[tool.ruff.lint]
extend-select = ["B"]
1 change: 1 addition & 0 deletions src/devices/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# pylint: disable=unused-import, ungrouped-imports, wrong-import-position
# mypy: ignore-errors
# ruff: noqa: F401

from src import mock_config

Expand Down
38 changes: 33 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rules:
unpinned-uses:
ignore:
- check-spelling.yml
- linter.yml
- pytest.yml