Skip to main content

Add your description here

Project description

phenomate-core

Overview

phenomate-core is a Python package for processing Phenomate sensor binaries into appropriate outputs. The Phenomate platform collects data from the following sensors

  • JAI RGB camera
  • IMU - INS401
  • Lidar (2D)
  • Hyperspectral Camera

And it packs the data (typically) into Protobuffer messages as the sensors collect it. This package unpacks and and possibly transforms the data from the protobuffer files, ready for further processing.

Installation

Clone the repository and install dependencies:

git clone https://github.com/yourusername/phenomate-core.git
cd phenomate-core
make install

Installing libjpeg-turbo - Oak-d

Please see the official page for installing libjpeg-turbo for your operating system.

Installing Sickscan - 2D Lidar

The conversion code for the 2D LIDAR has the required Python code as part of this repository. If the code needs updating then it can be built from the GitHub repository:

mkdir -p ./sick_scan_ws
cd ./sick_scan_ws

git clone -b master https://github.com/SICKAG/sick_scan_xd.git

mkdir -p ./build
pushd ./build
rm -rf ./*
export ROS_VERSION=0

# specify optimisation level: -DO=0 (compiler flags -g -O0), -DO=1 (for compiler flags -O1) or -DO=2
# Install to local directory uising CMAKE_INSTALL_PREFIX=
cmake -DCMAKE_INSTALL_PREFIX=~/local -DROS_VERSION=0 -DLDMRS=0 -DSCANSEGMENT_XD=0 -G "Unix Makefiles" ../sick_scan_xd
make -j4
make -j4 install  # install locally
popd

# The output Python code can be found in:
# ~/local/include/sick_scan_xd/sick_scan_xd.py
# and can be copied to phenomate-core/phenomate_core/preprocessing/lidar

Usage

Example usage for extracting and saving images:

from phenomate_core import JaiPreprocessor

preproc = JaiPreprocessor(path="path/to/data.bin")
preproc.extract()
preproc.save(path="output_dir")

Development

  • Python 3.11+
  • Uses ruff and mypy for linting and type checking
  • Protobuf files should be compiled with protoc as needed
uv pip install protobuf
make compile-pb

Project Updating version numbers

Version numbers follow the standard pattern of: MAJOR.MINOR.PATCH and the project has been configured to use the Python libray bump-my-version to help automate the change of version numbers that are used in the files within the project.

The following proceedures outline its use:

Make sure mump-my-version is installed

uv pip install  bump-my-version
# add to pyproject.toml 
uv add --dev bump-my-version

This tool uses the file .bumpmyversion.toml for configuring what files get modified.

N.B. If files are added to the project that use an explicit version number, then add the files to .bumpmyversion.toml along with the rules.

Use the tool as follows:

  1. make sure the current version in .bumpmyversion.toml is correct e.g.
current_version = "0.4.0"

Set the bumpwhat value and run the bump-my-version command:

# uv run bump-my-version -h

export bumpwhat=major | minor | patch
uv run bump-my-version bump $bumpwhat

Post bump version tasks

After a version update the package can be published to PyPi:

rm -fr ./dist
uv build
uv publish # requires a token from PyPi - see .pypirc file

Now setup the Phenomate project repository telling it about the new version -

  1. Edit pyproject.toml and change the "phenomate-core>=X.Y.Z" dependency to the latest version.
  2. Then run:
uv lock

N.B. If installing into the Docker application, first comment out the local installation path in pyproject.toml

#[tool.uv.sources]
# phenomate-core = { path = "../phenomate-core" }
# appm = { path = "../appn-project-manager" }

and then rebuild the the docker container:

docker compose up -d --force-recreate --build celery_worker

If not installing using Docker, just reinstall the new package into the uv virtual environment:

make install-local-phenomate-core  # this runs uv pip install ${LOCAL_APPM}

Contributing

Contributions are welcome! Please open issues or pull requests for bug fixes, features, or improvements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phenomate_core-0.4.0.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phenomate_core-0.4.0-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file phenomate_core-0.4.0.tar.gz.

File metadata

  • Download URL: phenomate_core-0.4.0.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for phenomate_core-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0c1b8e4ee0271281d2d24767e43430374382b84d94de6986587ed7501459e4b0
MD5 84be24e0a30bd332ff3bd9c305fda9f9
BLAKE2b-256 35a8785aa692f81bbe73298c5eeac7ccadf045616137d4419f2b571068a1281a

See more details on using hashes here.

File details

Details for the file phenomate_core-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for phenomate_core-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c84fa86a6d01a2b33d88c3bc3265890f145fd47de12abbe09d009a531db6c5
MD5 536d1a0b408e5c20496763f13b1fc36e
BLAKE2b-256 79e766ec28d872cc8599355d08e4a53c913b09187cda131c8c6e6345bcaf868f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page