Skip to content

omnipy.shared.protocols.compute.mixins

Shared mixin protocols for compute contracts.

CLASS DESCRIPTION
IsNestedContext

Protocol for objects that manage nested execution contexts.

IsUniquelyNamedJob

Protocol for jobs with stable and regenerated names.

IsNestedContext

Bases: Protocol


              flowchart BT
              omnipy.shared.protocols.compute.mixins.IsNestedContext[IsNestedContext]

              

              click omnipy.shared.protocols.compute.mixins.IsNestedContext href "" "omnipy.shared.protocols.compute.mixins.IsNestedContext"
            

Protocol for objects that manage nested execution contexts.

Source code in src/omnipy/shared/protocols/compute/mixins.py
class IsNestedContext(Protocol):
    """Protocol for objects that manage nested execution contexts."""
    def __enter__(self):
        ...

    def __exit__(self, exc_type, exc_value, traceback):
        ...

IsUniquelyNamedJob

Bases: Protocol


              flowchart BT
              omnipy.shared.protocols.compute.mixins.IsUniquelyNamedJob[IsUniquelyNamedJob]

              

              click omnipy.shared.protocols.compute.mixins.IsUniquelyNamedJob href "" "omnipy.shared.protocols.compute.mixins.IsUniquelyNamedJob"
            

Protocol for jobs with stable and regenerated names.

METHOD DESCRIPTION
__init__
regenerate_unique_name

Regenerate the unique job name from the current base name.

ATTRIBUTE DESCRIPTION
name

Return the configured base name for the job.

TYPE: str

unique_name

Return the generated unique name used to identify the job instance.

TYPE: str

unique_run_slug

Return the run-specific slug generated for this job instance.

TYPE: str

Source code in src/omnipy/shared/protocols/compute/mixins.py
class IsUniquelyNamedJob(Protocol):
    """Protocol for jobs with stable and regenerated names."""
    @property
    def name(self) -> str:
        # %% Original docstring (managed by expand_docstr_macros.py) %%
        # {{ISUNIQUELYNAMEDJOB_NAME_SUMMARY}}
        #
        # {{ISUNIQUELYNAMEDJOB_NAME_DETAILS}}
        """Return the configured base name for the job.

        Returns:
            str: Human-readable name used as the basis for display and registration.
        """
        ...

    @property
    def unique_run_slug(self) -> str:
        # %% Original docstring (managed by expand_docstr_macros.py) %%
        # {{ISUNIQUELYNAMEDJOB_UNIQUE_RUN_SLUG_SUMMARY}}
        #
        # {{ISUNIQUELYNAMEDJOB_UNIQUE_RUN_SLUG_DETAILS}}
        """Return the run-specific slug generated for this job instance.

        Returns:
            str: Short slug used in per-run names and identifiers.
        """
        ...

    @property
    def unique_name(self) -> str:
        # %% Original docstring (managed by expand_docstr_macros.py) %%
        # {{ISUNIQUELYNAMEDJOB_UNIQUE_NAME_SUMMARY}}
        #
        # {{ISUNIQUELYNAMEDJOB_UNIQUE_NAME_DETAILS}}
        """Return the generated unique name used to identify the job instance.

        Returns:
            str: Unique job identifier suitable for registry lookups and logging.
        """
        ...

    def __init__(self, *args, name: str | None = None):
        ...

    def regenerate_unique_name(self) -> None:
        # %% Original docstring (managed by expand_docstr_macros.py) %%
        # {{ISUNIQUELYNAMEDJOB_REGENERATE_UNIQUE_NAME_SUMMARY}}
        #
        # {{ISUNIQUELYNAMEDJOB_REGENERATE_UNIQUE_NAME_DETAILS}}
        """Regenerate the unique job name from the current base name.

        Updates the stored unique identifier so later registry entries and log messages use a
        fresh value.
        """
        ...

name property

name: str

Return the configured base name for the job.

RETURNS DESCRIPTION
str

Human-readable name used as the basis for display and registration.

TYPE: str

unique_name property

unique_name: str

Return the generated unique name used to identify the job instance.

RETURNS DESCRIPTION
str

Unique job identifier suitable for registry lookups and logging.

TYPE: str

unique_run_slug property

unique_run_slug: str

Return the run-specific slug generated for this job instance.

RETURNS DESCRIPTION
str

Short slug used in per-run names and identifiers.

TYPE: str

__init__

__init__(*args, name: str | None = None)
Source code in src/omnipy/shared/protocols/compute/mixins.py
def __init__(self, *args, name: str | None = None):
    ...

regenerate_unique_name

regenerate_unique_name() -> None

Regenerate the unique job name from the current base name.

Updates the stored unique identifier so later registry entries and log messages use a fresh value.

Source code in src/omnipy/shared/protocols/compute/mixins.py
def regenerate_unique_name(self) -> None:
    # %% Original docstring (managed by expand_docstr_macros.py) %%
    # {{ISUNIQUELYNAMEDJOB_REGENERATE_UNIQUE_NAME_SUMMARY}}
    #
    # {{ISUNIQUELYNAMEDJOB_REGENERATE_UNIQUE_NAME_DETAILS}}
    """Regenerate the unique job name from the current base name.

    Updates the stored unique identifier so later registry entries and log messages use a
    fresh value.
    """
    ...