diff --git a/.gitignore b/.gitignore index e211849..ad2c9bf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .dir-locals.el # setuptools_scm -src/awkward_pandas/version.py +src/akimbo/version.py # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/README.md b/README.md index 8b01e54..76bda7e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# awkward-pandas +# akimbo > Awkward Array extension for use in pandas. -[![Tests](https://github.com/intake/awkward-pandas/actions/workflows/pypi.yml/badge.svg)](https://github.com/intake/awkward-pandas/actions/workflows/pypi.yml) -[![Documentation Status](https://readthedocs.org/projects/awkward-pandas/badge/?version=latest)](https://awkward-pandas.readthedocs.io/en/latest/?badge=latest) +[![Tests](https://github.com/intake/akimbo/actions/workflows/pypi.yml/badge.svg)](https://github.com/intake/akimbo/actions/workflows/pypi.yml) +[![Documentation Status](https://readthedocs.org/projects/akimbo/badge/?version=latest)](https://akimbo.readthedocs.io/en/latest/?badge=latest) See the [quick -start](https://awkward-pandas.readthedocs.io/en/latest/quickstart.html) -in the documentation for an introduction to awkward-pandas. +start](https://akimbo.readthedocs.io/en/latest/quickstart.html) +in the documentation for an introduction to akimbo. Acknowledgements ---------------- diff --git a/docs/api.rst b/docs/api.rst index b7c099a..5c6c996 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,7 +1,7 @@ -awkward-pandas +akimbo ============== -.. currentmodule:: awkward_pandas +.. currentmodule:: akimbo Top Level Functions ~~~~~~~~~~~~~~~~~~~ @@ -17,7 +17,7 @@ Top Level Functions Accessor ~~~~~~~~ -.. currentmodule:: awkward_pandas.accessor +.. currentmodule:: akimbo.accessor .. autosummary:: :toctree: generated/ diff --git a/docs/conf.py b/docs/conf.py index 430d774..461cf3c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,7 +6,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "awkward-pandas" +project = "akimbo" copyright = "2022, Awkward Developers" author = "Awkward Developers" @@ -29,7 +29,7 @@ "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints", - "**awkward-pandas-demo.ipynb", + "**akimbo-demo.ipynb", ] diff --git a/docs/demo/awkward-pandas-demo.ipynb b/docs/demo/awkward-pandas-demo.ipynb index c4bac8b..bbc2448 100644 --- a/docs/demo/awkward-pandas-demo.ipynb +++ b/docs/demo/awkward-pandas-demo.ipynb @@ -7,7 +7,7 @@ "metadata": {}, "outputs": [], "source": [ - "import awkward_pandas\n", + "import akimbo\n", "import pandas as pd\n", "import awkward as ak\n", "import dask_awkward as dak" @@ -442,7 +442,7 @@ "id": "04ecbc23-4834-4ebe-bdb5-f2e467c2137d", "metadata": {}, "source": [ - "In awkward-pandas world we have access to functions from the awkward-array API:" + "In akimbo world we have access to functions from the awkward-array API:" ] }, { @@ -955,7 +955,7 @@ "metadata": {}, "outputs": [], "source": [ - "merged = awkward_pandas.merge(df[[\"run\", \"luminosityBlock\"]])" + "merged = akimbo.merge(df[[\"run\", \"luminosityBlock\"]])" ] }, { @@ -1024,7 +1024,7 @@ } ], "source": [ - "ak.to_parquet(awkward_pandas.merge(df[df.luminosityBlock == maybe_strange_lumiblock]), \"strange.parquet\")" + "ak.to_parquet(akimbo.merge(df[df.luminosityBlock == maybe_strange_lumiblock]), \"strange.parquet\")" ] }, { @@ -1051,7 +1051,7 @@ } ], "source": [ - "ak.to_parquet(awkward_pandas.merge(df[df.luminosityBlock == maybe_strange_lumiblock]).values._data, \"strange.parquet\")" + "ak.to_parquet(akimbo.merge(df[df.luminosityBlock == maybe_strange_lumiblock]).values._data, \"strange.parquet\")" ] }, { diff --git a/docs/index.rst b/docs/index.rst index 9d4a892..0778598 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. awkward-pandas documentation master file, created by +.. akimbo documentation master file, created by sphinx-quickstart on Wed Oct 26 10:24:20 2022. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. @@ -6,7 +6,7 @@ Awkward Pandas ============== -The awkward-pandas project provides a Pandas `ExtensionArray`_ and +The akimbo project provides a Pandas `ExtensionArray`_ and `ExtensionDtype`_ that enable analysis of nested, non-tabular data in workflows that are already leveraging `Pandas`_ Series and DataFrames. diff --git a/docs/install.rst b/docs/install.rst index 2f62b12..ca4cf04 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -4,7 +4,7 @@ Installation Requirements ~~~~~~~~~~~~ -To install ``awkward-pandas`` you will need both ``awkward`` and +To install ``akimbo`` you will need both ``awkward`` and ``pandas``. Whether you install from PyPI or conda-forge, these requirements will be enforced. The strict requirements are: @@ -16,14 +16,14 @@ From PyPI .. code-block:: none - $ pip install awkward-pandas + $ pip install akimbo From conda-forge ~~~~~~~~~~~~~~~~ .. code-block:: none - $ conda install awkward-pandas -c conda-forge + $ conda install akimbo -c conda-forge Optional dependencies ~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/quickstart.ipynb b/docs/quickstart.ipynb index 665c35c..249bfc8 100644 --- a/docs/quickstart.ipynb +++ b/docs/quickstart.ipynb @@ -24,7 +24,7 @@ "outputs": [], "source": [ "import awkward as ak\n", - "import awkward_pandas as akpd\n", + "import akimbo as akpd\n", "import numpy as np\n", "import pandas as pd" ] @@ -59,11 +59,11 @@ { "data": { "text/html": [ - "
awkward_pandas  2023.8.1.dev2+g7abb99c\n",
+       "
akimbo  2023.8.1.dev2+g7abb99c\n",
        "
