https://github.com/cogment/cogment-py-sdk

Cogment Python SDK

https://github.com/cogment/cogment-py-sdk

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

cogment python
Last synced: 9 months ago · JSON representation

Repository

Cogment Python SDK

Basic Info
Statistics
  • Stars: 12
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
cogment python
Created over 5 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License

README.md

cogment-py-sdk

Latest final release Apache 2 License Changelog

Cogment is an innovative open source AI platform designed to leverage the advent of AI to benefit humankind through human-AI collaboration developed by AI Redefined. Cogment enables AI researchers and engineers to build, train and operate AI agents in simulated or real environments shared with humans. For the full user documentation visit https://docs.cogment.ai

This module, cogment-py-sdk, is the Python SDK for making use of Cogment when working with Python. It's full documentation can be consulted at https://docs.cogment.ai/cogment/cogment-api-reference/python/.

Developers

Prerequisites

Make sure you have the following installed:

Install dependencies

We recommend using a virtualenv to isolate your dependencies. On most unix flavors you create and activate this by running the following:

console $ python -m venv .venv $ source .venv/bin/activate

once you are finished with the virtualenv you can deactivate it by running:

console $ deactivate

Install the dependencies, including downloading and building the cogment protobuf API by running the following:

console $ pip install -r requirements.txt $ python -m setup develop

The second line will call the following setup.py commands to deal with the cogment API (those can also be called seprately)

console $ python -m setup retrieve_cogment_api $ python -m setup build_cogment_api_protos

Define used Cogment protobuf API

The version of the used cogment protobuf API is defined in the .cogment-api.yaml file at the root of the repository. The following can be defined:

  • cogment_version: "latest", is the default, it retrieves the api from the latest Cogment release (excluding pre-releases),
  • cogment_version: "vMAJOR.MINOR.PATCH[-PRERELEASE]", retrieves the api from any Cogment release.
  • cogment_api_path: "../RELATIVE/PATH/TO/LOCAL/COGMENT/INSTALL/include/cogment/api", retrieves a local version of the api found at the given path (e.g. common.proto should be at ${cogment_api_path}/common.proto); if set, this overrides cogment_version.

After any change, do not forget to run pip install -e . for it to be taken into account.

Tests

Integration tests

These tests launch and use Cogment, by default they'll use they'll download and use the latest released version of Cogment.

console $ pytest --launch-orchestrator

The following environment can be defined to change this behavior, either directly in the terminal or in a .env file located at the root of the repository:

bash COGMENT_PATH="/path/to/cogment" # local path to cogment binary COGMENT_VERSION="v2.2.0" # cogment version to download

Lint

Run the pycodestyle using

console $ pycodestyle

Run the mypy type annotations checks using

console $ mypy .

Check conflicting dependencies with "popular" Python packages

console ./scripts/check_dependencies_conflicts.sh

This script will check for conflicts required by the cogment-py-sdk and the popular Python packages in the AI/ML/Data ecosystem.

Build the source package

Build the source package

console python -m build

Release process

People having mainteners rights of the repository can follow these steps to release a version MAJOR.MINOR.PATCH. The versioning scheme follows Semantic Versioning.

  1. Run ./scripts/create_release_branch.sh MAJOR.MINOR.PATCH to create the release branch and update the version of the package,
  2. On the release branch, check and update the changelog if needed,
  3. Make sure ./.cogment-api.yaml specifies fixed version to ensure rebuildability,
  4. Make sure everything's fine on CI,
  5. Run ./scripts/tag_release.sh MAJOR.MINOR.PATCH to create the specific version section in the changelog, merge the release branch in main, create the release tag and update the develop branch with those.

The rest, publishing the package to PyPI and updating the mirror repositories, is handled directly by the CI.

Owner

  • Name: Cogment
  • Login: cogment
  • Kind: organization

GitHub Events

Total
  • Fork event: 2
Last Year
  • Fork event: 2

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 183 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 4
  • Total versions: 75
  • Total maintainers: 2
pypi.org: cogment

Cogment python SDK

  • Versions: 75
  • Dependent Packages: 0
  • Dependent Repositories: 4
  • Downloads: 183 Last month
Rankings
Dependent repos count: 7.5%
Downloads: 8.0%
Average: 8.5%
Dependent packages count: 10.1%
Maintainers (2)
Last synced: 10 months ago

Dependencies

pyproject.toml pypi
  • grpcio >=1.42, <1.45
  • grpcio-reflection >=1.42, <1.45
  • prometheus-client >= 0.8, <0.9
  • protobuf ~=3.7
requirements.txt pypi
  • PyYAML *
  • build >=0.8.0,<0.9
  • click *
  • grpcio >=1.42,<1.45
  • grpcio-reflection >=1.42,<1.45
  • grpcio-tools ==1.43
  • mock >=4.0.3,<4.1
  • mypy >=0.950,<0.951
  • prometheus-client >=0.8,<0.9
  • protobuf *
  • pycodestyle >=2.6.0,<2.7
  • pytest >=6.1.1,<6.2
  • pytest-asyncio >=0.14.0,<0.15
  • pytest-dotenv >=0.5.2,<0.6
  • pytest-timeout >=1.4.2,<1.5
  • twine ==4.0.0
  • types-PyYAML ==6.0.7
  • types-protobuf ==3.19.21
setup.py pypi