Package: farn
farnfarnis 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 theBarnsley fractalfarnruns the sampling of the design space (sampling strategies cover fixed, linSpace, uniformLHS)generates the corresponding case folder structurecopies arbitrary files from a template folder to case folderscreates case specific parameter files in case foldersexecutes user-defined shell command sets in case foldersbuilds case specific OSP (co-)simulation filesruns simulation cases as batch processInstallationpipinstallfarnfarn 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 Examplefarn 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:fromfarnimportrun_farnrun_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:farnfarnDict--sample--generateFor more examples and usage, please refer tofarn's documentation.Further, thefarn-demorepository on GitHub is an excellent place for a jumpstart into farn.
Simply clone thefarn-demorepository to your local machine and click through the demos and related READMEs, by recommendation in the following sequence:README in root folder -> guides you through installation of farn
\ospCaseBuilder Demo (see README in ospCaseBuilder folder)
\farn Demo (see README in farn folder)
\importSystemStructure  Demo (see README in importSystemStructure folder)File FormatA farnDict is a file in dictIO dict file format used with farn.For a documentation of the farnDict file format, seeFile Formatinfarn's documentationon GitHub Pages.For a detailed documentation of the dictIO dict file format used by farn, seedictIO's documentationon GitHub Pages.Development SetupInstall Python 3.9 or higher, i.e.Python 3.10orPython 3.11Update pip and setuptools:python-mpipinstall--upgradepipsetuptoolsgit clone the farn repository into your local development directory:gitclonehttps://github.com/dnv-opensource/farnpath/to/your/dev/farnIn the farn root folder:Create a Python virtual environment:python-mvenv.venvActivate the virtual environment:..on Windows:>.venv\Scripts\activate.bat..on Linux:source.venv/bin/activateUpdate pip and setuptools:(.venv)$python-mpipinstall--upgradepipsetuptoolsInstall farn's dependencies:(.venv)$pipinstall-rrequirements-dev.txtThis should return without errors.Finally, install farn itself, yet not as a regular package but as aneditablepackage instead, using the pip install option -e:(.venv)$pipinstall-e.Test that the installation works (in the farn root folder):(.venv)$pytest.MetaCopyright (c) 2024DNVopen sourceFrank Lumpitzsch –@LinkedIn–frank.lumpitzsch@dnv.comClaas Rostock –@LinkedIn–claas.rostock@dnv.comSeunghyeon Yoo –@LinkedIn–seunghyeon.yoo@dnv.comDistributed under the MIT license. SeeLICENSEfor more information.https://github.com/dnv-opensource/farnContributingFork it (https://github.com/dnv-opensource/farn/fork)Create your branch (git checkout -b myBranchName)Commit your changes (e.g.git commit -m 'place a descriptive commit message here')Push to the branch (e.g.git push origin myBranchName)Create a new Pull Request in GitHubFor your contribution, please make sure you follow theSTYLEGUIDEbefore creating the Pull Request.