Skip to content

Commit

Permalink
document properties in materialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpedigo committed Jul 3, 2024
1 parent ed0b1ae commit 5d4f2ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion caveclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ def _get_version(self) -> Optional[Version]:

@property
def server_version(self) -> Optional[Version]:
"""The version of the remote server."""
"""The version of the service running on the remote server. Note that this
refers to the software running on the server and has nothing to do with the
version of the datastack itself."""
return self._server_version

@staticmethod
Expand Down
8 changes: 8 additions & 0 deletions caveclient/materializationengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,12 @@ def __init__(

@property
def datastack_name(self):
"""The name of the datastack."""
return self._datastack_name

@property
def cg_client(self):
"""The chunked graph client."""
if self._cg_client is None:
if self.fc is not None:
self._cg_client = self.fc.chunkedgraph
Expand All @@ -271,12 +273,16 @@ def cg_client(self):

@property
def version(self) -> int:
"""The version of the materialization. Can be used to set up the
client to default to a specific version when timestamps or versions are not
specified in queries. If not set, defaults to the most recent version."""
if self._version is None:
self._version = self.most_recent_version()
return self._version

@property
def homepage(self) -> HTML:
"""The homepage for the materialization engine."""
url = (
f"{self._server_address}/materialize/views/datastack/{self._datastack_name}"
)
Expand All @@ -291,6 +297,7 @@ def version(self, x):

@property
def tables(self) -> TableManager:
"""The table manager for the materialization engine."""
if self._tables is None:
if self.fc is not None and self.fc._materialize is not None:
self._tables = TableManager(self.fc)
Expand All @@ -300,6 +307,7 @@ def tables(self) -> TableManager:

@property
def views(self) -> ViewManager:
"""The view manager for the materialization engine."""
if self._views is None:
if self.fc is not None and self.fc._materialize is not None:
self._views = ViewManager(self.fc)
Expand Down

0 comments on commit 5d4f2ac

Please sign in to comment.