factory1089%python.module
fault.project

Project materialization tools for instantiating polynomial-1 organized factor sets.

functools
import

typing0
import

ModuleType0
import

dataclass0
import

Cell0
import

Segment0
import

Paragraph0
import

render0
import

files0
import

sequence_project_declaration0
import

types0
import

_ktprotocol0
function

_ktprotocol(iri)

_poly_factor_header0
data

_poly_factor_header = _ktprotocol("http://if.fault.io/project/factor")

_literal10%
function

_literal(text)

_ref40%
function

_ref(format_id, *text)

sequence_format_declarations0
function

sequence_format_declarations(formats)

factors/polynomial-1 .format serialization

Composition0
class

The core data for composing a factor.

CompositionProperties

type

The factor type.

requirements

Set of factor references needed for integration.

sources

A sequence of pairs defining the source name and the source content.

For polynomial-1, the source name is the extension that will be appended to factor path if sources is a fault.context.types.Cell instance.

Compositiontype0
data
str

type: str = None

Compositionrequirements0
data
[str]

requirements: [str] = ()

Compositionsources0
data
typing.Sequence[typing.Tuple[str, typing.Union[str, bytes, files.Path, ModuleType]]]

sources: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes, files.Path, ModuleType]]] = ()
	@classmethod

Compositionindirect0
classmethod

indirect(Class, extension, source, type)

Define an indirectly typed factor's composition.

CompositionindirectParameters

Class

Undocumented.

extension

The dot extension that will be appended to the file to identify its type.

source

The data or reference to the data that will be used to initialize the file.

type

An optional factor type string. This is ignored by plan as this is composing an indirectly typed factor.

Compositionexplicit0
classmethod

explicit(Class, type, requirements, sources)

Define an explicitly typed factor's composition.

Equivalent to the default constructor with the exception that requirements and sources are copied into a new list.

CompositionexplicitParameters

Class

Undocumented.

type

The type to be assigned to the factor.

requirements

The set of factors needed for integration.

sources

The iterable producing pairs defining the relative paths and sources.

Parameters0
class

The necessary data for instantiating a project on the local system.

ParametersProperties

information

The fault.project.types.Information instance defining the project's identity.

formats

The source formats identified by the project.

factors

The set of factors that make up a project; a sequence of factor path-composition pairs.

extensions

Additional project information.

Parametersinformation0
data
types.Information

information: (types.Information) = None

Parametersformats0
data
object

formats: (object) = None

Parametersfactors0
data
typing.Sequence[typing.Tuple[types.FactorPath, Composition]]

factors: (typing.Sequence[typing.Tuple[types.FactorPath, Composition]]) = ()

Parametersextensions0
data
types.Extensions

extensions: (types.Extensions) = None
	@classmethod

Parametersdefine285%
classmethod

define(Class, information, formats, soles, sets, icon, synopsis)

Create a parameter set for project instantiation applying the proper types to factor entries, and translating factor types to file extensions for defining soles.

ParametersdefineParameters

Class

Undocumented.

information

The project's identification.

formats

The project's source formats.

soles

A sequence of records defining single source factors that should be presented at a path consistent with the factor path.

sets

A sequence of records defining factors with multiple sources.

icon

An IRI identifying the image representing the project. This includes data scheme IRIs.

synopsis

A short string describing the project.

plan389%
function

plan(info, formats, factors)

Generate the filesystem paths paired with the data that should be placed into that file relative to the project directory being materialized.

materialize0
function

materialize(route, plans)

Create a Project instance using the filesystem API's provided by route from the instructions produced by the given plans.

WARNING

Plan entries referring to files will cause the file content to be loaded entirely into memory. Instantiating projects with large resources may require a side channel in order to achieve reasonable memory usage.

materializeParameters

route

A, usually filesystem, route to the directory that plan segments will extend into.

plans

An iterable of pairs where the first item is the segment, relative path, and the second is either the data to be stored or a fault.system.files.Path instance referring to the data to be stored.

encoding

Undocumented.

isinstance

Undocumented.

instantiate0
function

instantiate(project, route, *dimensions)

Materialize the plan of the given project using the route as the root directory of the project.

instantiateParameters

project

The set of parameters needed to plan and materialize a project.

route

A route to the root target directory.

dimensions

An optional sequence of strings that will be appended to the project's identifier.