diff --git a/CMakeLists.txt b/CMakeLists.txt index 734312c..506416a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ if (nanobind_FOUND) message(STATUS "building nanobind module") nanobind_add_module(GGNN NB_STATIC NOMINSIZE "src/ggnn/python/nanobind.cu") target_link_libraries(GGNN PRIVATE GGNNBase GGNNConstruction GGNNQuery glog::glog) - nanobind_add_stub(GGNN_stub MODULE GGNN OUTPUT GGNN.pyi MARKER_FILE py.typed DEPENDS GGNN) + nanobind_add_stub(pyGGNN_stub MODULE GGNN OUTPUT pyGGNN.pyi MARKER_FILE py.typed DEPENDS GGNN) if (PY_BUILD_CMAKE_MODULE_NAME) message(STATUS "configuring python module installation") @@ -217,7 +217,7 @@ if (nanobind_FOUND) COMPONENT python_modules DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) endif() - install(FILES ${CMAKE_BINARY_DIR}/py.typed ${CMAKE_BINARY_DIR}/GGNN.pyi + install(FILES ${CMAKE_BINARY_DIR}/py.typed ${CMAKE_BINARY_DIR}/pyGGNN.pyi EXCLUDE_FROM_ALL COMPONENT python_modules DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) diff --git a/README.md b/README.md index 3c40fd7..156df8f 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ The GGNN python module can be used to perform GPU-accelerated approximate neares ```python #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn import torch # get detailed logs diff --git a/docs/source/usage_python.rst b/docs/source/usage_python.rst index f1859d1..6c25898 100644 --- a/docs/source/usage_python.rst +++ b/docs/source/usage_python.rst @@ -22,7 +22,7 @@ By default, the log level is set to ``0``: #! /usr/bin/python3 - import ggnn + import pyggnn as ggnn #get detailed logs ggnn.set_log_level(4) @@ -174,7 +174,7 @@ Otherwise, this works the same way as above. #! /usr/bin/python3 - import ggnn + import pyggnn as ggnn import torch # create data @@ -224,7 +224,7 @@ and passed to the ``Evaluator`` directly. #! /usr/bin/python3 - import ggnn + import pyggnn as ggnn path_to_dataset = '/path/to/sift/' diff --git a/examples/python/ggnn_pytorch.py b/examples/python/ggnn_pytorch.py index 4e5c6d6..3c6031e 100644 --- a/examples/python/ggnn_pytorch.py +++ b/examples/python/ggnn_pytorch.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn import torch # get detailed logs @@ -36,5 +36,5 @@ evaluator = ggnn.Evaluator(base, query, gt_indices, k_query=k_query) print(evaluator.evaluate_results(indices)) -# print the indices of the 10 NN of the first five queries and their squared euclidean distances +# print the indices of the 10 NN of the first five queries and their squared euclidean distances print('indices:', indices[:5], '\n squared dists:', dists[:5], '\n') diff --git a/examples/python/ggnn_pytorch_gpu_data.py b/examples/python/ggnn_pytorch_gpu_data.py index 1c76f0f..0ff9b84 100644 --- a/examples/python/ggnn_pytorch_gpu_data.py +++ b/examples/python/ggnn_pytorch_gpu_data.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn import torch # get detailed logs diff --git a/examples/python/ggnn_pytorch_multi_gpu.py b/examples/python/ggnn_pytorch_multi_gpu.py index dd18389..b9589af 100644 --- a/examples/python/ggnn_pytorch_multi_gpu.py +++ b/examples/python/ggnn_pytorch_multi_gpu.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn import torch # create data diff --git a/examples/python/sift1m_fvecs.py b/examples/python/sift1m_fvecs.py index 84e6695..aaa6d68 100644 --- a/examples/python/sift1m_fvecs.py +++ b/examples/python/sift1m_fvecs.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn path_to_dataset = '/graphics/scratch/datasets/ANN_datasets/SIFT1M/sift/' diff --git a/examples/python/sift1m_hdf5.py b/examples/python/sift1m_hdf5.py index c93c518..92e5693 100644 --- a/examples/python/sift1m_hdf5.py +++ b/examples/python/sift1m_hdf5.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import ggnn +import pyggnn as ggnn import h5py import numpy as np diff --git a/pyproject.toml b/pyproject.toml index 6487fed..85be2ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] # Project metadata -name = "GGNN" +name = "pyGGNN" readme = "README.md" requires-python = ">=3.8" license = { "file" = "LICENSE" } @@ -32,7 +32,7 @@ dynamic = ["version", "description"] [project.urls] Homepage = "https://github.com/cgtuebingen/ggnn" -# TODO: Documentation = "https://ggnn.readthedocs.io/" +Documentation = "https://ggnn.readthedocs.io/" [build-system] # How pip and other frontends should build this project requires = ["py-build-cmake~=0.3.3", "nanobind", "typing_extensions"] diff --git a/python-src/ggnn/__init__.py b/python-src/pyggnn/__init__.py similarity index 100% rename from python-src/ggnn/__init__.py rename to python-src/pyggnn/__init__.py