From 983cdcf6715e75ba1c8bf41042693a1eb176f736 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 17 Dec 2024 11:45:03 +0300 Subject: [PATCH 1/2] Enabled vector collection api docs --- docs/api/proxy/modules.rst | 1 + docs/api/proxy/vector_collection.rst | 6 ++++++ hazelcast/proxy/vector_collection.py | 16 ++++++++-------- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 docs/api/proxy/vector_collection.rst diff --git a/docs/api/proxy/modules.rst b/docs/api/proxy/modules.rst index 59b4bd019c..2bed732dc4 100644 --- a/docs/api/proxy/modules.rst +++ b/docs/api/proxy/modules.rst @@ -22,4 +22,5 @@ Hazelcast Proxies transactional_multi_map transactional_queue transactional_set + vector_collection diff --git a/docs/api/proxy/vector_collection.rst b/docs/api/proxy/vector_collection.rst new file mode 100644 index 0000000000..780b270bad --- /dev/null +++ b/docs/api/proxy/vector_collection.rst @@ -0,0 +1,6 @@ +VectorCollection +================ + +.. py:currentmodule:: hazelcast.proxy.vector_collection + +.. autoclass:: VectorCollection \ No newline at end of file diff --git a/hazelcast/proxy/vector_collection.py b/hazelcast/proxy/vector_collection.py index 5fbc565ff6..424227a9e6 100644 --- a/hazelcast/proxy/vector_collection.py +++ b/hazelcast/proxy/vector_collection.py @@ -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): @@ -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 From 55571bb98537aa86e9d742fa0ef9d943c6d0e3e2 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 17 Dec 2024 12:23:20 +0300 Subject: [PATCH 2/2] Apply sphinx theme unconditionally --- docs/conf.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 5f46d13b96..c45f977c9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,6 +36,7 @@ "sphinx.ext.napoleon", "sphinx.ext.viewcode", "sphinx.ext.autosectionlabel", + "sphinx_rtd_theme", ] autodoc_default_options = { @@ -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 @@ -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 @@ -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"