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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: positron_networks-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 141a32fc00a4ca22775e9139f734514cce79a736eeb629c51e767e46d4bfbd2c
MD5 0e161f551816cd0190e566d6256c1958
BLAKE2b-256 e43c661632fd95053bbe0a83287be654ac0590ed9f4ecc2f484eefa3866c4047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for positron_networks-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 976b9d7277fc78eb2956b692e41cde159481ab015999190893bd584d73a3162d
MD5 031ef723341e5424d5fa9439d8470ee6
BLAKE2b-256 3ca4c8d776c024a2b09dabe079911cdce4ac16678ae669e027457fb618fed288

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