Skip to content

Commit

Permalink
Create Python package for exploring n-dimensional sparse arrays with …
Browse files Browse the repository at this point in the history
…different structures
  • Loading branch information
eriknw committed Aug 21, 2022
1 parent 36a3637 commit aedee99
Show file tree
Hide file tree
Showing 13 changed files with 606 additions and 0 deletions.
117 changes: 117 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Generated C code
*.c

# C extensions
*.so

# Vi
*.swp
*.swo

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# PyCharm
.idea

# Mac
.DS_Store
29 changes: 29 additions & 0 deletions spz_python/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2022, GraphBLAS
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Empty file added spz_python/README.md
Empty file.
5 changes: 5 additions & 0 deletions spz_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]

[tool.black]
line-length = 100
2 changes: 2 additions & 0 deletions spz_python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy
pandas
56 changes: 56 additions & 0 deletions spz_python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[aliases]
test=pytest

[flake8]
max-line-length = 100
inline-quotes = "
exclude =
versioneer.py,
ignore =
E203, # whitespace before ':'
E231, # Multiple spaces around ","
W503, # line break before binary operator
per-file-ignores =
__init__.py:F401,
spz/_core.py:B020
[isort]
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
profile = black
skip_gitignore = true
float_to_top = true
default_section = THIRDPARTY
known_first_party = spz
line_length = 100
[versioneer]
VCS = git
style = pep440
versionfile_source = spz/_version.py
versionfile_build = spz/_version.py
tag_prefix=
parentdir_prefix=spz-
[tool:pytest]
testpaths = spz/tests
markers:
slow: Skipped unless --runslow passed
[coverage:run]
source = spz
omit =
spz/_version.py
[coverage:report]
# Regexes for lines to exclude from consideration
exclude_lines =
pragma: no cover
raise AssertionError
raise NotImplementedError
ignore_errors = True
precision = 1
fail_under = 0
skip_covered = True
skip_empty = True
46 changes: 46 additions & 0 deletions spz_python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import versioneer
from setuptools import find_packages, setup

install_requires = open("requirements.txt").read().strip().split("\n")
extras_require = {
"test": ["pytest"],
"viz": ["sphinxcontrib-svgbob"],
}
extras_require["complete"] = sorted({v for req in extras_require.values() for v in req})

with open("README.md") as f:
long_description = f.read()

setup(
name="spz",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Explore multidimensional sparse data structures",
long_description=long_description,
long_description_content_type="text/markdown",
author="Erik Welch",
author_email="[email protected]",
url="https://github.com/GraphBLAS/binsparse-specification",
packages=find_packages(),
license="BSD",
python_requires=">=3.8",
setup_requires=[],
install_requires=install_requires,
extras_require=extras_require,
include_package_data=True,
classifiers=[
"Development Status :: 3 - Alpha" "License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
],
zip_safe=False,
)
2 changes: 2 additions & 0 deletions spz_python/spz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from ._core import SPZ
from .sparsetype import DC, C, S, compressed, doubly_compressed, sparse
Loading

0 comments on commit aedee99

Please sign in to comment.