litreview
Maps a parameter sweep to an int and then back again.
Install
pip3 install s2i2a
Usage
s2i2a <direction> <command> <sweep arguments>
The goal is to support all the sweep syntax used by hydra's default sweeper.
But for now, s2i2a just supports sweeps of the shape arg=val1,val2,val3,....
A help message is also provided
s2i2a --help
Sample usage
Call s2i2a s2i with all the shell arguments necessary to run your script, plus your script's arguments, plus your sweeps.
s2i2a s2i python3 train.py \
'non-sweep argument' another_non-sweep_arg \
arg1=val1,val2 arg2=val3,val4,val5
This generates a s2i.txt file in your local directory containing
arg1=val1 arg2=val3
arg1=val1 arg2=val4
arg1=val1 arg2=val5
arg1=val2 arg2=val3
arg1=val2 arg2=val4
arg1=val2 arg2=val5
python3 train.py 'non-sweep argument' another_non-sweep_arg
You then build a Docker/Singularity image containing said file, and you install s2i2a inside that image.
Then you can call at the end of a .sh file (say, an SBATCH script containing $SLURM_ARRAY_TASK_ID):
s2i2a i2a 3
This calls execvp, and replaces s2i2a's process by
python3 train.py 'non-sweep argument' another_non-sweep_arg arg1=val2 arg2=val3
Quick debugging
You probably don't want to mess up your sweeps after uploading to the cluster.
Instead, you can invoke test_s2i2a.py. This will run a dummy execvp invokation and will print
what arguments got passed to the script. Be aware that it will rewrite the path of the script to point to s2i2a's installation folder.
Metadata
Release files for s2i2a 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| s2i2a-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for s2i2a-0.0.9-py3-none-any.whl |
Release files / s2i2a-0.0.9-py3-none-any.whl
| Download URL | s2i2a-0.0.9-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f24e020214379c5adc598285c247854a892f238132639f4b99a32106e5453341
|
|
BLAKE2b-256 checksum How to use checksums |
c345e5a1e62724d47544b0910a0e1f2e679ea4419ad0f652ac2ec84a9aead755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.16
|
Security for s2i2a 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.