Skip to content

Commit

Permalink
chore: rename the library
Browse files Browse the repository at this point in the history
Rename the library to something that better reflects what it is and does

BREAKING CHANGE: The library was renamed from slumba to numbsql
  • Loading branch information
cpcloud committed Aug 31, 2021
1 parent b6bfec0 commit b7a852f
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
- name: Setup Cachix
uses: cachix/cachix-action@v10
with:
name: slumba
name: numbsql
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community

- name: Build package and run tests
run: cachix watch-exec slumba nix-build -- --argstr python python${{ matrix.python-version }} --keep-going
run: cachix watch-exec numbsql nix-build -- --argstr python python${{ matrix.python-version }} --keep-going
conda:
strategy:
fail-fast: false
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
channel-priority: strict
activate-environment: slumba
activate-environment: numbsql
python-version: ${{ matrix.python-version }}
environment-file: environment.yaml

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ These are almost the same as decorating a Python function with `numba.jit`.
```python
from typing import Optional

from slumba import sqlite_udf
from numbsql import sqlite_udf


@sqlite_udf
Expand All @@ -44,17 +44,17 @@ def add_one(x: Optional[int]) -> Optional[int]:
### Aggregate Functions

These follow the API of the Python standard library's
`sqlite3.Connection.create_aggregate` method. The difference with slumba
`sqlite3.Connection.create_aggregate` method. The difference with numbsql
aggregates is that they require two decorators: `numba.experimental.jit_class` and
`slumba.sqlite_udaf`. Let's define the `avg` (arithmetic mean) function for
`numbsql.sqlite_udaf`. Let's define the `avg` (arithmetic mean) function for
64-bit floating point numbers.

```python
from typing import Optional

from numba.experimental import jitclass

from slumba import sqlite_udaf
from numbsql import sqlite_udaf


@sqlite_udaf
Expand Down Expand Up @@ -87,7 +87,7 @@ from typing import Optional

from numba.experimental import jitclass

from slumba import sqlite_udaf
from numbsql import sqlite_udaf


@sqlite_udaf
Expand Down Expand Up @@ -126,7 +126,7 @@ Similar to scalar functions, we register the function with a `sqlite3.Connection

```python
>>> import sqlite3
>>> from slumba import create_aggregate, create_function
>>> from numbsql import create_aggregate, create_function
>>> con = sqlite3.connect(":memory:")
>>> create_function(con, "add_one", 1, add_one)
>>> con.execute("SELECT add_one(1)").fetchall()
Expand Down
5 changes: 1 addition & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ let
pytest --benchmark-disable --numprocesses=$(min $(nproc) 8)
runHook postCheck
'';
# pytestCheckHook fails due to colliding versions of pytest and its
# transitive dependencies
pytestFlags = [ "--benchmark-disable" ];

