Runs python script in specified argument combinations and produces a pandas dataframe of all results.
Project description
args_to_db - An Argument Optimisation Data Generation Tool
pip install args_to_db
You want to analyze a (python) script for different arguments/settings? - Argument optimization is becoming more and more important in many application areas. args_to_db is an attempt to generalize and simplify the process of running a programm in different modes or configurations and combining the resulting datasets to allow for further analysis.
When should I use args_to_db?
You have a programm which is very general in its application, for example a solver framework for linear system of equations. This could look something like
python solver.py A b [--solver SOLVER] [--preconditioner PRECONDITIONER]
Different inputs vary performance of solving methods dramatically. So we want to optimize the solver and preonditiner used for a specific linear system of equations.
How do I use args_to_db?
So we want to compare different argument configurations. args_to_db takes them in the array form:
argument_configurations = [['--solver', 'cg'],
['--solver', 'cg', '--preconditioner', 'jacobi'],
['--solver', 'lu']]
And then we run all cases via:
args_to_db.run('solver.py', argument_configurations, threads=3)
This spawns upto 3 concurrent processes each running the specified command. As complex applications are mostly reliant on argument optimisations, parallel execution is supported intuitively.
Data collection
We want to run the test cases individually and not inside a bigger (benchmarking) framework, but spawning different process yields the problem of data collection. Therfore the scripts internally log the results and args_to_db handles combination of those later on.
args_to_db.add_result('solver_time', 20.3)
args_to_db.add_result('solver_state', 'converged')
args_to_db.write_results(__file__, args) # args currently is an argparse object
This results in single file outputs of each script. Which are then combined into a single pandas dataframe after all simulations are completed.
Project details
Release history Release notifications | RSS feed
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
Hashes for args_to_db-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d6e8e64e61d159ef7a3e7c5aeea1477715d88fc4917c3f0e529417bd00555c |
|
MD5 | ec1f9b87fddb1a581757437e4e973cd8 |
|
BLAKE2b-256 | 74af3fac4a75a548498d98b0808a8024269a5602a2404f1754730c68a49e8599 |