From 812462fc47210b69ee54856825419714032b53da Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 10:19:36 +0200 Subject: [PATCH 1/9] Add documentation via readthedocs. --- .readthedocs.yaml | 16 ++++++++++++++++ {doc => docs}/Makefile | 0 {doc => docs}/source/_static/banner.jpg | Bin {doc => docs}/source/api.rst | 0 {doc => docs}/source/changes.rst | 0 {doc => docs}/source/conf.py | 0 {doc => docs}/source/debugging.rst | 0 {doc => docs}/source/disk_scaling.png | Bin {doc => docs}/source/filters.rst | 0 {doc => docs}/source/index.rst | 0 {doc => docs}/source/license.rst | 0 docs/source/requirements.txt | 3 +++ {doc => docs}/source/usage.rst | 0 tox.ini | 6 ++---- 14 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .readthedocs.yaml rename {doc => docs}/Makefile (100%) rename {doc => docs}/source/_static/banner.jpg (100%) rename {doc => docs}/source/api.rst (100%) rename {doc => docs}/source/changes.rst (100%) rename {doc => docs}/source/conf.py (100%) rename {doc => docs}/source/debugging.rst (100%) rename {doc => docs}/source/disk_scaling.png (100%) rename {doc => docs}/source/filters.rst (100%) rename {doc => docs}/source/index.rst (100%) rename {doc => docs}/source/license.rst (100%) create mode 100644 docs/source/requirements.txt rename {doc => docs}/source/usage.rst (100%) diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..796fca2 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,16 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + jobs: + post_checkout: + - git submodule update --init + +sphinx: + configuration: docs/source/conf.py + +python: + install: + - requirements: docs/source/requirements.txt diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/source/_static/banner.jpg b/docs/source/_static/banner.jpg similarity index 100% rename from doc/source/_static/banner.jpg rename to docs/source/_static/banner.jpg diff --git a/doc/source/api.rst b/docs/source/api.rst similarity index 100% rename from doc/source/api.rst rename to docs/source/api.rst diff --git a/doc/source/changes.rst b/docs/source/changes.rst similarity index 100% rename from doc/source/changes.rst rename to docs/source/changes.rst diff --git a/doc/source/conf.py b/docs/source/conf.py similarity index 100% rename from doc/source/conf.py rename to docs/source/conf.py diff --git a/doc/source/debugging.rst b/docs/source/debugging.rst similarity index 100% rename from doc/source/debugging.rst rename to docs/source/debugging.rst diff --git a/doc/source/disk_scaling.png b/docs/source/disk_scaling.png similarity index 100% rename from doc/source/disk_scaling.png rename to docs/source/disk_scaling.png diff --git a/doc/source/filters.rst b/docs/source/filters.rst similarity index 100% rename from doc/source/filters.rst rename to docs/source/filters.rst diff --git a/doc/source/index.rst b/docs/source/index.rst similarity index 100% rename from doc/source/index.rst rename to docs/source/index.rst diff --git a/doc/source/license.rst b/docs/source/license.rst similarity index 100% rename from doc/source/license.rst rename to docs/source/license.rst diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt new file mode 100644 index 0000000..174a0bb --- /dev/null +++ b/docs/source/requirements.txt @@ -0,0 +1,3 @@ +mock +sphinx +sphinx-bluebrain-theme diff --git a/doc/source/usage.rst b/docs/source/usage.rst similarity index 100% rename from doc/source/usage.rst rename to docs/source/usage.rst diff --git a/tox.ini b/tox.ini index 2facc54..f3c8ef5 100644 --- a/tox.ini +++ b/tox.ini @@ -33,10 +33,8 @@ commands = ruff format --check [testenv:docs] -changedir = doc -deps = - sphinx - sphinx-bluebrain-theme +changedir = docs +dep_file = docs/source/requirements.txt # set warnings as errors using the -W sphinx option commands = make html SPHINXOPTS=-W allowlist_externals = make From f248ba433fa12ea5ae54eb04b462dc82e55cc23b Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 10:37:20 +0200 Subject: [PATCH 2/9] =?UTF-8?q?=E2=9D=84=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/source/conf.py | 2 ++ src/functionalizer/schema.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4be4629..f4e1863 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,5 @@ +"""Long-standing documentation configuration. +""" # -*- coding: utf-8 -*- from importlib.metadata import version as get_version diff --git a/src/functionalizer/schema.py b/src/functionalizer/schema.py index 2d833ba..23459cc 100644 --- a/src/functionalizer/schema.py +++ b/src/functionalizer/schema.py @@ -89,7 +89,7 @@ def schema_for_dataframe(df): """Create a Spark schema from the Pandas DataFrame.""" def _type(col): - if df.dtypes[col] == object: + if df.dtypes[col] is object: return T.StringType() return typedef.as_spark_type(df.dtypes[col]) From 4088158f495172efbcd45d3cbe1b4900664e9a35 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 10:46:16 +0200 Subject: [PATCH 3/9] Let cibuildwheel float more --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a21332e..7d3ab66 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,7 +77,7 @@ jobs: - uses: actions/setup-python@v5 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.18.1 + run: python -m pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir dist From 9dbe11879d87cf04acd1ebe87d569977f9c25f69 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 11:38:10 +0200 Subject: [PATCH 4/9] Install local package. --- .readthedocs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 796fca2..938c7f9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,3 +14,5 @@ sphinx: python: install: - requirements: docs/source/requirements.txt + - method: pip + path: . From be87d5a69947b0d72de4e491ce2a6ecaabf71215 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 11:47:31 +0200 Subject: [PATCH 5/9] Add OpenMPI dependency --- .readthedocs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 938c7f9..531f82d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,6 +2,8 @@ version: 2 build: os: ubuntu-22.04 + apt_packages: + - libopenmpi-dev tools: python: "3.12" jobs: From ccede06e2b9cd33e0c839a823a97f76a4ccc4426 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 12:09:36 +0200 Subject: [PATCH 6/9] Upgrade PyBind11 for Numpy compatibility --- deps/pybind11 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/pybind11 b/deps/pybind11 index 8a099e4..941f45b 160000 --- a/deps/pybind11 +++ b/deps/pybind11 @@ -1 +1 @@ -Subproject commit 8a099e44b3d5f85b20f05828d919d2332a8de841 +Subproject commit 941f45bcb51457884fa1afd6e24a67377d70f75c From 1d03fac49919ac097eb242e4942628bf5307f308 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 12:09:57 +0200 Subject: [PATCH 7/9] =?UTF-8?q?=E2=9D=84=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index f4e1863..2b8283e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,4 @@ -"""Long-standing documentation configuration. -""" +"""Long-standing documentation configuration.""" # -*- coding: utf-8 -*- from importlib.metadata import version as get_version From 11332e73f05ac78e83ee4a3f27cd68dbfdf2fe7d Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 13:07:08 +0200 Subject: [PATCH 8/9] Lint. --- docs/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2b8283e..207fc99 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,5 @@ """Long-standing documentation configuration.""" + # -*- coding: utf-8 -*- from importlib.metadata import version as get_version From 300ede1b787030ca28c6cf2855af29068e9a8144 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Mon, 8 Jul 2024 13:08:40 +0200 Subject: [PATCH 9/9] Fix Numpy to be in line with Apache projects. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a15e9f7..0afbc2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "morphio", "mpi4py", "libsonata", - "numpy", + "numpy<2", "packaging", "pandas", "pyarrow<15",