Skip to main content

Run expiriments 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.5.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: positron_networks-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 644cdde9398c1585b9a7d5f14b3c735c055f4ec03cc4e5875d1b776e0bfac9b8
MD5 742456291d30f12e6d9c02c33e6f30cd
BLAKE2b-256 f84d49aa2d28844c95c9dc1b33f5e7e82bea53fa1d1c7777f993663dd4302a10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for positron_networks-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 45769799018e9c1d26c8a20ed06491da5cfc46432e76049721ce136511b03167
MD5 d96601beea44a95337d2f7e41a27831e
BLAKE2b-256 4582e9fe61567707ab275bd8367c98d1666c3d3636804c31526336770cfde20a

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