Skip to content

saving_status

Status and updates generated by the saving worker.

SavingSignalGroup #

Bases: SignalGroup

Signal group for the saving status dataclass.

Source code in src/careamics_napari/signals/saving_status.py
class SavingSignalGroup(SignalGroup):
    """Signal group for the saving status dataclass."""

    state: SignalInstance
    """Current state of the saving process."""

state instance-attribute #

Current state of the saving process.

SavingState #

Bases: IntEnum

Saving state.

Source code in src/careamics_napari/signals/saving_status.py
class SavingState(IntEnum):
    """Saving state."""

    IDLE = 0
    """Saving is idle."""

    SAVING = 1
    """Saving is ongoing."""

    DONE = 2
    """Saving is done."""

    CRASHED = 3
    """Saving has crashed."""

CRASHED = 3 class-attribute instance-attribute #

Saving has crashed.

DONE = 2 class-attribute instance-attribute #

Saving is done.

IDLE = 0 class-attribute instance-attribute #

Saving is idle.

SAVING = 1 class-attribute instance-attribute #

Saving is ongoing.

SavingStatus dataclass #

Status of the saving thread.

This dataclass is used to update the saving UI with the current status and progress of the saving. Listeners can be registered to the events attribute to be notified of changes in the value of the attributes (see psygnal documentation for more details).

Source code in src/careamics_napari/signals/saving_status.py
@evented
@dataclass
class SavingStatus:
    """Status of the saving thread.

    This dataclass is used to update the saving UI with the current status and
    progress of the saving. Listeners can be registered to the `events` attribute to
    be notified of changes in the value of the attributes (see `psygnal` documentation
    for more details).
    """

    if TYPE_CHECKING:
        events: SavingSignalGroup
        """Attribute allowing the registration of parameter-specific listeners."""

    state: SavingState = SavingState.IDLE
    """Current state of the saving process."""

    def update(self, new_update: SavingUpdate) -> None:
        """Update the status with the new update.

        Parameters
        ----------
        new_update : SavingUpdate
            New update to apply.
        """
        setattr(self, new_update.type.value, new_update.value)

events instance-attribute #

Attribute allowing the registration of parameter-specific listeners.

state = SavingState.IDLE class-attribute instance-attribute #

Current state of the saving process.

update(new_update) #

Update the status with the new update.

Parameters:

Name Type Description Default
new_update SavingUpdate

New update to apply.

required
Source code in src/careamics_napari/signals/saving_status.py
def update(self, new_update: SavingUpdate) -> None:
    """Update the status with the new update.

    Parameters
    ----------
    new_update : SavingUpdate
        New update to apply.
    """
    setattr(self, new_update.type.value, new_update.value)

SavingUpdate dataclass #

Update from the saving worker.

Source code in src/careamics_napari/signals/saving_status.py
@dataclass
class SavingUpdate:
    """Update from the saving worker."""

    type: SavingUpdateType
    """Type of the update."""

    value: Optional[Union[str, SavingState, Exception]] = None
    """Content of the update."""

type instance-attribute #

Type of the update.

value = None class-attribute instance-attribute #

Content of the update.

SavingUpdateType #

Bases: str, Enum

Type of saving update.

Source code in src/careamics_napari/signals/saving_status.py
class SavingUpdateType(str, Enum):
    """Type of saving update."""

    STATE = "state"
    """Current state of the saving process."""

    DEBUG = "debug message"
    """Debug message."""

    EXCEPTION = "exception"
    """Exception raised during the saving process."""

DEBUG = 'debug message' class-attribute instance-attribute #

Debug message.

EXCEPTION = 'exception' class-attribute instance-attribute #

Exception raised during the saving process.

STATE = 'state' class-attribute instance-attribute #

Current state of the saving process.