VeraGridEngine.Templates.BasicBlockCatalog package

Subpackages

Submodules

VeraGridEngine.Templates.BasicBlockCatalog.catalog module

class VeraGridEngine.Templates.BasicBlockCatalog.catalog.BasicBlockTemplateDescriptor(template_key: str, typ_id: str, blkdef_name: str, sample_display_name: str, display_label: str, category_path: Sequence[str], inputs: Sequence[str], outputs: Sequence[str], states: Sequence[str], params: Sequence[str], unsupported_lines: Sequence[str], module_name: str, module_filename: str)[source]

Bases: object

Explicit, typed description of one shipped catalog template.

property blkdef_name: str

Return the raw imported block name.

Returns:

Raw block name.

property category_path: Sequence[str]

Return the full library category path.

Returns:

Category path.

property display_label: str

Return the unique label exposed by the editor.

Returns:

Unique label.

property inputs: Sequence[str]

Return the input names.

Returns:

Input-name tuple.

property is_editor_ready: bool

Return whether the template can be exposed in the editor.

Returns:

True when the template has executable content.

property module_filename: str

Return the standalone Python filename.

Returns:

Module filename.

property module_name: str

Return the standalone Python module stem.

Returns:

Module stem.

property outputs: Sequence[str]

Return the output names.

Returns:

Output-name tuple.

property params: Sequence[str]

Return the runtime parameter names.

Returns:

Parameter-name tuple.

property sample_display_name: str

Return the clean display name derived from the shipped module.

Returns:

Clean source name.

property search_text: str

Build the normalized search text used by the editor filter.

Returns:

Search text.

property states: Sequence[str]

Return the state names.

Returns:

State-name tuple.

property template_key: str

Return the stable semantic lookup key.

Returns:

Template lookup key.

property typ_id: str

Return the imported numeric type identifier.

Returns:

Imported type identifier.

property unsupported_lines: Sequence[str]

Return the pending markers for non editor-ready templates.

Returns:

Unsupported marker tuple.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.build_basic_block_catalog_branch_skeleton() dict[str, dict[str, list[object]]][source]

Build the static category tree used by the editor branch.

Returns:

Fresh category tree.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_descriptor_by_key() dict[str, BasicBlockTemplateDescriptor][source]

Return the descriptor lookup indexed by semantic key.

Returns:

Descriptor lookup by semantic key.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_descriptor_by_typ_id() dict[str, BasicBlockTemplateDescriptor][source]

Return the descriptor lookup indexed by imported type identifier.

Returns:

Descriptor lookup by imported type identifier.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_descriptors() Sequence[BasicBlockTemplateDescriptor][source]

Return the shipped basic block catalog descriptors.

Returns:

Full descriptor tuple.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_pending_template_reason() str[source]

Return the canonical pending reason for non-executable catalog templates.

Returns:

Pending reason.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_root() Path[source]

Return the directory containing the shipped basic block catalog.

Returns:

Catalog root directory.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_basic_block_catalog_templates_dir() Path[source]

Return the directory with the shipped standalone template modules.

Returns:

Standalone-template directory.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_editor_ready_basic_block_catalog_descriptors() Sequence[BasicBlockTemplateDescriptor][source]

Return only the shipped templates that are ready for editor exposure.

Returns:

Editor-ready descriptor tuple.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.get_pending_basic_block_catalog_descriptors() Sequence[BasicBlockTemplateDescriptor][source]

Return only the shipped templates that are not ready for editor exposure.

Returns:

Pending descriptor tuple.

VeraGridEngine.Templates.BasicBlockCatalog.catalog.load_basic_block_catalog_template(descriptor: BasicBlockTemplateDescriptor, var_factory: VarFactory, name: str | None = None) EmtModelTemplate[source]

Materialize one shipped catalog-derived template on demand.

Parameters:
  • descriptor – Template descriptor.

  • var_factory – Variable factory for the new instance.

  • name – Optional explicit instance name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.catalog_static_registry module

class VeraGridEngine.Templates.BasicBlockCatalog.catalog_static_registry.BasicBlockCatalogStaticRecord(template_key: str, typ_id: str, blkdef_name: str, sample_display_name: str, display_label: str, category_path: Sequence[str], inputs: Sequence[str], outputs: Sequence[str], states: Sequence[str], params: Sequence[str], unsupported_lines: Sequence[str], module_name: str, module_filename: str)[source]

Bases: object

Immutable static record for one shipped basic-block catalog template.

property blkdef_name: str

Return the raw block name.

Returns:

Value.

property category_path: Sequence[str]

Return the category path.

Returns:

Value.

property display_label: str

Return the unique editor label.

Returns:

Value.

property inputs: Sequence[str]

Return the input-name tuple.

Returns:

Value.

property is_editor_ready: bool

Return whether the record is ready for editor exposure.

Returns:

True when the record is editor-ready.

property module_filename: str

Return the standalone module filename.

Returns:

Value.

property module_name: str

Return the standalone module stem.

Returns:

Value.

property outputs: Sequence[str]

Return the output-name tuple.

Returns:

Value.

property params: Sequence[str]

Return the parameter-name tuple.

Returns:

Value.

property sample_display_name: str

Return the clean source name.

Returns:

Value.

property states: Sequence[str]

Return the state-name tuple.

Returns:

Value.

property template_key: str

