3 ms·
Show HN: Functioneer – Do eng/sci analysis in <5 lines of code
Hi HN, first post here!
Functioneer is the ultimate batch runner. Prepare to be an analysis ninja. I hope to get it out there and get some feedback!
I worked as a solar thermal engineer for years and was always shocked there was no tool that made optimization and higher dimension parameter testing easy. So as soon as I learned to code last year, I made one.
With Functioneer, every analysis is a series of steps where you can define parameters, create branches, and execute or optimize a function and save the results as parameters. You can add as many steps as you like, applied to all branched simultaneously. This is really powerful!
Example: Test any function you like across a grid of parameters (this example uses the popular Rosenbrock function):
```python
import functioneer as fn
# Insert your function here!
def rosenbrock(x, y, a, b):
return (a-x)*2 + b(y-x*2)*2
# Create analysis module with initial parameters
anal = fn.AnalysisModule({'a': 1, 'b': 100, 'x': 1, 'y': 1})
# test over a grid of 'x' and 'y' values
anal.add.fork('x', (0, 1, 2))
anal.add.fork('y', (1, 10))
anal.add.execute(func=rosenbrock)
print(anal.run()['df'][['x', 'y', 'rosenbrock']])
```
```
Example Output:
a b x y rosenbrock
0 1 100 0 1 101
1 1 100 0 10 10001
2 1 100 1 1 0
3 1 100 1 10 8100
4 1 100 2 1 901
5 1 100 2 10 3601
```