Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@
"sphinx.ext.autodoc", # include docs from docstrings
"enum_tools.autoenum", # specialised autoclass for enums
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
"sphinxcontrib.autodoc_pydantic", # Support for Pydantic models
]

autodoc_class_signature = "separated"

templates_path = ["_templates"]
exclude_patterns = [] # type: ignore

# -- Options for Autodoc Pydantic ------------------------------------------------
autodoc_pydantic_model_show_json = False
autodoc_pydantic_settings_show_json = False
autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_field_summary = False
autodoc_pydantic_field_show_alias = False
autodoc_pydantic_field_show_required = False
autodoc_pydantic_field_show_optional = False
autodoc_pydantic_field_show_default = False

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

Expand Down
9 changes: 3 additions & 6 deletions doc/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Neo4j Graph Data Science Python Client API Reference
This API reference manual lists all available endpoints in the Neo4j Graph Data Science Python Client |api-version|.

.. toctree::
:maxdepth: 1
:maxdepth: 2
:caption: Contents

graphdatascience
Expand All @@ -31,8 +31,5 @@ This API reference manual lists all available endpoints in the Neo4j Graph Data
model/simple_rel_embedding_model
misc
server_version
sessions/gds_sessions
sessions/dbms_connection_info
sessions/session_memory
sessions/algorithm_category
sessions/cloud_location
sessions/index
v2_endpoints/index
7 changes: 7 additions & 0 deletions doc/sphinx/source/sessions/aura_graphdatascience.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AuraGraphDataScience
--------------------

.. autoclass:: graphdatascience.session.AuraGraphDataScience
:members:
:exclude-members: __init__
:inherited-members:
15 changes: 15 additions & 0 deletions doc/sphinx/source/sessions/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. toctree::
:maxdepth: 1
:caption: Contents

gds_sessions
dbms_connection_info
session_memory
algorithm_category
cloud_location
aura_graphdatascience

.. toctree::
:hidden:

session_v2_endpoints
7 changes: 7 additions & 0 deletions doc/sphinx/source/sessions/session_v2_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AuraGraphDataScience
--------------------

.. autoclass:: graphdatascience.session.session_v2_endpoints.SessionV2Endpoints
:members:
:exclude-members: __init__, set_progress
:inherited-members:
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/catalog_arrow_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Catalog Arrow Endpoints
========================

.. automodule:: graphdatascience.procedure_surface.arrow.catalog
:exclude-members: __init__
:members:
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/catalog_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Catalog Arrow Endpoints
========================

.. automodule:: graphdatascience.procedure_surface.api.catalog
:exclude-members: __init__
:members:
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/centrality_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Centrality Algorithms
=======================

.. automodule:: graphdatascience.procedure_surface.api.centrality
:members:
:exclude-members: __init__
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/community_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Community Algorithms
====================

.. automodule:: graphdatascience.procedure_surface.api.community
:members:
:exclude-members: __init__
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/estimation_result.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Estimation Result
=================

.. automodule:: graphdatascience.procedure_surface.api.estimation_result
:members:

11 changes: 11 additions & 0 deletions doc/sphinx/source/v2_endpoints/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. toctree::
:hidden:

catalog_endpoints
catalog_arrow_endpoints
centrality_endpoints
community_endpoints
node_embedding_endpoints
pathfinding_endpoints
similarity_endpoints
estimation_result
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/node_embedding_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Node Embedding Algorithms
==========================

.. automodule:: graphdatascience.procedure_surface.api.node_embedding
:members:
:exclude-members: __init__
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/pathfinding_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Pathfinding Algorithms
=======================

.. automodule:: graphdatascience.procedure_surface.api.pathfinding
:members:
:exclude-members: __init__
6 changes: 6 additions & 0 deletions doc/sphinx/source/v2_endpoints/similarity_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Similarity Algorithms
======================

.. automodule:: graphdatascience.procedure_surface.api.similarity
:members:
:exclude-members: __init__
3 changes: 3 additions & 0 deletions graphdatascience/procedure_surface/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from graphdatascience.procedure_surface.api.estimation_result import EstimationResult

