type_name |
deserialize.file |
The registered name for this item type. |
documentation |
description |
Deserialize data to a 'file' value instance. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
DeserializeFileModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.DeserializeFileModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
deserialize.file_bundle |
The registered name for this item type. |
documentation |
description |
Deserialize data to a 'file' value instance. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
DeserializeFileBundleModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.DeserializeFileBundleModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
deserialize.from_json |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
DeserializeFromJsonModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.serialization |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.serialization.DeserializeFromJsonModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
value: Value = inputs.get_value_obj("value")
serialized: SerializedData = value.serialized_data
chunks = serialized.get_serialized_data(self.get_config_value("result_path"))
assert chunks.get_number_of_chunks() == 1
_data = list(chunks.get_chunks(as_files=False))
assert len(_data) == 1
_chunk: bytes = _data[0] # type: ignore
deserialized = orjson.loads(_chunk)
outputs.set_value("python_object", deserialized)
|
The source code of the process method of the module. |
type_name |
export.file |
The registered name for this item type. |
documentation |
description |
Export files. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ExportFileModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.ExportFileModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
target_profile: str = self.get_config_value("target_profile")
source_type: str = self.get_config_value("source_type")
export_metadata = inputs.get_value_data("export_metadata")
source_obj = inputs.get_value_obj(source_type)
source = source_obj.data
func_name = f"export__{source_type}__as__{target_profile}"
if not hasattr(self, func_name):
raise Exception(
f"Can't export '{source_type}' value: missing function '{func_name}' in class '{self.__class__.__name__}'. Please check this modules documentation or source code to determine which source types and profiles are supported."
)
base_path = inputs.get_value_data("base_path")
if base_path is None:
base_path = os.getcwd()
name = inputs.get_value_data("name")
if not name:
name = str(source_obj.value_id)
func = getattr(self, func_name)
# TODO: check signature?
base_path = os.path.abspath(base_path)
os.makedirs(base_path, exist_ok=True)
result = func(value=source, base_path=base_path, name=name)
if isinstance(result, Mapping):
result = DataExportResult(**result)
elif isinstance(result, str):
result = DataExportResult(files=[result])
if not isinstance(result, DataExportResult):
raise KiaraProcessingException(
f"Can't export value: invalid result type '{type(result)}' from internal method. This is most likely a bug in the '{self.module_type_name}' module code."
)
if export_metadata:
metadata_file = Path(os.path.join(base_path, f"{name}.metadata"))
value_info = source_obj.create_info()
value_json = value_info.json()
metadata_file.write_text(value_json)
result.files.append(metadata_file.as_posix())
# schema = ValueSchema(type=self.get_target_value_type(), doc="Imported dataset.")
# value_lineage = ValueLineage.from_module_and_inputs(
# module=self, output_name=output_key, inputs=inputs
# )
# value: Value = self._kiara.data_registry.register_data(
# value_data=result, value_schema=schema, lineage=None
# )
outputs.set_value("export_details", result)
|
The source code of the process method of the module. |
type_name |
file_bundle.pick.file |
The registered name for this item type. |
documentation |
description |
Pick a single file from a file_bundle value. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
PickFileFromFileBundleModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.PickFileFromFileBundleModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
file_bundle: FileBundle = inputs.get_value_data("file_bundle")
path: str = inputs.get_value_data("path")
if path not in file_bundle.included_files.keys():
raise KiaraProcessingException(
f"Can't pick file '{path}' from file bundle: file not available."
)
file: FileModel = file_bundle.included_files[path]
outputs.set_value("file", file)
|
The source code of the process method of the module. |
type_name |
file_bundle.pick.sub_folder |
The registered name for this item type. |
documentation |
description |
Pick a sub-folder from a file_bundle, resulting in a new file_bundle. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
PickSubBundle |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.PickSubBundle |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
file_bundle: FileBundle = inputs.get_value_data("file_bundle")
sub_path: str = inputs.get_value_data("sub_path")
result = {}
for path, file in file_bundle.included_files.items():
if path.startswith(sub_path):
result[path] = file
if not result:
raise KiaraProcessingException(
f"Can't pick sub-folder '{sub_path}' from file bundle: no matches."
)
new_file_bundle: FileBundle = FileBundle.create_from_file_models(
result, bundle_name=f"{file_bundle.bundle_name}_{sub_path}"
)
outputs.set_value("file_bundle", new_file_bundle)
|
The source code of the process method of the module. |
type_name |
import.file |
The registered name for this item type. |
documentation |
description |
Import a file from the local filesystem. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ImportFileModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.ImportFileModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
path = inputs.get_value_data("path")
file = FileModel.load_file(source=path)
outputs.set_value("file", file)
|
The source code of the process method of the module. |
type_name |
import.file_bundle |
The registered name for this item type. |
documentation |
description |
Import a folder (file_bundle) from the local filesystem. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ImportFileBundleModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.filesystem |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.filesystem.ImportFileBundleModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
path = inputs.get_value_data("path")
include = self.get_config_value("include_file_types")
exclude = self.get_config_value("exclude_file_types")
config = FolderImportConfig(include_files=include, exclude_files=exclude)
file_bundle = FileBundle.import_folder(source=path, import_config=config)
outputs.set_value("file_bundle", file_bundle)
|
The source code of the process method of the module. |
type_name |
load.bytes |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
LoadBytesModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.serialization |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.serialization.LoadBytesModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
load.internal_model |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
LoadInternalModel |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.serialization |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.serialization.LoadInternalModel |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
load.string |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
LoadStringModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.serialization |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.serialization.LoadStringModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
pipeline |
The registered name for this item type. |
documentation |
description |
A utility module to run multiple connected inner-modules and present it as its own entity. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
PipelineModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.pipeline |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.pipeline.PipelineModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMapWritable, job_log: JobLog):
pipeline_structure: PipelineStructure = self.config.structure
pipeline = Pipeline(structure=pipeline_structure, kiara=outputs._kiara)
assert self._job_registry is not None
controller = SinglePipelineBatchController(
pipeline=pipeline, job_registry=self._job_registry
)
pipeline.set_pipeline_inputs(inputs=inputs)
step_details = controller.process_pipeline()
errors: Dict[str, Union[Exception, uuid.UUID]] = {}
for step_id, details in step_details.items():
if isinstance(details, Exception):
errors[step_id] = details
else:
job = self._job_registry.get_job(details)
if job.error:
if job._exception:
errors[step_id] = job._exception
else:
errors[step_id] = Exception(job.error)
if errors:
msg = "Error processing pipeline:"
for f, e in errors.items():
msg = f"{msg}\n - {f}: {e}"
raise KiaraProcessingException(f"Errors while processing pipeline: {msg}")
# TODO: resolve values first?
outputs.set_values(**pipeline.get_current_pipeline_outputs())
|
The source code of the process method of the module. |
type_name |
pretty_print.any.value |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
PrettyPrintAnyValueModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.pretty_print |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.pretty_print.PrettyPrintAnyValueModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
source_type = self.get_config_value("source_type")
target_type = self.get_config_value("target_type")
value = inputs.get_value_obj("value")
render_config = inputs.get_value_data("render_config")
func_name = f"pretty_print__{source_type}__as__{target_type}"
func = getattr(self, func_name)
# TODO: check function signature is valid
if render_config is None:
render_config = {}
result = func(value=value, render_config=render_config)
outputs.set_value("rendered_value", result)
|
The source code of the process method of the module. |
type_name |
pretty_print.value |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ValueTypePrettyPrintModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.pretty_print |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.pretty_print.ValueTypePrettyPrintModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
# source_type = self.get_config_value("source_type")
target_type = self.get_config_value("target_type")
source_value = inputs.get_value_obj("value")
render_config = inputs.get_value_obj("render_config")
if not source_value.is_set:
outputs.set_value("rendered_value", "-- none/not set --")
return
try:
data_type_cls = source_value.data_type_info.data_type_class.get_class()
data_type = data_type_cls(**source_value.value_schema.type_config)
except Exception as e:
source_data_type = source_value.data_type_name
log_message("data_type.unknown", data_type=source_data_type, error=e)
from kiara.data_types.included_core_types import AnyType
data_type = AnyType()
func_name = f"pretty_print_as__{target_type}"
func = getattr(data_type, func_name)
render_config_dict = render_config.data
if render_config_dict is None:
render_config_dict = {}
result = func(value=source_value, render_config=render_config_dict)
# TODO: check we have the correct type?
outputs.set_value("rendered_value", result)
|
The source code of the process method of the module. |
type_name |
render.value |
The registered name for this item type. |
documentation |
description |
A module that uses render methods attached to DataType classes. |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ValueTypeRenderModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.render_value |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.render_value.ValueTypeRenderModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap):
source_value = inputs.get_value_obj("value")
if not source_value.is_set:
raise KiaraProcessingException(
f"Can't render value '{source_value.value_id}': value not set."
)
# source_type = self.get_config_value("source_type")
target_type = self.get_config_value("target_type")
render_scene: DictModel = inputs.get_value_data("render_config")
try:
data_type_cls = source_value.data_type_info.data_type_class.get_class()
data_type = data_type_cls(**source_value.value_schema.type_config)
except Exception as e:
source_data_type = source_value.data_type_name
log_message("data_type.unknown", data_type=source_data_type, error=e)
from kiara.data_types.included_core_types import AnyType
data_type = AnyType()
func_name = f"render_as__{target_type}"
func = getattr(data_type, func_name)
if render_scene:
rc = render_scene.dict_data
else:
rc = {}
result = func(
value=source_value,
render_config=rc,
manifest=self.manifest,
)
if isinstance(result, RenderValueResult):
render_scene_result = result
else:
render_scene_result = RenderValueResult(
value_id=source_value.value_id,
render_config=rc,
render_manifest=self.manifest.manifest_hash,
rendered=result,
related_scenes={},
manifest_lookup={self.manifest.manifest_hash: self.manifest},
)
outputs.set_value("render_value_result", render_scene_result)
|
The source code of the process method of the module. |
type_name |
unpickle.value |
The registered name for this item type. |
documentation |
description |
-- n/a -- |
Short description of the item. |
doc |
None |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
UnpickleModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.serialization |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.serialization.UnpickleModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value_type = self.get_config_value("value_type")
serialized_value = inputs.get_value_obj(value_type)
config = inputs.get_value_obj("deserialization_config")
target_profile = self.get_config_value("target_profile")
func_name = f"to__{target_profile}"
func = getattr(self, func_name)
if config.is_set:
_config = config.data
else:
_config = {}
result: Any = func(data=serialized_value.serialized_data, **_config)
outputs.set_value("python_object", result)
|
The source code of the process method of the module. |
type_name |
value.extract_metadata |
The registered name for this item type. |
documentation |
description |
Base class to use when writing a module to extract metadata from a file. |
Short description of the item. |
doc |
It's possible to use any arbitrary *kiara* module for this purpose, but sub-classing this makes it easier. |
Detailed documentation of the item (in markdown). |
|
Documentation for the item. |
authors |
authors |
-
name |
Markus Binsteiner |
The full name of the author. |
email |
markus@frkl.io |
The email address of the author |
|
The authors/creators of this item. |
|
Information about authorship for the item. |
context |
references |
source_repo |
url |
https://github.com/DHARPA-Project/kiara |
The url. |
desc |
The kiara project git repository. |
A short description of the link content. |
|
documentation |
url |
https://dharpa.org/kiara_documentation/ |
The url. |
desc |
The url for kiara documentation. |
A short description of the link content. |
|
|
References for the item. |
tags |
|
A list of tags for the item. |
labels |
|
A list of labels for the item. |
|
Generic properties of this item (description, tags, labels, references, ...). |
python_class |
python_class_name |
ExtractMetadataModule |
The name of the Python class. |
python_module_name |
kiara.modules.included_core_modules.metadata |
The name of the Python module this class lives in. |
full_name |
kiara.modules.included_core_modules.metadata.ExtractMetadataModule |
The full class namespace. |
|
The python class that implements this module type. |
process_src |
def process(self, inputs: ValueMap, outputs: ValueMap) -> None:
value = inputs.get_value_obj("value")
kiara_model_id: str = self.get_config_value("kiara_model_id")
model_registry = ModelRegistry.instance()
metadata_model_cls: Type[ValueMetadata] = model_registry.get_model_cls(kiara_model_id=kiara_model_id, required_subclass=ValueMetadata) # type: ignore
metadata = metadata_model_cls.create_value_metadata(value=value)
if not isinstance(metadata, metadata_model_cls):
raise KiaraProcessingException(
f"Invalid metadata model result, should be class '{metadata_model_cls.__name__}', but is: {metadata.__class__.__name__}. This is most likely a bug."
)
outputs.set_value("value_metadata", metadata)
|
The source code of the process method of the module. |