Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
password: ${{ secrets.PYPI_PASSWORD }}
13 changes: 9 additions & 4 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@ name: Test the library

on:
push:
branches:
- master
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yml → .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ repos:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
# - id: codespell
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ convention = "google"
"__init__.py" = ["E402", "F401"]

[tool.black]
force-exclude = "__init__.py"
force-exclude = "__init__.py"
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""
Setup file for tiledbarray.
Use setup.cfg to configure your project.
"""Setup file for tiledbarray. Use setup.cfg to configure your project.

This file was generated with PyScaffold 4.5.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
This file was generated with PyScaffold 4.5.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
from setuptools import setup

Expand Down
19 changes: 8 additions & 11 deletions src/tiledbarray/TileDBArraySeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ def dimnames(self) -> List[str]:

@chunk_grid.register
def chunk_grid_TileDbArraySeed(x: TileDbArraySeed):
"""
See :py:meth:`~delayedarray.chunk_grid.chunk_grid`.
"""See :py:meth:`~delayedarray.chunk_grid.chunk_grid`.

The cost factor is set to 20 to reflect the computational work involved in
extracting data from disk.
The cost factor is set to 20 to reflect the computational work involved in extracting data from disk.
"""
return chunk_shape_to_grid(x._tiles, x._shape, cost_factor=20)

Expand All @@ -142,7 +140,7 @@ def _sanitize_subset(subset, dimlength):
elif isinstance(subset, range):
subset = list(subset)

return subset
return sorted(subset)


def _extract_array(x: TileDbArraySeed, subset: Tuple[Sequence[int], ...]):
Expand Down Expand Up @@ -241,18 +239,17 @@ def extract_sparse_array_TileDbArraySeed(


class TileDbArray(DelayedArray):
"""Sparse or Dense arrays from TileDB file as a ``DelayedArray``. This
subclass allows developers to implement custom methods for tiledb-backed
sparse or dense matrices."""
"""Sparse or Dense arrays from TileDB file as a ``DelayedArray``.

This subclass allows developers to implement custom methods for tiledb-backed sparse or dense matrices.
"""

def __init__(
self,
path: Union[str, TileDbArraySeed],
attribute_name: Optional[str],
):
"""
To construct a ``TileDbArray`` from an existing
:py:class:`~TileDbArraySeed`, use
"""To construct a ``TileDbArray`` from an existing :py:class:`~TileDbArraySeed`, use
:py:meth:`~delayedarray.wrap.wrap` instead.

Args:
Expand Down
2 changes: 1 addition & 1 deletion src/tiledbarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
finally:
del version, PackageNotFoundError

from .TileDBArraySeed import TileDbArraySeed, TileDbArray
from .TileDBArraySeed import TileDbArraySeed, TileDbArray
11 changes: 5 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""
Dummy conftest.py for tiledbarray.
"""Dummy conftest.py for tiledbarray.

If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
- https://docs.pytest.org/en/stable/fixture.html
- https://docs.pytest.org/en/stable/writing_plugins.html
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
- https://docs.pytest.org/en/stable/fixture.html
- https://docs.pytest.org/en/stable/writing_plugins.html
"""

# import pytest
2 changes: 1 addition & 1 deletion tests/test_tiledbarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ def test_TileDbArray():
is True
)

assert np.allclose(delayedarray.to_dense_array(roundtrip), y) is True
assert np.allclose(delayedarray.to_dense_array(roundtrip), y) is True