Skip to main content

Psyrun

https://travis-ci.org/jgosmann/psyrun.svg?branch=master https://coveralls.io/repos/github/jgosmann/psyrun/badge.svg?branch=master

Psyrun is a Python tool to define parameter spaces and execute an evaluation function for each parameter assignment. In addition Psyrun makes it easy to use serial farming, i.e. evaluating multiple parameter assignments in parallel, on a multicore computers and high-performance clusters.

Documentation

The documentation can be found here.

Overview

Define parameter spaces and evaluate them:

from psyrun import map_pspace, Param

def objective(a, b, c):
    return a * b + c

pspace = (Param(a=np.arange(1, 5))
          * Param(b=np.linspace(0, 1, 10))
          * Param(c=[1., 1.5, 10., 10.5]))
results = map_pspace(objective, pspace)

Or do it in parallel:

from psyrun import map_pspace_parallel
results = map_pspace_parallel(objective, pspace)

Define tasks by placing task_<name>.py files in the psy-tasks` directory:

from psyrun import Param

pspace = (Param(a=np.arange(1, 5))
          * Param(b=np.linspace(0, 1, 10))
          * Param(c=[1., 1.5, 10., 10.5]))

def execute(a, b, c):
    return {'result': a * b + c}

and run them by typing psy run with support for serial farming on high performance clusters.

Installation

pip install psyrun

To be able to use the NPZ store:

pip install numpy
pip install 'psyrun[npz]'

To be able to use the HDF5 store:

pip install numpy
pip install 'psyrun[h5]'

Requirements

Optional requirements

To have faulthandler activated for jobs submitted with psy run in Python 2.7:

Python 3.4+ already includes the faulthandler module.

To use map_pspace_parallel:

To use NPZ files as store:

To use HDF5 files as store:

To run the unit tests:

To build the documentation:

Changes

0.8.0 (June 26, 2018)

New features

  • Added the possibility to specify a setup function in task files that will be executed once at the start of each worker process and can be used to acquire resources and pass them to the processing function for individual parameter sets.

0.7.1 (April 19, 2018)

Documentation improvements

  • Added documentation for the pool_size task attribute and included it in the task template.

Bug fixes

  • Allow to continue tasks if results are missing even if the result file is newer than the task file.

0.7.0 (February 18, 2018)

New features

  • Added support for the Slurm Workload Manager.

0.6.0

New features

  • Add psy new-task and psy kill commands.

  • Added AutodetectStore that determines the appropriate store from the filename extension.

  • Added possibility to let psy merge custom stores if provided as psyrun.stores entry point.

  • Added capability to set scheduler arguments based on the job name.

0.5.4

Bug fixes

  • Fix the psy run continue functionality.

0.5.3

Bug fixes

  • Fix psy status and psyrun.backend.distribute.DistributeBackend.get_missing trying to read incompatible data files in the output directory.

  • Fix psy status and psyrun.backend.distribute.DistributeBackend.get_missing easily hitting Python’s recursion depth limit.

  • Fix merging of npz files with missing integer values by converting them to float where np.nan can be used.

0.5.2

Bug fixes

  • Fix incorrect psy status.

  • Fix psy run <task1> <task2> ... not running all tasks and run them in order.

0.5.1

Bug fixes

  • Fix psy merge always assuming PickleStore.

Documentation improvements

  • Add recipe for converting data to Pandas data frame to documentation.

0.5

  • Initial release

Release files for psyrun 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psyrun 0.8.0
File Size Uploaded
psyrun-0.8.0.tar.gz 57.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for psyrun 0.8.0
File Interpreter ABI Platform
psyrun-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 95.6 kB

Release files / psyrun-0.8.0.tar.gz

Download URL psyrun-0.8.0.tar.gz
Size 57.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6ad9e89a151777d6618b768a33b4a9d63c989c873ac62f8af294f52dcfec7554
BLAKE2b-256 checksum
How to use checksums
4439ed9d665cb7af7deb023b753b07a526cafaf43cd85afa8b8deba66372c3d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / psyrun-0.8.0-py3-none-any.whl

Download URL psyrun-0.8.0-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1638d2cc46c1894e2a83c6e9fd6eef8c4efe25f0c0dd57ca4438e430fc8b5a53
BLAKE2b-256 checksum
How to use checksums
97be600195c6ad7a02765b099862f9cc58d6656fd3288a5b3e22ac4f8f661289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page