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
Building
From the root of the repo:
python3 -m build
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
- Define your function and apply the
@positron_sync
decorator with the necessary parameters:
from positron 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()
- 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
Built Distribution
File details
Details for the file positron_networks-0.1.4.tar.gz
.
File metadata
- Download URL: positron_networks-0.1.4.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51bcc7d75a229803019b8df920c1811c1d20b94a5fcc0e51f31aec1e92be090a |
|
MD5 | 6c1f0ac76fba6229e0b00f4ab5cf6682 |
|
BLAKE2b-256 | 8402f138f680539ad62daca172bbd5c39ccca40a08d24a49c659d6663b29de13 |
File details
Details for the file positron_networks-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: positron_networks-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8536a87629956fe123393e8dd3e842ce83ebdb14fb875157c514119f860cf4f |
|
MD5 | 9a6ecbbf8001c3d22dc058e88cd04f3f |
|
BLAKE2b-256 | b896df943da91e11a99b4e22c7bf73a5cf115f1e2d954f014aa1ad76152d4994 |