-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:single-cell-data/TileDB-SOMA
- Loading branch information
Showing
21 changed files
with
196 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Testing module for regression tests""" | ||
|
||
|
||
import numpy as np | ||
import pyarrow as pa | ||
|
||
import tiledbsoma as soma | ||
|
||
|
||
def test_nd_dense_non_contiguous_write(tmp_path): | ||
"""Test regression dected in GitHub Issue #2537""" | ||
# Create data. | ||
data = ( | ||
np.arange(np.product(24), dtype=np.uint8) | ||
.reshape((4, 3, 2)) | ||
.transpose((2, 0, 1)) | ||
) | ||
coords = tuple(slice(0, dim_len) for dim_len in data.shape) | ||
tensor = pa.Tensor.from_numpy(data) | ||
|
||
# Create array and write data to it. | ||
with soma.DenseNDArray.create( | ||
tmp_path.as_posix(), type=pa.uint8(), shape=data.shape | ||
) as array: | ||
array.write(coords, tensor) | ||
|
||
# Check the data is correct when we read it back. | ||
with soma.DenseNDArray.open(tmp_path.as_posix()) as array: | ||
result = array.read(coords) | ||
np.testing.assert_equal(data, result.to_numpy()) | ||
|
||
# Check the data is correct when we read it back. | ||
with soma.DenseNDArray.open(tmp_path.as_posix()) as array: | ||
result = array.read(coords, result_order="column-major") | ||
np.testing.assert_equal(data.transpose(), result.to_numpy()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
# Basic on-laptop setup | ||
|
||
``` | ||
pip install . | ||
Build the docs with: | ||
```bash | ||
./local-build.sh | ||
``` | ||
|
||
This is very important -- _for developers_, the nominal use-mode is `python setup.py develop` as documented in our [../apis/python/README.md](../apis/python/README.md). But this local build _will not find_ `tiledbsoma-py` from this local install. You must install `pip install apis/python so it can find Python source for document autogen, _and_ you must re-run `pip install apis/python after each and every source-file edit, even if you're just doing an edit-build-preview iteration loop in a sandbox checkout. | ||
The first time you run this, it will: | ||
1. Create and activate a virtualenv (`venv/`) | ||
2. Install [`requirements_doc.txt`](requirements_doc.txt) | ||
3. Install `..apis/python` (editable) | ||
4. Build the docs (output to `doc/html/`) | ||
|
||
``` | ||
#!/bin/bash | ||
set -euo pipefail | ||
sphinx-build -E -T -b html -d foo/doctrees -D language=en doc/source doc/html | ||
``` | ||
Subsequent runs will only perform the 4th step (unless `-r`/`--reinstall` is passed). | ||
|
||
Once the docs are built, you can: | ||
|
||
```bash | ||
open source/_build/html/index.html | ||
``` | ||
#!/bin/bash | ||
set -euo pipefail | ||
open doc/html/python-api.html | ||
or e.g.: | ||
```bash | ||
http-server source/_build/html & | ||
open http://localhost:8080/ | ||
``` | ||
|
||
and inspect them. |
Oops, something went wrong.