From 131a56d9261c422f787ea289249f812c8d5fa76b Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Wed, 19 Jul 2023 18:04:56 +0200 Subject: [PATCH] Applied review comments --- .github/workflows/build-sphinx.yml | 24 +++++++++++++++++++++++- doc/dpnp_backend_api.rst | 2 +- doc/overview.rst | 2 +- doc/quick_start_guide.rst | 4 ++-- doc/reference/difference.rst | 4 ++-- dpnp/backend/doc/Doxyfile | 2 +- dpnp/dpnp_iface.py | 10 +++++++--- 7 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index bfafa2753db..8f40d703976 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -6,6 +6,9 @@ on: pull_request: types: [opened, synchronize, reopened, closed] +permissions: + pull-requests: write + env: PUBLISH_DIR: doc/_build/html/ @@ -122,7 +125,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ${{ env.PUBLISH_DIR }} - - name: Deploy docs [PR] + - name: Publish pull-request docs if: | !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' uses: peaceiris/actions-gh-pages@v3.9.3 @@ -136,6 +139,17 @@ jobs: user_name: 'github-actions[bot]' user_email: 'github-actions[bot]@users.noreply.github.com' + - name: Comment with URL to published pull-request docs + if: | + !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' + env: + PR_NUM: ${{ github.event.number }} + uses: mshick/add-pr-comment@v2.8.1 + with: + message: | + View rendered docs @ https://intelpython.github.io/dpnp/pulls/${{ env.PR_NUM }}/index.html + allow-repeats: false + clean: if: | !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action == 'closed' @@ -162,3 +176,11 @@ jobs: git config --global user.email 'github-actions[bot]@users.noreply.github.com' git commit -m "Removing docs for closed pull request ${PR_NUM}" git push tokened_docs gh-pages + + - name: Modify the comment with URL to published pull-request docs + uses: mshick/add-pr-comment@v2.8.1 + with: + find: | + View rendered docs @.+ + replace: | + View rendered docs @ https://intelpython.github.io/dpnp/index.html diff --git a/doc/dpnp_backend_api.rst b/doc/dpnp_backend_api.rst index e0c78ba9b62..56256c93935 100644 --- a/doc/dpnp_backend_api.rst +++ b/doc/dpnp_backend_api.rst @@ -4,4 +4,4 @@ C++ backend API Reference ************************* -`DPNP C++ backend `_ +`C++ backend of Data Parallel Extension for NumPy* `_ diff --git a/doc/overview.rst b/doc/overview.rst index 627a6035b8f..4215566df7e 100644 --- a/doc/overview.rst +++ b/doc/overview.rst @@ -14,7 +14,7 @@ functions and numerical data types. The Data Parallel Extension for NumPy* is being developed as part of `Intel AI Analytics Toolkit`_ and is distributed with the `Intel Distribution for Python*`_. The dpnp package is also available -on Anaconda cloud. Please refer the :doc:`getting_started` page to learn more. +on Anaconda cloud. Please refer the :doc:`quick_start_guide` page to learn more. Being drop-in replacement for `NumPy*`_ means that the usage is very similar: diff --git a/doc/quick_start_guide.rst b/doc/quick_start_guide.rst index f6d81863e41..a2e7df79746 100644 --- a/doc/quick_start_guide.rst +++ b/doc/quick_start_guide.rst @@ -43,9 +43,9 @@ Install Package from Anaconda It is recommended to use conda packages from the ``anaconda.org/intel`` channel. You will need one of the commands below: -* Conda: ``conda install dpnp`` +* Conda: ``conda install dpnp -c intel -c conda-forge`` -* Pip: ``pip install dpnp`` +* Pip: ``pip install -i https://pypi.anaconda.org/intel/simple dpnp`` These commands install dpnp package along with its dependencies, including ``dpctl`` package with `Data Parallel Control Library`_ and all required diff --git a/doc/reference/difference.rst b/doc/reference/difference.rst index ef0eb71a88e..9f2d28f3b97 100644 --- a/doc/reference/difference.rst +++ b/doc/reference/difference.rst @@ -1,5 +1,5 @@ -Difference between DPNP and NumPy -================================= +Difference with NumPy* +====================== .. _Data types: diff --git a/dpnp/backend/doc/Doxyfile b/dpnp/backend/doc/Doxyfile index ec73279f6eb..2d99d18f082 100644 --- a/dpnp/backend/doc/Doxyfile +++ b/dpnp/backend/doc/Doxyfile @@ -44,7 +44,7 @@ PROJECT_NUMBER = 0.12.1 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "NumPy-like API accelerated with SYCL" +PROJECT_BRIEF = "Data Parallel Extension for NumPy*" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/dpnp/dpnp_iface.py b/dpnp/dpnp_iface.py index 3c80458f94a..515d3051323 100644 --- a/dpnp/dpnp_iface.py +++ b/dpnp/dpnp_iface.py @@ -334,11 +334,15 @@ def get_dpnp_descriptor( def get_include(): - r"""Return the directory that contains the DPNP C++ backend \*.h header files.""" + r""" + Return the directory that contains \*.h header files of dpnp C++ backend. - dpnp_path = os.path.join(os.path.dirname(__file__), "backend", "include") + An extension module that needs to be compiled against dpnp backend + should use this function to locate the appropriate include directory. - return dpnp_path + """ + + return os.path.join(os.path.dirname(__file__), "backend", "include") def get_normalized_queue_device(obj=None, device=None, sycl_queue=None):