Skip to content

Commit d62cf78

Browse files
committed
Initial upload
0 parents  commit d62cf78

File tree

17 files changed

+2473
-0
lines changed

17 files changed

+2473
-0
lines changed

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
max-complexity = 20
3+
max-line-length = 79
4+
5+
extend-ignore =
6+
# Let formatting take care of line length (not flake8)
7+
E501
8+
9+
per-file-ignores =
10+
src/signaloid/distributional_information_plotting/*: F841
11+
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches: [ "master", "main" ]
5+
pull_request:
6+
release:
7+
types: [published]
8+
9+
permissions:
10+
contents: write
11+
12+
env:
13+
POETRY_CACHE_DIR: ~/.cache/pypoetry
14+
15+
jobs:
16+
run:
17+
18+
strategy:
19+
matrix:
20+
args:
21+
- host: ubuntu-20.04
22+
- host: macos-14
23+
24+
runs-on: ${{ matrix.args.host }}
25+
26+
env:
27+
LOGLEVEL: info
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Debug
33+
run: |
34+
echo "github.event_name:" ${{ github.event_name }}
35+
echo "github.event.pull_request.head.sha:" ${{ github.event.pull_request.head.sha }}
36+
echo "github.sha:" ${{ github.sha }}
37+
echo "toJson(github.event.pull_request.labels):" ${{ toJson(github.event.pull_request.labels) }}
38+
echo "github.event.release.tag_name:" ${{ github.event.release.tag_name }}
39+
echo "contains(github.event.pull_request.labels, 'ci:upload-binaries'):" ${{ contains(github.event.pull_request.labels, 'ci:"upload-binaries') }}
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v3
43+
with:
44+
python-version: "3.11"
45+
46+
- name: Install Poetry Action
47+
uses: snok/[email protected]
48+
49+
- name: Print Poetry version
50+
run: poetry --version
51+
52+
- name: List Current Directory
53+
run: ls
54+
55+
- name: Install
56+
run: poetry install
57+
58+
- name: Print Python Information
59+
run: |
60+
which python
61+
pip freeze
62+
63+
- name: Test
64+
run: poetry run pytest
65+
66+
- name: Lint
67+
run: poetry run flake8 src/
68+
69+
- name: Check format
70+
run: poetry run black --check src/
71+
72+
- name: Typecheck
73+
run: poetry run mypy -p signaloid
74+
75+
- name: Build
76+
run: poetry build
77+
78+
- name: Upload test logs
79+
uses: actions/upload-artifact@v3
80+
if: always()
81+
with:
82+
name: "test-logs-${{matrix.args.host}}-${{ github.event.pull_request.head.sha || github.sha }}"
83+
path: |
84+
./src/signaloid/distributional_information_plotting/tests/testdata/Brown-Ham-model-actual-results_df.csv
85+
86+
- name: Upload wheels
87+
if: ${{ startsWith(matrix.args.host, 'ubuntu') }}
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: "wheel-${{ github.event.pull_request.head.sha || github.sha }}"
91+
path: |
92+
./dist/*
93+
94+
- name: Upload to release
95+
if: ${{ github.event_name == 'release' && startsWith(matrix.args.host, 'ubuntu') }}
96+
uses: svenstaro/upload-release-action@v2
97+
with:
98+
99+
file: dist/*
100+
101+
# https://github.com/svenstaro/upload-release-action/issues/111#issuecomment-1794377222
102+
tag: "${{ github.event.release.tag_name }}"
103+
104+
file_glob: true

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.idea
2+
.venv/
3+
dist/
4+
.mypy_cache
5+
*.whl
6+
*.tar.gz
7+
requirements.txt
8+
info/
9+
bundle-build/
10+
*.spec
11+
__pycache__/
12+
.DS_Store
13+
.vscode
14+
15+
#
16+
# Binaries
17+
#
18+
*.o
19+
*.out
20+
*.sr
21+
*.map
22+
*.dump

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024, Signaloid.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Signaloid-Tools-Python
2+
This repository contains a set of tools for parsing and plotting Signaloid distributional data. The code has been tested on MacOS-11 and Ubuntu-20.04 using python 3.11.
3+
4+
### `DistributionalValue` class:
5+
This is the main class used to represent distributional values. You can parse distributional data from from hex strings (`Ux` strings) or byte buffers. You can find more details regarding Signaloid distributional values [here](https://docs.signaloid.io/docs/hardware-api/ux-data-format/).
6+
7+
### `PlotHistogramDiracDeltas` class:
8+
Histogram plotter class. Exposes `plot_histogram_dirac_deltas()`, which takes a `DistributionalValue` list and plots each DistributionalValue as a histogram.
9+
10+
## Installation:
11+
You can download the latest wheel package from [here](https://github.com/signaloid/Signaloid-DistributionalPlotting-Tools/releases) and install it via pip:
12+
```bash
13+
pip install signaloid-0.2.0-py3-none-any.whl
14+
```

0 commit comments

Comments
 (0)