pythonImportsCheck = [ "slumba" ];
pythonImportsCheck = [ "numbsql" ];
};
in
pkgs.callPackage drv {
Expand Down
2 changes: 1 addition & 1 deletion examples/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numba.experimental import jitclass
from numba.types import ClassType

from slumba import create_aggregate, sqlite_udaf
from numbsql import create_aggregate, sqlite_udaf


@sqlite_udaf
Expand Down
2 changes: 1 addition & 1 deletion examples/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import exp, pi, sqrt
from typing import List, Optional, Tuple

from slumba import create_function, sqlite_udf
from numbsql import create_function, sqlite_udf


@sqlite_udf # type: ignore[misc]
Expand Down
2 changes: 1 addition & 1 deletion notebooks/sqlite-window.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"from typing import Optional\n",
"\n",
"from numba.experimental import jitclass\n",
"from slumba import sqlite_udaf, create_aggregate"
"from numbsql import sqlite_udaf, create_aggregate"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions slumba/__init__.py → numbsql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def create_function(
Examples
--------
>>> import sqlite3
>>> from slumba import sqlite_udf
>>> from numbsql import sqlite_udf
>>> from typing import Optional
>>> @sqlite_udf
... def add_one(value: Optional[int]) -> Optional[int]:
... return value + 1 if value is not None else None
...
>>> from slumba import create_aggregate, create_function
>>> from numbsql import create_aggregate, create_function
>>> con = sqlite3.connect(":memory:")
>>> create_function(con, "add_one", 1, add_one)
>>> con.execute("SELECT add_one(1)").fetchall()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion slumba/scalar.py → numbsql/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def sqlite_udf(
Examples
--------
>>> import sqlite3
>>> from slumba import sqlite_udf
>>> from numbsql import sqlite_udf
>>> from typing import Optional
>>> @sqlite_udf
... def add_one(value: Optional[int]) -> Optional[int]:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from testbook import testbook
from testbook.client import TestbookNotebookClient

from slumba import create_aggregate, sqlite_udaf
from slumba.exceptions import UnsupportedAggregateTypeError
from slumba.sqlite import SQLITE_VERSION
from numbsql import create_aggregate, sqlite_udaf
from numbsql.exceptions import UnsupportedAggregateTypeError
from numbsql.sqlite import SQLITE_VERSION


@sqlite_udaf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from numba import TypingError, boolean, int64, njit

from slumba.numbaext import is_not_null_pointer, sizeof, unsafe_cast
from numbsql.numbaext import is_not_null_pointer, sizeof, unsafe_cast


def test_sizeof_invalid() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from pytest_benchmark.fixture import BenchmarkFixture

from slumba import create_function, sqlite_udf
from numbsql import create_function, sqlite_udf


def add_one_python(x: float) -> float:
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "slumba"
packages = [{ include = "slumba" }]
homepage = "https://github.com/cpcloud/slumba"
repository = "https://github.com/cpcloud/slumba"
name = "numbsql"
packages = [{ include = "numbsql" }]
homepage = "https://github.com/cpcloud/numbsql"
repository = "https://github.com/cpcloud/numbsql"
version = "3.1.0"
description = "JITted SQLite user-defined functions and aggregates"
readme = "README.md"
Expand Down Expand Up @@ -51,14 +51,14 @@ addopts = [
norecursedirs = ["site-packages", "dist-packages"]

[tool.poetry2conda]
name = "slumba"
name = "numbsql"

[tool.poetry2conda.dependencies]
pytest-randomly = { channel = "pip" }

[tool.semantic_release]
version_toml = "pyproject.toml:tool.poetry.version"
version_variable = "slumba/__init__.py:__version__"
version_variable = "numbsql/__init__.py:__version__"
branch = "master"
upload_to_pypi = true
upload_to_release = true
Expand All @@ -76,7 +76,7 @@ profile = "black"
[tool.pydocstyle]
convention = "numpy"
add_ignore = ["D105", "D213", "D203"]
match-dir = "slumba"
match-dir = "numbsql"

[build-system]
requires = ["poetry>=0.12"]
Expand Down
8 changes: 5 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
}
);
editablePackageSources = {
slumba = ./slumba;
numbsql = ./numbsql;
};
};
shellHook = ''
Expand All @@ -28,12 +28,14 @@ let
poetry
prettier
sqlite
cachix
commitizen
];
pythonVersions = [ "3.7" "3.8" "3.9" ];
in
{
dev = pkgs.mkShell {
name = "slumba-build";
name = "numbsql-build";
inherit shellHook;
buildInputs = commonBuildInputs;
};
Expand All @@ -42,7 +44,7 @@ in
(name: {
inherit name;
value = pkgs.mkShell {
name = "slumba-${name}";
name = "numbsql-${name}";
inherit shellHook;
PYTHONPATH = builtins.toPath ./.;
buildInputs = commonBuildInputs ++ [
Expand Down

0 comments on commit b7a852f

Please sign in to comment.