Skip to content

Commit

Permalink
Fix docs (#714)
Browse files Browse the repository at this point in the history
* Try to display the navbar correctly
* Add VectorCollection API docs
  • Loading branch information
yuce authored Dec 18, 2024
1 parent dabba7c commit e667147
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions docs/api/proxy/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ Hazelcast Proxies
transactional_multi_map
transactional_queue
transactional_set
vector_collection

6 changes: 6 additions & 0 deletions docs/api/proxy/vector_collection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VectorCollection
================

.. py:currentmodule:: hazelcast.proxy.vector_collection
.. autoclass:: VectorCollection
13 changes: 3 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.autosectionlabel",
"sphinx_rtd_theme",
]

autodoc_default_options = {
Expand Down Expand Up @@ -66,7 +67,7 @@

# General information about the project.
project = "Hazelcast Python Client"
copyright = "2023, Hazelcast Inc."
copyright = "2024, Hazelcast Inc."
author = "Hazelcast Inc. Developers"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -130,7 +131,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -313,11 +314,3 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False

on_rtd = os.environ.get("READTHEDOCS") == "True"

if not on_rtd:
# If we are building locally, import the RTD theme
# and use it
extensions.append("sphinx_rtd_theme")
html_theme = "sphinx_rtd_theme"
16 changes: 8 additions & 8 deletions hazelcast/proxy/vector_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class VectorCollection(Proxy["BlockingVectorCollection"]):
Example:
client.create_vector_collection_config("my_vc", [
IndexConfig(name="default-vector", metric=Metric.COSINE, dimension=2)
]
my_vc = client.get_vector_collection("my_vc").blocking()
my_vc.set("key1", Vector("default-vector", Type.DENSE, [0.1, 0.2])
>>> client.create_vector_collection_config("my_vc", [
>>> IndexConfig(name="default-vector", metric=Metric.COSINE, dimension=2)
>>> ]
>>> my_vc = client.get_vector_collection("my_vc").blocking()
>>> my_vc.set("key1", Vector("default-vector", Type.DENSE, [0.1, 0.2])
"""

def __init__(self, service_name, name, context):
Expand All @@ -66,9 +66,9 @@ def get(self, key: Any) -> Future[Optional[Document]]:
returned Document does not change the actual Document in the VectorCollection. One
should put modified Document back to make changes visible to all nodes.
>>> doc = my_vc.get(key)
>>> doc.value.update_some_property()
>>> my_vc.set(key, doc)
>>> doc = my_vc.get(key)
>>> doc.value.update_some_property()
>>> my_vc.set(key, doc)
Warning:
This method uses ``__hash__`` and ``__eq__`` methods of binary form
Expand Down

0 comments on commit e667147

Please sign in to comment.