__all__ = ["EstimationResult"]
77 changes: 77 additions & 0 deletions graphdatascience/procedure_surface/api/catalog/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from graphdatascience.procedure_surface.api.catalog.catalog_endpoints import (
CatalogEndpoints,
GraphFilterResult,
GraphGenerationStats,
GraphWithFilterResult,
GraphWithGenerationStats,
RelationshipPropertySpec,
)
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
from graphdatascience.procedure_surface.api.catalog.graph_backend import GraphBackend
from graphdatascience.procedure_surface.api.catalog.graph_info import GraphInfo
from graphdatascience.procedure_surface.api.catalog.graph_sampling_endpoints import (
GraphSamplingEndpoints,
GraphSamplingResult,
GraphWithSamplingResult,
)
from graphdatascience.procedure_surface.api.catalog.node_label_endpoints import (
NodeLabelEndpoints,
NodeLabelMutateResult,
NodeLabelPersistenceResult,
NodeLabelWriteResult,
)
from graphdatascience.procedure_surface.api.catalog.node_properties_endpoints import (
NodePropertiesDropResult,
NodePropertiesEndpoints,
NodePropertiesWriteResult,
NodePropertySpec,
)
from graphdatascience.procedure_surface.api.catalog.relationships_endpoints import (
Aggregation,
RelationshipsDropResult,
RelationshipsEndpoints,
RelationshipsInverseIndexResult,
RelationshipsToUndirectedResult,
RelationshipsWriteResult,
)
from graphdatascience.procedure_surface.api.catalog.scale_properties_endpoints import (
ScalePropertiesEndpoints,
ScalePropertiesMutateResult,
ScalePropertiesStatsResult,
ScalePropertiesWriteResult,
)
from graphdatascience.procedure_surface.api.catalog.scaler_config import ScalerConfig

__all__ = [
"Aggregation",
"CatalogEndpoints",
"GraphBackend",
"GraphFilterResult",
"GraphGenerationStats",
"GraphInfo",
"GraphSamplingEndpoints",
"GraphSamplingResult",
"GraphV2",
"GraphWithFilterResult",
"GraphWithGenerationStats",
"GraphWithSamplingResult",
"NodeLabelEndpoints",
"NodeLabelMutateResult",
"NodeLabelPersistenceResult",
"NodeLabelWriteResult",
"NodePropertiesDropResult",
"NodePropertiesEndpoints",
"NodePropertiesWriteResult",
"NodePropertySpec",
"RelationshipPropertySpec",
"RelationshipsDropResult",
"RelationshipsEndpoints",
"RelationshipsInverseIndexResult",
"RelationshipsToUndirectedResult",
"RelationshipsWriteResult",
"ScalePropertiesEndpoints",
"ScalePropertiesMutateResult",
"ScalePropertiesStatsResult",
"ScalePropertiesWriteResult",
"ScalerConfig",
]
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def write(
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
concurrency : Any | None, default=None
concurrency : int | None
The number of concurrent threads
write_concurrency : Any | None, default=None
write_concurrency : int | None
The number of concurrent threads used for the mutation
job_id : Any | None, default=None
job_id : str | None
An identifier for the job
Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def stream(
Whether to include node labels in the stream
node_labels : list[str]
Filter by node labels
concurrency : Any | None, default=None
concurrency : int | None
The number of concurrent threads
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
job_id : Any | None, default=None
job_id : str | None
An identifier for the job
db_node_properties : list[str] | None, default=None
Retrieves additional node properties from the database and attaches them to the stream.
Expand Down Expand Up @@ -85,17 +85,17 @@ def write(
If a dictionary is provided, the keys are the property names and the values are the aliases that will be used as the property name in the database.
node_labels : list[str]
Filter by node labels
concurrency : Any | None, default=None
concurrency : int | None
The number of concurrent threads
write_concurrency : Any | None, default=None
write_concurrency : int | None
The number of concurrent threads used for writing
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
job_id : Any | None, default=None
job_id : str | None
An identifier for the job
Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def mutate(
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
concurrency: Any | None = None,
job_id: Any | None = None,
concurrency: int | None = None,
job_id: str | None = None,
) -> ScalePropertiesMutateResult:
"""
Runs the Scale Properties algorithm and stores the results in the graph catalog as a new node property.
Expand Down Expand Up @@ -53,9 +53,9 @@ def mutate(
Display progress logging.
username : str | None, default=None
The username to attribute the procedure run to
concurrency : Any | None, default=None
concurrency : int | None
Number of threads to use for running the algorithm.
job_id : Any | None, default=None
job_id : str | None
Identifier for the job.

Returns
Expand Down
22 changes: 8 additions & 14 deletions graphdatascience/procedure_surface/api/catalog/scaler_config.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
from pydantic import BaseModel
from pydantic import BaseModel, Field


class ScalerConfig(BaseModel):
"""
Configuration for a scaler used in the Scale Properties algorithm.

Attributes
----------
type : str
The type of scaler to use. Can be 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center'.
offset : int | float
The offset to add to the property values before applying the log transformation. Only used when type is 'Log'.
"""

type: str
offset: int | float | None = None
type: str = Field(
description="The type of scaler to use. Can be 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center'."
)
offset: int | float | None = Field(
default=None,
description="The offset to add to the property values before applying the log transformation. Only used when type is 'Log'.",
)
Loading