|
4 | 4 | from typing import TYPE_CHECKING
|
5 | 5 |
|
6 | 6 | import lamindb_setup as ln_setup
|
7 |
| -from lamin_utils import logger |
| 7 | +from lamin_utils import colors, logger |
8 | 8 | from lamindb_setup._set_managed_storage import set_managed_storage
|
9 | 9 | from lamindb_setup.core._settings import settings as setup_settings
|
10 | 10 | from lamindb_setup.core._settings_instance import sanitize_git_repo_url
|
@@ -43,6 +43,36 @@ def __init__(self):
|
43 | 43 | logger.set_verbosity(self._verbosity_int)
|
44 | 44 | self._sync_git_repo: str | None = None
|
45 | 45 |
|
| 46 | + def __repr__(self) -> str: # pragma: no cover |
| 47 | + cls_name = colors.green(self.__class__.__name__) |
| 48 | + verbosity_color = colors.yellow if self.verbosity == "warning" else colors.green |
| 49 | + verbosity_str = verbosity_color(self.verbosity) |
| 50 | + |
| 51 | + storage_root = self._storage_settings.root_as_str |
| 52 | + storage_str = colors.italic(storage_root) |
| 53 | + |
| 54 | + instance_str = colors.italic(self.instance_uid) |
| 55 | + track_color = colors.green if self.track_run_inputs else colors.yellow |
| 56 | + track_str = track_color(str(self.track_run_inputs)) |
| 57 | + |
| 58 | + lines = [ |
| 59 | + f"{cls_name}", |
| 60 | + f" instance: {instance_str}", |
| 61 | + f" storage: {storage_str}", |
| 62 | + f" verbosity: {verbosity_str}", |
| 63 | + f" track_run_inputs: {track_str}", |
| 64 | + ] |
| 65 | + |
| 66 | + if self.sync_git_repo: |
| 67 | + repo_name = ( |
| 68 | + self.sync_git_repo.split("/")[-1] |
| 69 | + if "/" in self.sync_git_repo |
| 70 | + else self.sync_git_repo |
| 71 | + ) |
| 72 | + lines.append(f" sync_git_repo: {colors.italic(repo_name)}") |
| 73 | + |
| 74 | + return "\n".join(lines) |
| 75 | + |
46 | 76 | @property
|
47 | 77 | def creation(self) -> CreationSettings:
|
48 | 78 | """SQLRecord creation settings.
|
|
0 commit comments