Skip to main content

Album is a framework for unifying computational tools across frameworks, languages, and environments.

Project description

Album plugin for distributed calls

This is an early version of enhancing album with calls for batch and distributed processing.

Installation

  1. install Album
  2. Activate the album environment:
micromamba activate album
  1. Install this plugin:
micromamba install album-distributed -c conda-forge

Or via pip:

pip install album-distributed

Usage

Fist, install a solution - replace solution.py with the path to your solution / solution folder or with the group:name:version coordinates of your solution.

album install solution.py

Now you can use the plugin:

album run-distributed solution.py

The plugin does two things:

  1. It figures out if the input arguments match multiple tasks - in this case, it generates the different task arguments.
  2. It runs all matching tasks, the mode for running these tasks can be chosen.

Since the matching part can be tricky, please use the --dry-run argument to first print a list of matched tasks:

album run-distributed solution.py --dry-run

On Windows, replace the slashes with backslashes in the examples on this page.

Please let us know if you run into issues.

Matching input arguments

To generate multiple tasks, patterns in file name arguments can be used to match multiple files.

Using patterns in a single argument

You should be able to use all glob features when using it in a single argument. Here are some examples:

In the following scenarios solution.py has an argument called input_data.

Match all .tif files in the current folder:

album run-distributed solution.py --input_data *.tif

Match all .tif files in a specific folder where the file name starts with input:

album run-distributed solution.py --input_data /data/input*.tif

Match all .tif files recursively, starting from the current folder:

album run-distributed solution.py --input_data **/*.tif

Using patterns in multiple arguments

When using patterns in multiple arguments, this plugin will try to figure out the corresponding argument values based on which of the patterns match with existing files. This is likely to fail in a bunch of situations - please use the --dry-run argument to test if the matched tasks correspond with your expectation.

In the following scenarios solution.py has two arguments called input_data and output_data.

Use all .tif files in the current folder and append _out to the file name for the output argument.

album run-distributed solution.py --input_data *.tif --output_data *_out.tif

Do the same thing recursively:

album run-distributed solution.py --input_data **/*.tif --output_data **/*_out.tif

Let the output argument values live in a different folder:

album run-distributed solution.py --input_data *.tif --output_data output/*.tif

Since Album does not yet distinguish between input and output arguments, be aware that if the output_data argument in these scenarios matches existing files, the plugin will also try to generate corresponding input_file values. We will work on improving this.

Modes

You can set the mode by using the --mode argument:

album run-distributed solution.py --mode queue

By default, the plugin will use the basic mode.

Basic

In this mode, all tasks will be performed one after each other. The console output of each task will be printed.

Queue

In this mode, a set of thread workers will be created to process tasks in parallel. The console output of each task will not be printed. You can control how many threads should be created with the --threads argument:

album run-distributed solution.py --mode queue --threads 16

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

album_distributed-0.2.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

album_distributed-0.2.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file album_distributed-0.2.1.tar.gz.

File metadata

  • Download URL: album_distributed-0.2.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for album_distributed-0.2.1.tar.gz
Algorithm Hash digest
SHA256 78d4d10b8735f764d877cc7d6deed341ce1c5833acafdcbe6c7828b293956b14
MD5 717b2e675315cb27f55f0dfcc2db4660
BLAKE2b-256 74554f387b2b97f99e49432ca43bc1d45fa12a3e687210ea15f31af80a9ca190

See more details on using hashes here.

File details

Details for the file album_distributed-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for album_distributed-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d71ff7ef77ba6365dce6adc869241bbb455a1a61c1ad6ab59ad440a0284d3b4d
MD5 e68ab3844ba32383694b17f961212855
BLAKE2b-256 8efb67b16370d54fa27aaade6de9fc792703a3d421d6cab08ab7cac4e547d8d1

See more details on using hashes here.

Supported by

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