Skip to main content

Run experiments on the Positron Cloud

Project description

Positron Decorator

A Python decorator to handle deploying your code into the Positron Cloud.

Installation

Install the package from PyPi:

pip install positron_networks

Usage

Command Line Arguments

  • -l, --local: Run the script on your local machine. Overwrites --positron-deploy.
  • --positron-deploy: Deploy your script into Positron Cloud.
  • --stream-stdout: Stream the stdout from Positron Cloud back to your CLI.
  • --debug: Get more detailed error messages.

Example

  1. Define your function and apply the @positron_sync decorator with the necessary parameters:
from positron-networks import positron_sync

@positron_sync(
    funding_group='your_funding_group_id',
    image_name='your_image_name',
    environment_id='your_environment_id',
    workspace_dir='your_workspace_dir',
    entry_point='your_entry_point_script'
)
def my_function():
    print("Running my function")

if __name__ == "__main__":
    my_function()
  1. Run your script with the desired arguments:
python your_script.py --positron-deploy --stream-stdout

Configuration

Ensure you have a configuration file located at ~/.positron/config.ini with the following structure:

[DEFAULT]
UserAuthToken=your_user_auth_token

Detailed Error Messages

To enable detailed error messages, run your script with the --debug flag:

python your_script.py --positron-deploy --debug

Handling Interruptions

The script handles SIGINT (Ctrl+C) gracefully, allowing for proper cleanup and exit.

License

This project is licensed under the Apache 2 License. See the LICENSE file for details.

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

positron_networks-0.1.7.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

positron_networks-0.1.7-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file positron_networks-0.1.7.tar.gz.

File metadata

  • Download URL: positron_networks-0.1.7.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for positron_networks-0.1.7.tar.gz
Algorithm Hash digest
SHA256 61faef125a9ef83f259e03695602853ae565a7c4e87841a32523f397ab16586c
MD5 e406579ef2d10599bcfbdc2db948af5e
BLAKE2b-256 363bbbdbdcae7b0500eaf97c40c490d2edf519cb6b688bddfbdc9136cbf16757

See more details on using hashes here.

File details

Details for the file positron_networks-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for positron_networks-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1817ed1788db81bbaa0ef6741ef54b456441dbc7e6cccc91857219a857d1ac15
MD5 93f19ab91101858f0af920ab39fb591b
BLAKE2b-256 2da14bf54ad75d5cebb077ca485a12f3605176cbcc313dcad898122aa6d9c199

See more details on using hashes here.

Supported by

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