Skip to main content

The main (non-graphical) interface for the DTOcean tools

Reason this release was yanked:

Dropped Python 3.14 support

Project description

dtocean-core actions codecov PyPI - Python Version

dtocean-core

The dtocean-core module provides the data model and execution environment for the DTOcean suite of tools. It manages data transfer between the DTOcean components (modules, database, user), data storage and versioning, and module execution ordering.

Part of the DTOcean suite of tools.

Installation

pip install dtocean-core

Usage

Command Line Tool (dtocean)

A command line tool is provided for various functions. All commands are available from the dtocean root. For instance:

dtocean -h

dtocean init

The init utility is for calling initialization scripts required before the first run of any installed DTOcean modules. Note that an internet connection is required when running this command. To get help:

dtocean init -h

dtocean core run

The main dtocean core run command can run DTOcean projects saved as .dtop files, either for the next scheduled module or all modules. For help, type:

dtocean core run -h

dtocean core config

Another utility is provided to copy user modifiable configuration files to the users "AppData" directory (on Windows). For instance the logging and database configuration can be modified once these files have been copied. To get help:

dtocean core config -h

dtocean database

This utility is for converting the DTOcean SQL database into a structured directories of files, or for uploading the same structure into the database is provided. To get help:

dtocean database -h

Module subcommands

Utilities provided by installed modules are also available through the dtocean command. For instance, to get help for the commands provided by the dtocean-hydrodynamics package:

dtocean hydrodyamics -h

A list of all available subcommands will be shown when calling dtocean -h.

Jupyter Notebooks

Examples of using dtocean-core are given in Jupyter Notebooks which are found in the "notebooks" folder of the dtocean-core source code.

Development

Development of dtocean-core uses the Poetry dependency manager. Poetry must be installed and available on the command line.

To install:

poetry install

Download data files with the following command:

dtocean init

Tests

Basic Tests

A test suite is provided with the source code that uses pytest. To install the testing dependencies:

poetry install --with test

Additional tests are available for the plugins to dtocean-app. Enable these tests by installing the test-extras group:

poetry install --with test --with test-extras

To run the tests:

poetry run pytest

Database Tests

Database integration tests are available upon the installation of the DTOcean database. Once the database is installed and running, additional options must be provided to the pytest command, with meanings as follows:

Option Meaning
--postgresql-password The password of the root database user
--postgresql-path The path to the database setup files

The database tests use the pytest-postgresql plugin to generate temporary test databases that mirror the DTOcean database schema and tables. Any additional option provided by pytest-postgresql plugin can also be applied to the DTOcean tests (for instance, if the default port is not 5432, it can be set with the --postgresql-port option).

To include the database tests (with example values):

poetry run pytest --postgresql-password="example" --postgresql-path="/path/to/the/database/setup/files"

Multi-Version Tests

The above tests can be run across all compatible Python versions using tox and tox-uv. To install:

poetry install --with tox

To run without the database tests:

poetry run tox

To include the database tests (with example values):

poetry run tox -- --postgresql-password="example" --postgresql-path="/path/to/the/database/setup/files"

Integration Tests

Integration tests are included in the integration directory. These tests are designed to be used in combination with the scripts/make_test_project.py script, which generates a .dtop file, labelled with the OS and Python version used to create it and saved in the test_data/projects directory.

The integration tests will try to open all the project files in the test_data/projects directory. This is primarily useful for testing cross-platform loading of save files and is automated in the GitHub Action workflow for dtocean-core.

To run the tests:

poetry run pytest integration

Contributing

Please see the dtocean GitHub repository for contributing guidelines.

Credits

This package was initially created as part of the EU DTOcean project by:

It is now maintained by Mathew Topper at Data Only Greater.

License

GPL-3.0

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

dtocean_core-4.0.1.tar.gz (145.5 kB view details)

Uploaded Source

Built Distribution

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

dtocean_core-4.0.1-py3-none-any.whl (182.5 kB view details)

Uploaded Python 3

File details

Details for the file dtocean_core-4.0.1.tar.gz.

File metadata

  • Download URL: dtocean_core-4.0.1.tar.gz
  • Upload date:
  • Size: 145.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dtocean_core-4.0.1.tar.gz
Algorithm Hash digest
SHA256 ea72133a3c661b7add767101bb77e293c72fc047d32e98478d1b11552278f835
MD5 0441ddd18c39dcdb197973c07507914b
BLAKE2b-256 ba86851f5815ddd07bb50985fbadb8f437253425743220846797647bea3fe4c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtocean_core-4.0.1.tar.gz:

Publisher: release.yml on DTOcean/dtocean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dtocean_core-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: dtocean_core-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 182.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dtocean_core-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98fc8da168cb49a3d88ef7f125ca8581f74a6bb990d14ffc81a09777d329914b
MD5 a0dd9849ffdac7f71c0aa2701b13da4b
BLAKE2b-256 f8227d15326d6d1a388c1daaa9e6ef40f1a303f2a39d85e9dfad1f34b7e98a02

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtocean_core-4.0.1-py3-none-any.whl:

Publisher: release.yml on DTOcean/dtocean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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