Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/source/fileFormat.farnDict.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ A farnDict
| _layers | dict | dict defining all layers. Each layer represents one nest level in the folder structure that will be generated by farn. |
| &numsp;\<LAYER> | dict | unique key defining a layer. It serves as basename for all case folders in the nest level corresponding with that layer. |
| &numsp;&numsp;_sampling | dict | dict defining sampling-type and -parameters of a layer |
| &numsp;&numsp;&numsp;_type | string | sampling type. Choices currently implemented are {'fixed', 'linSpace', 'uniformLhs', 'normalLhs', 'sobol', 'hilbertCurve'} |
| &numsp;&numsp;&numsp;_type | string | sampling type. Choices currently implemented are: |
| | | factorial: Sklearn full-factorial implementation, re-normailized to given ranges. Note that a factorial can also be achieved by cascaded linSpace layers, introducing additional hierarchy. |
| | | fixed: List of fixed values. |
| | | linSpace: Linear spacing of one dimension. Note that it places n points covering the outer limits as given in _ranges. |
| | | uniformLhs: Uniformly distributed latin-hypercube sampling. |
| | | normalLhs: Gaussian normal distributed latin-hypercube sampling. |
| | | sobol: Sobol sampling. Note that for a lower auto correlation, the parameter _onset can be given defining a later starting point in the sequence. |
| | | hilbertCurve: Hilbert multi-dimensional space-filling curve implementation. Note that the _numberOfSamples points are interpolated between start end end point. |
| &numsp;&numsp;&numsp;_names | list[string] | list naming all variables / parameters being varied in this layer. For each variable / parameter named here, sampled values will be generated. |
| &numsp;&numsp;&numsp;_values | list[list[*float]] | (required for sampling type 'fixed'): List containing lists of fixed values. For each parameter name defined in _names, one list of fixed values must exist, i.e. the number of lists in _values must match the number of parameter names defined in _names. The number of values can freely be chosen. However, all lists in _values must have the same number of values. |
| &numsp;&numsp;&numsp;_ranges | list[list[float,&nbsp;float]] | (required for sampling types 'linSpace', 'uniformLhs' and 'hilbertCurve'): List containing ranges. A range is defined through the lower and upper boundary value for the related parameter name, given as tuple (minimum, maximum). For each parameter name defined in _names, one range tuple must exist. |
| &numsp;&numsp;&numsp;_numberOfSamples | int | (required for sampling types 'linSpace', 'uniformLhs' and 'hilbertCurve'): Number of samples to be generated. In case of 'linSpace', boundary values are included if an odd number of samples is given. In case of 'uniformLHS', the given number of samples will be generated within range (=between lower and upper boundary), excluding the boundaries themselves. |
| &numsp;&numsp;&numsp;_includeBoundingBox | bool | (optional, for sampling type 'uniformLhs', 'sobol' and 'hilbertCurve'): Defines whether the lower and upper boundary values of each parameter name shall be added as additional samples. If missing, defaults to FALSE. |
| &numsp;&numsp;&numsp;_listOfSamples | list[int] | (required for sampling type 'factorial'): Number of samples to be generated per dimension. The total _numberOfSamples is calculated automatically. Note that each entry per dimension has to be larger or equal 2 for proper function of factorial. Note that the _includeBoundingBox parameter is obsolete and must not be given here. |
| &numsp;&numsp;&numsp;_includeBoundingBox | bool | (optional, for sampling type 'uniformLhs', 'sobol' and 'hilbertCurve'): Defines whether the lower and upper boundary values of each parameter name shall be added as additional samples. If missing, defaults to FALSE. Note that if invoked for sampling type 'hilbertCurve', the parameter adds two coinciding sample points: the starting and the end point of the distribution. |
| &numsp;&numsp;&numsp;_iterationDepth | int | (optional, for sampling type 'hilbertCurve'): Defines the hilbert iteration depth, default: 10. |
| &numsp;&numsp;_condition | dict | (optional) a condition allows to define a filter expression to include or exclude specific samples. (see [Filtering of Cases](#filtering-of-cases)) |
| &numsp;&numsp;&numsp;_filter | string | filter expression (see [Filter Expression](#filter-expression)) |
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies = [
"pillow>=12.1",
"pyDOE3>=1.6.2",
"psutil>=7.2",
"scikit-learn>=1.6",
"hilbertcurve>=2.0",
"dictIO>=0.4.4",
"ospx>=0.3.5",
Expand Down Expand Up @@ -119,7 +120,7 @@ required-environments = [


[project.scripts]
farn = "farn.cli.__main__:main"
farn = "farn.cli.farn:main"
batchProcess = "farn.cli.batchProcess:main"


Expand Down
8 changes: 8 additions & 0 deletions src/farn/cli/__main__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def main() -> None:
# ..to console
# NOTE: Default would usually be 'WARNING', but for farn it makes sense to set default level to 'INFO'
log_level_console: str = "INFO"
)
if any([args.quiet, args.verbose]):
log_level_console = "ERROR" if args.quiet else log_level_console
log_level_console = "DEBUG" if args.verbose else log_level_console
Expand All @@ -179,6 +180,8 @@ def main() -> None:
# Check whether farn dict file exists
if not farn_dict_file.is_file():
logger.error(f"farn: File {farn_dict_file} not found.")
# easter egg: Generate Barnsley fern
# _generate_barnsley_fern()
return

# Print the parsed commandline arguments for documentation and debugging purposes.
Expand Down Expand Up @@ -225,10 +228,15 @@ def _generate_barnsley_fern() -> None:
"""
import tempfile # noqa: PLC0415
import tkinter as tk # noqa: PLC0415
import tempfile
import tkinter as tk

from numpy import random # noqa: PLC0415
from PIL import Image # noqa: PLC0415
from PIL.ImageDraw import ImageDraw # noqa: PLC0415
from numpy import random
from PIL import Image
from PIL.ImageDraw import ImageDraw

def t1(p: tuple[float, float]) -> tuple[float, float]:
"""1%."""
Expand Down
Loading
Loading