Return the template lookup key.

Returns:

Value.

property typ_id: str

Return the imported type identifier.

Returns:

Value.

property unsupported_lines: Sequence[str]

Return the unsupported marker tuple.

Returns:

Value.

VeraGridEngine.Templates.BasicBlockCatalog.catalog_static_registry.build_basic_block_catalog_branch_skeleton() dict[str, dict[str, list[object]]][source]

Build the static Basic library branch skeleton used by the editor.

Returns:

Fresh category tree with empty leaf lists.

VeraGridEngine.Templates.BasicBlockCatalog.catalog_static_registry.build_basic_block_catalog_pending_template_reason() str[source]

Return the canonical pending reason for non-executable templates.

Returns:

Pending reason.

VeraGridEngine.Templates.BasicBlockCatalog.catalog_static_registry.get_basic_block_catalog_static_records() Sequence[BasicBlockCatalogStaticRecord][source]

Return the immutable static records for the shipped basic-block catalog.

Returns:

Static catalog records.

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates module

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates.build_inverse_lookup_array_linear_runtime_template(vf: VarFactory, x_points: Sequence[float], y_points: Sequence[float], name: str | None = None) EmtModelTemplate[source]

Build one runtime inverse linear lookup template from explicit points.

Parameters:
  • vf – Variable factory used to allocate symbolic objects.

  • x_points – Original x values.

  • y_points – Original y values to invert.

  • name – Optional explicit runtime template name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates.build_lookup_array_linear_runtime_template(vf: VarFactory, x_points: Sequence[float], y_points: Sequence[float], clip: bool, name: str | None = None) EmtModelTemplate[source]

Build one runtime one-dimensional linear lookup template from explicit points.

Parameters:
  • vf – Variable factory used to allocate symbolic objects.

  • x_points – Strictly increasing x values.

  • y_points – Matching y values.

  • clip – If True, clip outside the table; otherwise extrapolate linearly.

  • name – Optional explicit runtime template name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates.build_lookup_array_spline_runtime_template(vf: VarFactory, x_points: Sequence[float], y_points: Sequence[float], name: str | None = None) EmtModelTemplate[source]

Build one runtime one-dimensional spline lookup template from explicit points.

Parameters:
  • vf – Variable factory used to allocate symbolic objects.

  • x_points – Strictly increasing x values.

  • y_points – Matching y values.

  • name – Optional explicit runtime template name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates.build_lookup_matrix_linear_runtime_template(vf: VarFactory, x_points: Sequence[float], y_points: Sequence[float], z_matrix: Sequence[Sequence[float]], name: str | None = None) EmtModelTemplate[source]

Build one runtime bilinear lookup matrix template from explicit axes and values.

Parameters:
  • vf – Variable factory used to allocate symbolic objects.

  • x_points – Strictly increasing x-axis values.

  • y_points – Strictly increasing y-axis values.

  • z_matrix – Matrix values indexed as [y][x].

  • name – Optional explicit runtime template name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.lookup_array_runtime_templates.build_lookup_matrix_spline_runtime_template(vf: VarFactory, x_points: Sequence[float], y_points: Sequence[float], z_matrix: Sequence[Sequence[float]], name: str | None = None) EmtModelTemplate[source]

Build one runtime two-dimensional spline lookup template from explicit axes and values.

Parameters:
  • vf – Variable factory used to allocate symbolic objects.

  • x_points – Strictly increasing x-axis values.

  • y_points – Strictly increasing y-axis values.

  • z_matrix – Matrix values indexed as [y][x].

  • name – Optional explicit runtime template name.

Returns:

Materialized EMT template.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration module

class VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.BasicBlockStandaloneModuleEmitter(block: Block, display_name: str, module_name: str, default_template_name: str)[source]

Bases: object

Emit one clean standalone catalog module from one materialized template block.

render() str[source]

Render the full standalone Python module.

Returns:

Python module text.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.build_basic_block_catalog_default_name_builder_name(module_name: str) str[source]

Build the unique helper name that returns one module default template name.

Parameters:

module_name – Standalone module stem.

Returns:

Unique helper name.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.build_basic_block_catalog_template_builder_name(module_name: str) str[source]

Build the unique helper name that materializes one standalone template.

Parameters:

module_name – Standalone module stem.

Returns:

Unique builder name.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.render_basic_block_catalog_functions_package_init() str[source]

Render the static package registry for every generated basic-block builder.

Returns:

Functions/__init__.py source text.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.rewrite_basic_block_catalog_functions_package_init(output_directory: Path | None = None) Path[source]

Rewrite the static package registry that exposes every generated basic-block builder.

Parameters:

output_directory – Optional destination directory.

Returns:

Path to the rewritten package init file.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.rewrite_basic_block_catalog_standalone_modules(output_directory: Path | None = None) Sequence[Path][source]

Rewrite every standalone catalog module using the clean emitter.

Parameters:

output_directory – Optional destination directory.

Returns:

Written module paths.

VeraGridEngine.Templates.BasicBlockCatalog.module_regeneration.rewrite_basic_block_catalog_template_module(template_key: str, output_directory: Path | None = None) Path[source]

Rewrite one standalone catalog module using the clean emitter.

Parameters:
  • template_key – Stable catalog template key.

  • output_directory – Optional destination directory.

Returns:

Path to the rewritten module.

Module contents