Skip to content
Closed
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,5 @@ cython_debug/

# PyPI configuration file
.pypirc

.vscode
19 changes: 11 additions & 8 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ignore=CVS

# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths and can be in Posix or Windows format.
ignore-paths=
ignore-paths=src/methods/pyoma

# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths. The default value ignores emacs file
Expand Down Expand Up @@ -90,7 +90,10 @@ disable=raw-checker-failed,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead
use-symbolic-message-instead,
missing-function-docstring,
missing-module-docstring,
missing-class-docstring

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -209,15 +212,15 @@ logging-modules=logging
[BASIC]

# Naming style matching correct argument names.
argument-naming-style=camelCase
#argument-naming-style=camelCase

# Regular expression matching correct argument names. Overrides argument-
# naming-style. If left empty, argument names will be checked with the set
# naming style.
#argument-rgx=

# Naming style matching correct attribute names.
attr-naming-style=camelCase
#attr-naming-style=camelCase

# Regular expression matching correct attribute names. Overrides attr-naming-
# style. If left empty, attribute names will be checked with the set naming
Expand Down Expand Up @@ -272,7 +275,7 @@ const-naming-style=UPPER_CASE
docstring-min-length=-1

# Naming style matching correct function names.
function-naming-style=camelCase
#function-naming-style=camelCase

# Regular expression matching correct function names. Overrides function-
# naming-style. If left empty, function names will be checked with the set
Expand Down Expand Up @@ -303,14 +306,14 @@ inlinevar-naming-style=any
#inlinevar-rgx=

# Naming style matching correct method names.
method-naming-style=camelCase
#method-naming-style=camelCase

# Regular expression matching correct method names. Overrides method-naming-
# style. If left empty, method names will be checked with the set naming style.
#method-rgx=

# Naming style matching correct module names.
module-naming-style=camelCase
#module-naming-style=camelCase

# Regular expression matching correct module names. Overrides module-naming-
# style. If left empty, module names will be checked with the set naming style.
Expand All @@ -334,7 +337,7 @@ property-classes=abc.abstractproperty
#typevar-rgx=

# Naming style matching correct variable names.
variable-naming-style=camelCase
#variable-naming-style=camelCase

# Regular expression matching correct variable names. Overrides variable-
# naming-style. If left empty, variable names will be checked with the set
Expand Down
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ source .venv/bin/activate # On Linux
pip install poetry #Specifically install poetry to your system
# If you have poetry installed globally
poetry env activate # shows the command to activate venv
pylint src --rcfile=../.pylintrc # runs linting checks

poetry install # installs all required python packages
pylint src tests --rcfile=.pylintrc # runs linting checks

poetry build # builds cp-sens package that can be published on pip
poetry run start # runs the main script
poetry run experiment_1 # run one experiment with real data
```

## Testing
Expand All @@ -32,13 +33,3 @@ _test_*_.py_. To run all tests, with coverage:
```bash
pytest
```

## Use

Only MQTT client code is working at the moment.
You can use it by setting the `src/cp-sens/data/config/mqtt.json`
and executing,

```bash
python .\src\cp-sens\data\sources\mqtt.py
```
457 changes: 453 additions & 4 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "cp-sens"
name = "example-shm"
version = "0.1.0"
description = ""
authors = ["prasadtalasila <prasadtalasila@gmail.com>"]
Expand All @@ -8,9 +8,10 @@ license = "INTO-CPS Association"
packages = [{include = "*", from="src"}]

[tool.poetry.dependencies]
python = "^3.11"
python = ">=3.10, <3.13"
paho-mqtt = "^2.1.0"
matplotlib = "^3.10.0"
pyOMA-2 = "1.0.0"

[tool.poetry.group.dev.dependencies]
pylint = "^3.3.3"
Expand All @@ -23,3 +24,4 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
start = "src.main:main"
experiment_1 = "src.experiment_1:main"
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
minversion = 8.3
pythonpath = src/cp-sens tests/cp-sens
pythonpath = src src/data src/methods tests
testpaths =
tests
addopts = --cov=src --cov-report=term-missing --cov-report=html
Expand Down
File renamed without changes.
39 changes: 39 additions & 0 deletions src/config/mqtt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"MQTT": {
"default": {
"host": "test.mosquitto.org",
"port": 1883,
"userId": "",
"password": "",
"ClientID": "test_client_id",
"QoS": 1,
"TopicsToSubscribe": ["topicAA","topicBB","topicCC"]
},
"real_server": {
"host": "dtl-server-2.st.lab.au.dk",
"port": 8090,
"userId": "",
"password": "",
"ClientID": "test_client_id",
"QoS": 1,
"TopicsToSubscribe": [
"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/1/acc/raw/data",
"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/1/acc/raw/metadata",

"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/2/acc/raw/data",
"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/2/acc/raw/metadata",
"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/3/acc/raw/data",
"cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/3/acc/raw/metadata"
]
},
"PI_test": {
"host": "test.mosquitto.org",
"port": 1883,
"userId": "",
"password": "",
"ClientID": "test_client_id",
"QoS": 1,
"TopicsToSubscribe": ["cpsens/DAQ_ID/MODULE_ID/Sensor1/acc/raw/data"]
}
}
}
11 changes: 0 additions & 11 deletions src/cp-sens/config/mqtt.json

This file was deleted.

76 changes: 0 additions & 76 deletions src/cp-sens/data/accel/hbk/METADATA.md

This file was deleted.

26 changes: 0 additions & 26 deletions src/cp-sens/data/accel/senseHAT.py

This file was deleted.

82 changes: 0 additions & 82 deletions src/cp-sens/data/sources/mqtt.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/cp-sens/experiment_1.py

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading