Skip to content

CopickRoot

copick.models.CopickRoot

Root of a copick project. Contains references to the runs and pickable objects.

Attributes:

  • config (CopickConfig) –

    Configuration of the copick project.

  • user_id (str) –

    Unique identifier for the user.

  • session_id (str) –

    Unique identifier for the session.

  • runs (List[CopickRun]) –

    References to the runs for this project. Lazy loaded upon access.

  • pickable_objects (List[CopickObject]) –

    References to the pickable objects for this project.

__init__(config: CopickConfig)

Parameters:

  • config (CopickConfig) –

    Configuration of the copick project.

query() -> List[CopickRun]

Override this method to query for runs.

get_run(name: str, **kwargs) -> Union[CopickRun, None]

Get run by name.

Parameters:

  • name (str) –

    Name of the run to retrieve.

  • **kwargs

    Additional keyword arguments for the run metadata.

Returns:

  • CopickRun ( Union[CopickRun, None] ) –

    The run with the given name, or None if not found.

get_object(name: str) -> Union[CopickObject, None]

Get object by name.

Parameters:

  • name (str) –

    Name of the object to retrieve.

Returns:

  • CopickObject ( Union[CopickObject, None] ) –

    The object with the given name, or None if not found.

refresh() -> None

Refresh the list of runs.

new_run(name: str, **kwargs) -> CopickRun

Create a new run.

Parameters:

  • name (str) –

    Name of the run to create.

  • **kwargs

    Additional keyword arguments for the run metadata.

Returns:

  • CopickRun ( CopickRun ) –

    The newly created run.

Raises:

  • ValueError

    If a run with the given name already exists.