Skip to content

Commit

Permalink
Rename PointCloud -> PointCloudDataFrame on spatial branch (#3104)
Browse files Browse the repository at this point in the history
Merge in `main` and rename `PointCloud` -> `PointCloudDataFrame`

---------

Co-authored-by: John Kerl <kerl.john.r@gmail.com>
Co-authored-by: Ryan Williams <ryan.williams@tiledb.com>
Co-authored-by: Paul Hoffman <mojaveazure@users.noreply.github.com>
Co-authored-by: Aaron Wolen <aaron@wolen.com>
Co-authored-by: nguyenv <vivian@tiledb.com>
  • Loading branch information
6 people committed Oct 1, 2024
1 parent 45937a1 commit 3fc7a34
Show file tree
Hide file tree
Showing 83 changed files with 1,768 additions and 411 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/python-ci-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
apt-get install --yes cmake git python-is-python3 python3 python3-pip python3-venv unzip wget
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for setuptools-scm
fetch-depth: 0 # for setuptools-scm
- name: Configure Git
run: |
# This is a permissions quirk due to running Git as root inside of a Docker container
Expand All @@ -76,7 +76,7 @@ jobs:
run: |
mkdir -p external
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.1/tiledb-linux-x86_64-2.26.1-db1cee4.tar.gz
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.2/tiledb-linux-x86_64-2.26.2-30fc114.tar.gz
tar -C external -xzf tiledb-linux-x86_64-*.tar.gz
ls external/lib/
echo "LD_LIBRARY_PATH=$(pwd)/external/lib" >> $GITHUB_ENV
Expand All @@ -101,7 +101,7 @@ jobs:
run: |
python --version
python -m venv ./venv-soma
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse wheel
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse 'setuptools>=70.1' wheel
./venv-soma/bin/pip list
- name: Build wheel
run: |
Expand Down Expand Up @@ -164,15 +164,15 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for setuptools-scm
fetch-depth: 0 # for setuptools-scm
- name: Check if System Integrity Protection (SIP) is enabled
run: csrutil status
- name: Install pre-built libtiledb
if: ${{ matrix.TILEDB_EXISTS == 'yes' }}
run: |
mkdir -p external
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.1/tiledb-macos-x86_64-2.26.1-db1cee4.tar.gz
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.2/tiledb-macos-x86_64-2.26.2-30fc114.tar.gz
tar -C external -xzf tiledb-macos-x86_64-*.tar.gz
ls external/lib/
echo "DYLD_LIBRARY_PATH=$(pwd)/external/lib" >> $GITHUB_ENV
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
run: |
python --version
python -m venv ./venv-soma
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse wheel setuptools
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse wheel 'setuptools>=70.1'
./venv-soma/bin/pip list
- name: Build wheel
run: |
Expand Down Expand Up @@ -257,17 +257,17 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for setuptools-scm
fetch-depth: 0 # for setuptools-scm
- name: Install pre-built libtiledb
run: |
mkdir -p external
if [ `uname -s` == "Darwin" ];
then
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.1/tiledb-macos-x86_64-2.26.1-db1cee4.tar.gz
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.2/tiledb-macos-x86_64-2.26.2-30fc114.tar.gz
else
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.1/tiledb-linux-x86_64-2.26.1-db1cee4.tar.gz
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.26.2/tiledb-linux-x86_64-2.26.2-30fc114.tar.gz
fi
tar -C external -xzf tiledb-*.tar.gz
ls external/lib/
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
run: |
python --version
python -m venv ./venv-soma
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse wheel setuptools
./venv-soma/bin/pip install --prefer-binary pybind11-global typeguard sparse wheel 'setuptools>=70.1'
./venv-soma/bin/pip list
- name: Install TileDB-SOMA-Py with setuptools and --libtiledbsoma
run: |
Expand Down Expand Up @@ -359,13 +359,13 @@ jobs:
- uses: actions/checkout@v4
with:
path: TileDB-SOMA
fetch-depth: 0 # for setuptools-scm
fetch-depth: 0 # for setuptools-scm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install --prefer-binary pybind11 wheel
run: pip install --prefer-binary pybind11 'setuptools>=70.1' wheel
- name: Build source tarball (sdist)
run: |
cd TileDB-SOMA/apis/python
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
# Pandas 2.x types (e.g. `pd.Series[Any]`). See `_types.py` or https://github.com/single-cell-data/TileDB-SOMA/issues/2839
# for more info.
- "pandas-stubs>=2"
- "somacore==1.0.18"
- "somacore==1.0.19"
- types-setuptools
args: ["--config-file=apis/python/pyproject.toml", "apis/python/src", "apis/python/devtools"]
pass_filenames: false
44 changes: 22 additions & 22 deletions apis/python/notebooks/tutorial_spatial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"\n",
"/home/julia/Software/TileDB-Inc/TileDB-SOMA/apis/python/src/tiledbsoma/_multiscale_image.py:151: UserWarning: Support for spatial types is experimental. Changes to both the API and data storage may not be backwards compatible.\n",
" warnings.warn(SPATIAL_DISCLAIMER)\n",
"/home/julia/Software/TileDB-Inc/TileDB-SOMA/apis/python/src/tiledbsoma/_point_cloud.py:116: UserWarning: Support for spatial types is experimental. Changes to both the API and data storage may not be backwards compatible.\n",
"/home/julia/Software/TileDB-Inc/TileDB-SOMA/apis/python/src/tiledbsoma/_point_cloud_dataframe.py:116: UserWarning: Support for spatial types is experimental. Changes to both the API and data storage may not be backwards compatible.\n",
" warnings.warn(SPATIAL_DISCLAIMER)\n"
]
}
Expand Down Expand Up @@ -591,7 +591,7 @@
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f3c3cd20cd0>"
"<matplotlib.image.AxesImage at 0x7fd55f5d9710>"
]
},
"execution_count": 20,
Expand Down Expand Up @@ -1065,7 +1065,7 @@
{
"data": {
"text/plain": [
"<somacore.coordinates.IdentityTransform at 0x7f3c5f839510>"
"<somacore.coordinates.IdentityTransform at 0x7fd55cc1a550>"
]
},
"execution_count": 28,
Expand All @@ -1086,7 +1086,7 @@
{
"data": {
"text/plain": [
"<somacore.coordinates.ScaleTransform at 0x7f3c3ce66e90>"
"<somacore.coordinates.ScaleTransform at 0x7fd53a107950>"
]
},
"execution_count": 29,
Expand All @@ -1100,23 +1100,23 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 31,
"id": "8fa549eb-598d-4a0c-9ab9-dd1bfac4199b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<somacore.coordinates.IdentityTransform at 0x7f3c5f884fd0>"
"<somacore.coordinates.IdentityTransform at 0x7fd55f637610>"
]
},
"execution_count": 30,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"scene.get_transform_to_point_cloud(\"loc\")"
"scene.get_transform_to_point_cloud_dataframe(\"loc\")"
]
},
{
Expand All @@ -1133,7 +1133,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 32,
"id": "18751a3c-0e29-4e00-ba58-3529e7164f6c",
"metadata": {},
"outputs": [],
Expand All @@ -1145,7 +1145,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 33,
"id": "02d18d4b-0caf-4fd5-ab6f-a0c8b2122069",
"metadata": {},
"outputs": [
Expand All @@ -1155,10 +1155,10 @@
"SpatialRead(data=<pyarrow.Tensor>\n",
"type: uint8\n",
"shape: (753, 853, 3)\n",
"strides: (2559, 3, 1), data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<somacore.coordinates.AffineTransform object at 0x7f3c6223ca50>)"
"strides: (2559, 3, 1), data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<somacore.coordinates.AffineTransform object at 0x7fd55f640310>)"
]
},
"execution_count": 32,
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1178,17 +1178,17 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 34,
"id": "e136c1b9-3b7f-44ed-aa20-e2abdb1868e1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"SpatialRead(data=<tiledbsoma._read_iters.TableReadIter object at 0x7f3c3ce090d0>, data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<somacore.coordinates.IdentityTransform object at 0x7f3c5f83b490>)"
"SpatialRead(data=<tiledbsoma._read_iters.TableReadIter object at 0x7fd55cbdf850>, data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<somacore.coordinates.IdentityTransform object at 0x7fd55cbedc10>)"
]
},
"execution_count": 33,
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1200,7 +1200,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 35,
"id": "53554033-a469-4126-88a3-bd9cec9fd78f",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -1380,7 +1380,7 @@
"[928 rows x 7 columns]"
]
},
"execution_count": 34,
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1392,7 +1392,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 36,
"id": "34a51b21-2d77-47c2-a3e1-bf159cd1b001",
"metadata": {},
"outputs": [
Expand All @@ -1404,7 +1404,7 @@
" [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]])"
]
},
"execution_count": 35,
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1416,7 +1416,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 37,
"id": "c7c22f26-613c-44d9-9ce9-7abc64b377f9",
"metadata": {},
"outputs": [],
Expand All @@ -1429,7 +1429,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 38,
"id": "021cf9b5-9880-4857-8164-326dc26d8b6d",
"metadata": {},
"outputs": [],
Expand All @@ -1449,7 +1449,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 39,
"id": "1a67bc46-f768-4a16-8324-828c5a38bd57",
"metadata": {},
"outputs": [
Expand Down
3 changes: 1 addition & 2 deletions apis/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[build-system]
requires = [
"pybind11[global]>=2.10.0",
"setuptools>=65.5.1",
"wheel>=0.37.1",
"setuptools>=70.1", # `setuptools.command.bdist_wheel`
"cmake>=3.21",
]
build-backend = "setuptools.build_meta"
Expand Down
8 changes: 4 additions & 4 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import sys
from typing import Optional

import setuptools.command.bdist_wheel
import setuptools.command.build_ext
import wheel.bdist_wheel

try:
from pybind11.setup_helpers import Pybind11Extension
Expand Down Expand Up @@ -219,7 +219,7 @@ def run(self):
super().run()


class bdist_wheel(wheel.bdist_wheel.bdist_wheel):
class bdist_wheel(setuptools.command.bdist_wheel.bdist_wheel):
def run(self):
find_or_build_package_data(self)
super().run()
Expand Down Expand Up @@ -307,9 +307,9 @@ def run(self):
"src/tiledbsoma/soma_array.cc",
"src/tiledbsoma/soma_object.cc",
"src/tiledbsoma/soma_dataframe.cc",
"src/tiledbsoma/soma_point_cloud_dataframe.cc",
"src/tiledbsoma/soma_dense_ndarray.cc",
"src/tiledbsoma/soma_sparse_ndarray.cc",
"src/tiledbsoma/soma_point_cloud.cc",
"src/tiledbsoma/soma_group.cc",
"src/tiledbsoma/soma_collection.cc",
"src/tiledbsoma/pytiledbsoma.cc",
Expand All @@ -336,7 +336,7 @@ def run(self):
"scanpy>=1.9.2",
"scipy",
# Note: the somacore version is in .pre-commit-config.yaml too
"somacore==1.0.18",
"somacore==1.0.19",
"tiledb~=0.32.0",
"typing-extensions", # Note "-" even though `import typing_extensions`
],
Expand Down
6 changes: 2 additions & 4 deletions apis/python/src/tiledbsoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,9 @@ def _new_shape_feature_flag_enabled() -> bool:
from ._indexer import IntIndexer, tiledbsoma_build_index
from ._measurement import Measurement
from ._multiscale_image import MultiscaleImage
from ._point_cloud import PointCloud
from ._point_cloud_dataframe import PointCloudDataFrame
from ._geometry_dataframe import GeometryDataFrame
from ._sparse_nd_array import SparseNDArray, SparseNDArrayRead
from ._point_cloud import PointCloud
from ._geometry_dataframe import GeometryDataFrame
from ._scene import Scene
from .options import SOMATileDBContext, TileDBCreateOptions, TileDBWriteOptions
from .pytiledbsoma import (
Expand Down Expand Up @@ -229,7 +227,7 @@ def _new_shape_feature_flag_enabled() -> bool:
"MultiscaleImage",
"NotCreateableError",
"open",
"PointCloud",
"PointCloudDataFrame",
"ResultOrder",
"Scene",
"show_package_versions",
Expand Down
9 changes: 3 additions & 6 deletions apis/python/src/tiledbsoma/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@

SOMA_JOINID = "soma_joinid"
SOMA_GEOMETRY = "soma_geometry"
SOMA_COORDINATE_SPACE_METADATA_KEY = "soma_coordinate_space"
SOMA_MULTISCALE_IMAGE_SCHEMA = "soma_multiscale_image_schema"
SOMA_OBJECT_TYPE_METADATA_KEY = "soma_object_type"
SOMA_ENCODING_VERSION_METADATA_KEY = "soma_encoding_version"
SOMA_ENCODING_VERSION = "1"

SOMA_ENCODING_VERSION = "1.1.0"

# Spatial specific constants
SOMA_GEOMETRY = "soma_geometry"
SOMA_COORDINATE_SPACE_METADATA_KEY = "soma_coordinate_space"
SOMA_MULTISCALE_IMAGE_SCHEMA = "soma_multiscale_image_schema"
SPATIAL_DISCLAIMER = (
"Support for spatial types is experimental. Changes to both the API and data "
"storage may not be backwards compatible."
Expand Down
Loading

0 comments on commit 3fc7a34

Please sign in to comment.