A Python Ocean Particle Image Analysis toolbox.
Project description
PyOPIA
A Python Ocean Particle Image Analysis toolbox
Quick tryout of PyOPIA
- Install uv
- Initialize PyOPIA project with a small example image dataset and run processing
uvx --python 3.12 --from pyopia[classification] pyopia init-project pyopiatest --example-data
cd pyopiatest
uvx --python 3.12 --from pyopia[classification] pyopia process config.toml
- Inspect the processed particle statistics in the processed/ folder
- Merge the individual processed image STATS files into a single STATS.nc file, then create a montage of the processed STATS.nc
uvx --python 3.12 --from pyopia[classification] pyopia merge-mfdata processed
uvx --python 3.12 --from pyopia[classification] pyopia make-montage processed\pyopiatest-STATS.nc
- Visualise the monatge of all processed singular particle images in one
montage.png
Will show you a montage of all the processed particle images in one.
See the documentation for more information on how to install and use PyOPIA.
Documentation:
Current status:
- Under development. See/regester issues, here
Development targets for PyOpia:
- Allow nonfamiliar users to install and use PyOpia, and to contribute & commit code changes
- Not hardware specific
- Smaller dependency list than PySilCam -Eventual optional dependencies (e.g. for classification)
- Can be imported by pysilcam or other hardware-specific tools
- Work on a single-image basis (...primarily, with options for multiprocess to be considered later)
- No use of settings/config files within the core code - pass arguments directly. Eventual use of settings/config files should be handled by high-level wrappers that provide arguments to functions.
- Github workflows
- Tests
Normal functions within PyOpia should:
- take inputs
- return new outputs
- don't modify state of input
- minimum possible disc IO during processing
Contributions
We welcome additions and improvements to the code! We request that you follow a few guidelines. These are in place to make sure the code improves over time.
- All code changes must be submitted as pull requests, either from a branch or a fork.
- Good documentation of the code is needed for PyOpia to succeed and so please include up-to-date docstrings as you make changes, so that the auto-build on readthedocs is complete and useful for users. (A version of the new docs will complie when you make a pull request and a link to this can be found in the pull request checks)
- All pull requests are required to pass all tests before merging. Please do not disable or remove tests just to make your branch pass the pull request.
- All pull requests must be reviewed by a person. The benefits from code review are plenty, but we like to emphasise that code reviews help spreading the awarenes of code changes. Please note that code reviews should be a pleasant experience, so be plesant, polite and remember that there is a human being with good intentions on the other side of the screen.
- All contributions are linted with flake8. We recommend that you run flake8 on your code while developing to fix any issues as you go. We recommend using autopep8 to autoformat your Python code (but please check the code behaviour is not affected by autoformatting before pushing). This makes flake8 happy, and makes it easier for us all to maintain a consistent and readable code base.
Docstrings
Use the NumPy style in docstrings. See style guide here
Installing
For users
Users are expected to be familiar with Python. Please refer to the recommended installation instructions provided on the documentation pages, here
For developers from source
Install (uv)[https://docs.astral.sh/uv/getting-started/installation/]
- Navigate to the folder where you want to install pyopia using the 'cd' command.
If you use git: Download repository from github, and move into the new directory:
git clone https://github.com/SINTEF/pyopia.git
cd pyopia
For the next steps, you need to be located in the PyOPIA root directory that contains the file 'pyproject.toml'.
- Install all requirements with
uv sync --all-extras
- (optional) Run local tests:
uv run pytest
Version numbering
The version number of PyOPIA is split into three sections: MAJOR.MINOR.PATCH
- MAJOR: Changes in high-level pipeline use and/or data output that are not backwards-compatible.
- MINOR: New features that are backwards-compatible.
- PATCH: Backwards-compatible bug fixes or enhancements to existing functionality
Build docs locally
sphinx-apidoc -f -o docs/source docs/build --separate
sphinx-build -b html ./docs/ ./docs/build
License
PyOpia is licensed under the BSD3 license. See LICENSE. All contributors should be recognised & aknowledged.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyopia-2.13.0.tar.gz.
File metadata
- Download URL: pyopia-2.13.0.tar.gz
- Upload date:
- Size: 66.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a212800fb8723b102f19dd9824b0728f867cb2b5df71c401dc46a4925903401
|
|
| MD5 |
30958b8ad0d44c933547abf4f868cabb
|
|
| BLAKE2b-256 |
58737e18e1b0f771412f633b3b7662208443405e1fd46f67e3981e0912e76c9e
|
Provenance
The following attestation bundles were made for pyopia-2.13.0.tar.gz:
Publisher:
pypi.yml on SINTEF/pyopia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyopia-2.13.0.tar.gz -
Subject digest:
1a212800fb8723b102f19dd9824b0728f867cb2b5df71c401dc46a4925903401 - Sigstore transparency entry: 771148891
- Sigstore integration time:
-
Permalink:
SINTEF/pyopia@86e54c2b2f0e15714f593d743740325a23aac8ff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SINTEF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@86e54c2b2f0e15714f593d743740325a23aac8ff -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyopia-2.13.0-py3-none-any.whl.
File metadata
- Download URL: pyopia-2.13.0-py3-none-any.whl
- Upload date:
- Size: 78.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6c9afb81a5213fa239549dc1829f79de9943d8cdff10d725214879ee568d3d9
|
|
| MD5 |
2701866c89739ba093e6cd62d23fb4a5
|
|
| BLAKE2b-256 |
cb04290e7c12105534d6eeaca04aa2569caf5c05de5cf4b290add52f65eb321e
|
Provenance
The following attestation bundles were made for pyopia-2.13.0-py3-none-any.whl:
Publisher:
pypi.yml on SINTEF/pyopia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyopia-2.13.0-py3-none-any.whl -
Subject digest:
d6c9afb81a5213fa239549dc1829f79de9943d8cdff10d725214879ee568d3d9 - Sigstore transparency entry: 771148898
- Sigstore integration time:
-
Permalink:
SINTEF/pyopia@86e54c2b2f0e15714f593d743740325a23aac8ff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SINTEF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@86e54c2b2f0e15714f593d743740325a23aac8ff -
Trigger Event:
push
-
Statement type: