:py:mod:`obr.create_tree` ========================= .. py:module:: obr.create_tree Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: obr.create_tree.flatten obr.create_tree.get_path_from obr.create_tree.extract_from_operation obr.create_tree.generate_view obr.create_tree.is_on_requested_parent obr.create_tree.clean_path obr.create_tree.to_dict obr.create_tree.expand_generator_block obr.create_tree.add_variations obr.create_tree.setup_job_doc obr.create_tree.create_tree .. py:function:: flatten(d, parent_key='', sep='/') .. py:function:: get_path_from(operation: dict, value: dict) -> str Derive a view path from schema and the value dict Returns: a view path as string .. py:function:: extract_from_operation(operation: dict, value) -> dict takes an operation dictionary and do some processing It extracts keys path and args from the operation dictionary based on given value. The passed value is used as a selector to create keys path and args. - args are later used to pass it to the selected operation, either the operation contains: 1. {key: key, values: [v1, v2, ...]} or 2. {values: [{k:v1},{k:v2}] } 2. {common: {c1:v1, c2:v2}, values: [{k:v1},{k:v2}] } - the path is derived from the schema key value pair a entry {schema: path/{foo}, values: [{foo: 1}]} will be formatted to path/1 Returns: a dictionary with keys, path and args .. py:function:: generate_view(project: obr.signac_wrapper.operations.OpenFOAMProject, workspace: pathlib.Path, view_path: pathlib.Path, id_path_mapping: dict) Parameters: - workspace: folder that contains the workspace folder - view_path: path where the view should be created - id_path_mapping: dictionary from job.id to relative path name .. py:function:: is_on_requested_parent(operation, parent_job) -> bool Check if operation requests to be on specific parent Returns true if either on correct parent job or no parent was requested .. py:function:: clean_path(path_name: str) -> str Clean path name .. py:function:: to_dict(synced_dict) -> dict .. py:function:: expand_generator_block(operation, base_dict={}) given an operation this function .. py:function:: add_variations(operations: list, project: obr.signac_wrapper.operations.OpenFOAMProject, variation: list, parent_job: signac.job.Job, id_path_mapping: dict) -> list[str] Recursively adds variations to the project and initialises the jobs. This creates the workspace/uid folder and signac files as sideeffect. Returns: A list of all operation names .. py:function:: setup_job_doc(job: signac.job.Job, reset: bool = False) -> None Sets basic information in the job document .. py:function:: create_tree(project: obr.signac_wrapper.operations.OpenFOAMProject, config: dict, arguments: dict, skip_foam_src_check: bool = False)