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
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Lint with ruff
uses: astral-sh/ruff-action@v3
with:
version: 0.16.9
args: check --output-format github

build:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
32 changes: 17 additions & 15 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
cff-version: 1.2.0
message: "Please cite this repository if you use it in your work."
message: "Please cite this repository if you use it in your work."
title: "succulent"
abstract: "Do you ever find it challenging and tricky to send sensor measurements, data, or GPS positions from embedded devices, microcontrollers, and smartwatches to a central server? Setting up the primary data collection scripts can be a time-consuming process, involving selecting a protocol, framework, API, and testing them out. Moreover, these scripts are often tailored for specific tasks, making them difficult to adapt to different scenarios."
doi: 10.5281/zenodo.10402365
authors:
- family-names: Fister Jr.
given-names: Iztok
email: iztok@iztok.space
orcid: 0000-0002-6418-1272
email: iztok@iztok.dev
orcid: "https://orcid.org/0000-0002-6418-1272"
- family-names: Lahovnik
given-names: Tadej
orcid: 0009-0005-9689-2991
license: "MIT License"
orcid: "https://orcid.org/0009-0005-9689-2991"
license: MIT
repository-code: "https://github.com/firefly-cpp/succulent"
url: "https://succulent.readthedocs.io/en/latest/"
keywords:
- Raspberry Pi
- Data Science
- Machine Learning
- ESP32
- Data Collection
- Data Preprocessing Pipelines
repository: "https://github.com/firefly-cpp/succulent"
version: 0.4.0
languages:
- Python
version: 0.5.1
date-released: 2026-11-09
preferred-citation:
type: software
title: "succulent"
authors:
- family-names: Fister Jr.
given-names: Iztok
email: iztok@iztok.space
orcid: 0000-0002-6418-1272
email: iztok@iztok.dev
orcid: "https://orcid.org/0000-0002-6418-1272"
- family-names: Lahovnik
given-names: Tadej
orcid: 0009-0005-9689-2991
version: 0.4.0
license: "MIT License"
repository-code: "https://github.com/firefly-cpp/succulent"
orcid: "https://orcid.org/0009-0005-9689-2991"
doi: 10.5281/zenodo.10402365
version: 0.5.1
date-released: 2026-11-09
license: MIT
repository-code: "https://github.com/firefly-cpp/succulent"
url: "https://succulent.readthedocs.io/en/latest/"
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Scientific/Engineering",
"Topic :: System :: Hardware",
Expand Down Expand Up @@ -58,6 +59,11 @@ Sphinx = ">=7.0"
sphinx-rtd-theme = ">=2.0"
sphinxcontrib-bibtex = "^2.6"

[tool.ruff.lint]
# Errors only (syntax errors, undefined names, unused imports, ...), no style
# rules; listed explicitly so new ruff versions do not change the CI result
select = ["E4", "E7", "E9", "F"]

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
3 changes: 2 additions & 1 deletion succulent/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def __init__(self, format, config, unittest=False):
} for configuration in config['data'] if configuration.get('min') is not None or configuration.get('max') is not None]

if 'timestamp' in config:
if config['timestamp'] == True:
# Only the YAML value true enables it (not e.g. the string 'false')
if config['timestamp'] == True: # noqa: E712
self.timestamp = True

if 'results' in config:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ def test_summary(self):
# /measure rejects values outside min/max, so the out-of-range row is
# written directly (as for data stored before the limits were set)
now = datetime.now()
stamp = lambda minutes: (now - timedelta(minutes=minutes)).strftime('%Y-%m-%d %H:%M:%S')

def stamp(minutes):
return (now - timedelta(minutes=minutes)).strftime('%Y-%m-%d %H:%M:%S')

self.write_rows([
{'temperature': 20, 'humidity': 40, 'status': 'ok', 'timestamp': stamp(20)},
{'temperature': 35, 'humidity': 41, 'status': 'ok', 'timestamp': stamp(10)},
Expand Down
14 changes: 14 additions & 0 deletions tests/test_succulent.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from succulent import __version__
import pandas as pd
import re
import unittest
import io
import json
Expand Down Expand Up @@ -804,6 +805,19 @@ def test_infinity_is_null(self):
self.assertIsNone(data[0]['humidity'])


class TestVersion(unittest.TestCase):
"""
The package version must match the version in pyproject.toml.
"""

def test_version_matches_pyproject(self):
pyproject = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'pyproject.toml')
with open(pyproject, encoding='utf-8') as f:
match = re.search(r'^version = "([^"]+)"', f.read(), flags=re.MULTILINE)
self.assertIsNotNone(match)
self.assertEqual(__version__, match.group(1))


class TestConfiguration(unittest.TestCase):
"""
Test case for the Configuration class.
Expand Down
Loading