n-dimensional case generator.
Project description
farn
farn is an n-dimensional case generator.
Its primary design goal is to parameterize and execute simulation cases. However, at its core, farn is use-case agnostic and can support a wide spectrum of applications.
The name ‘farn’ is inspired by the Barnsley fractal
farn
- runs the sampling of the design space (sampling strategies cover fixed, linSpace, uniformLHS)
- generates the corresponding case folder structure
- copies arbitrary files from a template folder to case folders
- creates case specific parameter files in case folders
- executes user-defined shell command sets in case folders
- builds case specific OSP (co-)simulation files
- runs simulation cases as batch process
Installation
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ farn
farn requires the following two (sub-)packages:
- dictIO: foundation package, enabling farn to handle configuration files in dictIO dict file format.
- ospx: extension package, enabling farn to generate OSP (co-)simulation files.
However, both get installed automatically with farn (just pip install farn and you're done).
Usage Example
farn provides both an API for use inside Python as well as a CLI for shell execution of core functions.
Reading a farnDict file and creating the corresponding case folder structure:
from farn.farn import run_farn
run_farn('farnDict', sample=True, generate=True)
The above task can also be invoked from the command line, using the 'farn' command line script installed with farn:
farn farnDict --sample --generate
For more examples and usage, please refer to farn's documentation on GitHub Pages.
File Format
A farnDict is a file in dictIO dict file format used with farn.
For a documentation of the farnDict file format, see File Format in farn's documentation on GitHub Pages.
For a detailed documentation of the dictIO dict file format used by farn, see dictIO's documentation on GitHub Pages.
Development Setup
-
Install Python 3.10
-
git clone the farn repository into your local development directory:
git clone git://github.com/dnv-opensource/farn.git path/to/your/dev/farn
- In the farn root folder:
Create a Python virtual environment:
python -m venv .venv
Activate the virtual environment:
.venv\Scripts\activate
Update pip and setuptools:
python -m pip install --upgrade pip setuptools
Install farn's dependencies:
pip install -r requirements.txt
Release History
- 0.1.0
- First release
Meta
Copyright (c) 2022 DNV open source
Frank Lumpitzsch – @LinkedIn – frank.lumpitzsch@dnv.com
Claas Rostock – @LinkedIn – claas.rostock@dnv.com
Seunghyeon Yoo – @LinkedIn – seunghyeon.yoo@dnv.com
Distributed under the MIT license. See LICENSE for more information.
https://github.com/dnv-opensource/farn
Contributing
- Fork it (https://github.com/dnv-opensource/farn/fork)
- Create your branch (
git checkout -b fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin fooBar
) - Create a new Pull Request
For your contribution, please make sure you follow the STYLEGUIDE before creating the Pull Request.
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.