\n" ], "text/plain": [ - "awkward_pandas \u001b[1;36m2023.8\u001b[0m.\u001b[1;36m1.\u001b[0mdev2+g7abb99c\n" + "akimbo \u001b[1;36m2023.8\u001b[0m.\u001b[1;36m1.\u001b[0mdev2+g7abb99c\n" ] }, "metadata": {}, @@ -164,7 +164,7 @@ "id": "021d3236", "metadata": {}, "source": [ - "We get a series representation of the awkward array by using awkward-pandas `form_awkward` function:" + "We get a series representation of the awkward array by using akimbo `form_awkward` function:" ] }, { @@ -569,7 +569,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -676,7 +676,7 @@ "\n", "2. In the second call we are accessing the underlying array directly, still via the `ak` accessor, but we then call the `ak.min` function directly, so an awkward `Array` object is returned.\n", "\n", - "The second path should be somewhat rare when using awkward-pandas. The purpose of awkward-pandas is to plug awkward-arrays into Pandas-like workflows. If you find yourself reaching for the second type of call, then think about if you actually need Pandas at all! You may be fine just using awkward-array. Of course, there will be occasional reasons to need to reach down to the underlying array, which is why we provide that interface.\n", + "The second path should be somewhat rare when using akimbo. The purpose of akimbo is to plug awkward-arrays into Pandas-like workflows. If you find yourself reaching for the second type of call, then think about if you actually need Pandas at all! You may be fine just using awkward-array. Of course, there will be occasional reasons to need to reach down to the underlying array, which is why we provide that interface.\n", "\n", "In general, the `ak` accessor on a `Series` of `awkward` dtype can be used to leverage the `awkward` library while continuing to work with `Series` objects. " ] diff --git a/pyproject.toml b/pyproject.toml index dd09088..134a699 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling>=1.8.0", "hatch-vcs"] build-backend = "hatchling.build" [project] -name = "awkward-pandas" +name = "akimbo" description = "Awkward Array Pandas Extension" readme = "README.md" license = "BSD-3-Clause" @@ -35,7 +35,7 @@ dynamic = ["version"] [project.optional-dependencies] complete = [ - "awkward-pandas[strings,parquet,dask]", + "akimbo[strings,parquet,dask]", ] dask = [ "dask[dataframe]", @@ -47,7 +47,7 @@ strings = [ "pyarrow >=7.0.0", ] test = [ - "awkward-pandas[complete]", + "akimbo[complete]", "pytest >=6.0", "pytest-cov >=3.0.0", "distributed", @@ -61,15 +61,15 @@ docs = [ ] [project.urls] -Homepage = "https://github.com/intake/awkward-pandas" -"Bug Tracker" = "https://github.com/intake/awkward-pandas/issues" +Homepage = "https://github.com/intake/akimbo" +"Bug Tracker" = "https://github.com/intake/akimbo/issues" [tool.hatch.version] source = "vcs" -path = "src/awkward_pandas/__init__.py" +path = "src/akimbo/__init__.py" [tool.hatch.build.hooks.vcs] -version-file = "src/awkward_pandas/version.py" +version-file = "src/akimbo/version.py" [tool.hatch.build.targets.sdist] include = ["/src"] @@ -125,8 +125,8 @@ fail_under = 75 show_missing = true [tool.coverage.run] -omit = ["src/awkward_pandas/version.py"] -source = ["src/awkward_pandas"] +omit = ["src/akimbo/version.py"] +source = ["src/akimbo"] [tool.ruff] ignore = ["E501"] diff --git a/src/akimbo/__init__.py b/src/akimbo/__init__.py new file mode 100644 index 0000000..ce7c3bf --- /dev/null +++ b/src/akimbo/__init__.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +import akimbo.dask +import akimbo.pandas # noqa +from akimbo.io import read_json, read_parquet +from akimbo.version import version as __version__ # noqa + +__all__ = ( + "read_parquet", + "read_json", +) diff --git a/src/awkward_pandas/dask.py b/src/akimbo/dask.py similarity index 93% rename from src/awkward_pandas/dask.py rename to src/akimbo/dask.py index 5ca28f7..acf17cc 100644 --- a/src/awkward_pandas/dask.py +++ b/src/akimbo/dask.py @@ -7,8 +7,8 @@ register_series_accessor, ) -from awkward_pandas.mixin import Accessor as AkAccessor -from awkward_pandas.pandas import PandasAwkwardAccessor +from akimbo.mixin import Accessor as AkAccessor +from akimbo.pandas import PandasAwkwardAccessor class DaskAwkwardAccessor(AkAccessor): @@ -61,7 +61,7 @@ def run(self, *args, **kwargs): meta = None def inner(data, _=DaskAwkwardAccessor): - import awkward_pandas.pandas # noqa: F401 + import akimbo.pandas # noqa: F401 ar2 = (ar.ak.array if hasattr(ar, "ak") else ar for ar in args) out = op(data.ak.array, *ar2, **kwargs) @@ -82,7 +82,7 @@ def __getattr__(self, item): @functools.wraps(func) def f(*others, **kwargs): def func2(data): - import awkward_pandas.pandas # noqa: F401 + import akimbo.pandas # noqa: F401 # data and others are pandas objects here return getattr(data.ak, item)(*others, **kwargs) diff --git a/src/awkward_pandas/datetimes.py b/src/akimbo/datetimes.py similarity index 100% rename from src/awkward_pandas/datetimes.py rename to src/akimbo/datetimes.py diff --git a/src/awkward_pandas/io.py b/src/akimbo/io.py similarity index 90% rename from src/awkward_pandas/io.py rename to src/akimbo/io.py index 7121c78..83e6923 100644 --- a/src/awkward_pandas/io.py +++ b/src/akimbo/io.py @@ -3,7 +3,7 @@ import awkward as ak import fsspec -import awkward_pandas.pandas +import akimbo.pandas def read_parquet( @@ -28,7 +28,7 @@ def read_parquet( will return a series. """ ds = ak.from_parquet(url, storage_options=storage_options, **kwargs) - s = awkward_pandas.pandas.PandasAwkwardAccessor._to_output(ds) + s = akimbo.pandas.PandasAwkwardAccessor._to_output(ds) if extract: return s.ak.unmerge() return s @@ -58,7 +58,7 @@ def read_json( line_delimited=True, **kwargs, ) - s = awkward_pandas.pandas.PandasAwkwardAccessor._to_output(ds) + s = akimbo.pandas.PandasAwkwardAccessor._to_output(ds) if extract: return s.ak.unmerge() return s diff --git a/src/awkward_pandas/mixin.py b/src/akimbo/mixin.py similarity index 98% rename from src/awkward_pandas/mixin.py rename to src/akimbo/mixin.py index f31f8f0..ad9502a 100644 --- a/src/awkward_pandas/mixin.py +++ b/src/akimbo/mixin.py @@ -191,14 +191,14 @@ def array(self) -> ak.Array: @property def str(self): """Nested string operations""" - from awkward_pandas.strings import StringAccessor + from akimbo.strings import StringAccessor return StringAccessor(self) @property def dt(self): """Nested datetime operations""" - from awkward_pandas.datetimes import DatetimeAccessor + from akimbo.datetimes import DatetimeAccessor return DatetimeAccessor(self) diff --git a/src/awkward_pandas/pandas.py b/src/akimbo/pandas.py similarity index 96% rename from src/awkward_pandas/pandas.py rename to src/akimbo/pandas.py index 10a1236..0b32daf 100644 --- a/src/awkward_pandas/pandas.py +++ b/src/akimbo/pandas.py @@ -3,7 +3,7 @@ import pyarrow import pyarrow as pa -from awkward_pandas.mixin import Accessor +from akimbo.mixin import Accessor @pd.api.extensions.register_series_accessor("ak") diff --git a/src/awkward_pandas/polars.py b/src/akimbo/polars.py similarity index 90% rename from src/awkward_pandas/polars.py rename to src/akimbo/polars.py index 249a8e3..350661e 100644 --- a/src/awkward_pandas/polars.py +++ b/src/akimbo/polars.py @@ -1,7 +1,7 @@ import awkward as ak import polars as pl -from awkward_pandas.mixin import Accessor +from akimbo.mixin import Accessor @pl.api.register_series_namespace("ak") diff --git a/src/awkward_pandas/py.typed b/src/akimbo/py.typed similarity index 100% rename from src/awkward_pandas/py.typed rename to src/akimbo/py.typed diff --git a/src/awkward_pandas/strings.py b/src/akimbo/strings.py similarity index 100% rename from src/awkward_pandas/strings.py rename to src/akimbo/strings.py diff --git a/src/awkward_pandas/__init__.py b/src/awkward_pandas/__init__.py deleted file mode 100644 index 8613a25..0000000 --- a/src/awkward_pandas/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import annotations - -import awkward_pandas.dask -import awkward_pandas.pandas # noqa -from awkward_pandas.io import read_json, read_parquet -from awkward_pandas.version import version as __version__ # noqa - -__all__ = ( - "read_parquet", - "read_json", -) diff --git a/tests/test_dask.py b/tests/test_dask.py index 74f4136..006dd5e 100644 --- a/tests/test_dask.py +++ b/tests/test_dask.py @@ -4,7 +4,7 @@ dd = pytest.importorskip("dask.dataframe") -import awkward_pandas.dask # noqa +import akimbo.dask # noqa def test_simple_map(): diff --git a/tests/test_dt.py b/tests/test_dt.py index a4dbc81..29bca57 100644 --- a/tests/test_dt.py +++ b/tests/test_dt.py @@ -2,7 +2,7 @@ import pytest -import awkward_pandas.pandas # noqa +import akimbo.pandas # noqa pd = pytest.importorskip("pandas") diff --git a/tests/test_pandas.py b/tests/test_pandas.py index 544bd7e..d2786ff 100644 --- a/tests/test_pandas.py +++ b/tests/test_pandas.py @@ -2,7 +2,7 @@ import pandas as pd import pytest -pytest.importorskip("awkward_pandas.pandas") +pytest.importorskip("akimbo.pandas") def test_len(): diff --git a/tests/test_polars.py b/tests/test_polars.py index 3ecf817..837d559 100644 --- a/tests/test_polars.py +++ b/tests/test_polars.py @@ -2,7 +2,7 @@ import pytest pl = pytest.importorskip("polars") -pytest.importorskip("awkward_pandas.polars") +pytest.importorskip("akimbo.polars") def test_simple():