API
TransformSpecifications.TransformSpecifications
— ModuleTransformSpecifications
This package enables structured transform elements via defined I/O specifications.
Exported functions and types
TransformSpecifications.TransformSpecifications
TransformSpecifications.AbstractTransformSpecification
TransformSpecifications.DAGStep
TransformSpecifications.NoThrowDAG
TransformSpecifications.NoThrowResult
TransformSpecifications.NoThrowTransform
TransformSpecifications.NoThrowTransform
TransformSpecifications.TransformSpecification
TransformSpecifications._validate_input_assembler
TransformSpecifications.convert_spec
TransformSpecifications.field_dict
TransformSpecifications.get_step
TransformSpecifications.identity_no_throw_result
TransformSpecifications.input_assembler
TransformSpecifications.input_specification
TransformSpecifications.input_specification
TransformSpecifications.is_identity_no_throw_transform
TransformSpecifications.is_input_assembler
TransformSpecifications.mermaidify
TransformSpecifications.nothrow_succeeded
TransformSpecifications.output_specification
TransformSpecifications.output_specification
TransformSpecifications.transform
TransformSpecifications.transform!
TransformSpecifications.transform!
TransformSpecifications.transform!
TransformSpecifications.transform!
TransformSpecifications.transform_force_throw
TransformSpecifications.transform_force_throw!
TransformSpecifications.transform_force_throw!
Non-exported functions and types
TransformSpecifications._validate_input_assembler
— Method_validate_input_assembler(dag::NoThrowDAG, input_assembler::TransformSpecification)
_validate_input_assembler(dag::NoThrowDAG, ::Nothing)
Confirm that an input_assembler, when called on all upstream outputs generated by dag
, has access to all fields it needs to construct its input.
This validation assumes that the dag
being validated against contains only outputs from upstream steps, an assumption that will be true on DAG construction (where this validation is called from). If called at other times, validation may succeed even though the input_assembler
will fail when called in situ.
TransformSpecifications.convert_spec
— Methodconvert_spec(::Type{T}, input::T) where {T}
convert_spec(::Type{T}, input::T) where {T<:Legolas.AbstractRecord}
convert_spec(spec::Type{<:Legolas.AbstractRecord}, input)
convert_spec(spec, input)
Return input
interpreted as type T
: is same as identity
function if input
is already of type T
; otherwise, attempts to construct or Base.convert
s the the output type from the input. Will throw if conversion fails or is otherwise undefined.
See also: transform!
TransformSpecifications.field_dict
— Methodfield_dict(type::Type{<:NoThrowResult})
field_dict(type)
Return a Dict
where keys are fieldnames(type)
and the value of each key is that field's own type. Constructed by calling field_dict_value
on each input field's type.
When type
is a NoThrowResult{T}
, generate mapping based on unwrapped type T
.
To recurse into a specific type MyType
, implement
TransformSpecification.field_dict_value(t::Type{MyType}) = field_dict(t)
Use caution when implementing a field_dict_value
for any type that isn't explicitly impossible to lead to recursion, as otherwise a stack overflow may occur.
TransformSpecifications.identity_no_throw_result
— Methodidentity_no_throw_result(result) -> NoThrowResult
Return NoThrowResult{T}
where T=typeof(result)
TransformSpecifications.is_input_assembler
— Methodis_input_assembler(ts::AbstractTransformSpecification) -> Bool
Confirm that ts
is an input_assembler
.