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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,6 @@ compile_commands.json
/quaddtype/subprojects/qblas/
/quaddtype/subprojects/sleef/
.wraplock

# docs
/quaddtype/docs/_build/
6 changes: 3 additions & 3 deletions quaddtype/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ np.array([1,2,3], dtype=QuadPrecDType("longdouble"))

## Installation from source

#### Prerequisites
### Prerequisites

- **gcc/clang**
- **CMake** (≥3.15)
Expand All @@ -43,7 +43,7 @@ python3 -m venv temp
source temp/bin/activate

# Install the package
pip install numpy pytest
pip install numpy pytest meson-python

# To build without QBLAS (default for MSVC)
# export CFLAGS="-DDISABLE_QUADBLAS"
Expand Down Expand Up @@ -167,4 +167,4 @@ This is a development feature to help detect threading issues. To build `numpy-q
export CXXFLAGS="-fsanitize=thread -g -O0"
export LDFLAGS="-fsanitize=thread"
python -m pip install . -vv --no-build-isolation -Csetup-args=-Db_sanitize=thread
```
```
20 changes: 20 additions & 0 deletions quaddtype/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions quaddtype/docs/api_docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NumPy QuadDType API Documentation
=================================

.. automodule:: numpy_quaddtype
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions quaddtype/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'NumPy QuadDType'
copyright = '2025, NumPy Community'
author = 'NumPy Community'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'myst_parser',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

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

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
8 changes: 8 additions & 0 deletions quaddtype/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```{include} ../README.md
```

```{toctree}
:hidden:

api_docs.rst
```
35 changes: 35 additions & 0 deletions quaddtype/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
6 changes: 6 additions & 0 deletions quaddtype/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ test = [
"pytest-run-parallel"
]

docs = [
"sphinx",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngoldbaum (didn't explored in deep yet) Would this startup setup be extendable to your work (https://unyt.readthedocs.io/en/stable/)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, unyt also uses sphinx. It doesn't use myst because unyt predates myst.

I would defer to Melissa's setup. Maybe look at unyt if you're interested in setting up doctesting.

"pydata-sphinx-theme",
"myst-parser",
]

[project.urls]
Repository = "https://github.com/numpy/numpy-user-dtypes"
Documentation = "https://github.com/numpy/numpy-user-dtypes/tree/main/quaddtype"
Expand Down