Commit d43fe5e3 authored by Ghislain Antony Vaillant's avatar Ghislain Antony Vaillant

Update upstream source from tag 'upstream/0.2.0'

Update to upstream version '0.2.0'
with Debian dir 2cb3b96f833cc3e384c07d01e4578a6eaf6f56cd
parents 4a3f1f6d 22e0e781
*.pyc
#####=== Python ===#####
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# 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
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# PyCharm
.idea/
......@@ -19,11 +19,10 @@ install:
- conda create -n test-sparse python=$TRAVIS_PYTHON_VERSION pytest numpy scipy flake8 nomkl
- source activate test-sparse
- python setup.py install
- pip install -e .[tests]
script:
- py.test --doctest-modules sparse
- flake8 sparse
- py.test
notifications:
email: false
Modified BSD License
====================
| *Copyright © 2017, Continuum Analytics, Inc. and contributors*
| *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 Continuum Analytics 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 COPYRIGHT OWNER 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.
Copyright (c) 2017, Continuum Analytics, Inc. and contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
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.
Neither the name of Continuum Analytics nor the names of any 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 OWNER 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.
recursive-include sparse *.py
recursive-include sparse *.html
recursive-include docs *.rst
include setup.py
include README.rst
include LICENSE.txt
include MANIFEST.in
include requirements.txt
prune docs/_build
......@@ -14,14 +14,17 @@ This Supports
--------------
- NumPy ufuncs (where zeros are preserved)
- Arithmetic with scalars (where zeros are preserved)
- Reductions (sum, max)
- Binary operations with other :code:`COO` objects, where zeros are preserved.
- Binary operations with Scipy sparse matrices, where zeros are preserved.
- Binary operations with scalars, where zeros are preserved.
- Broadcasting binary operations and :code:`broadcast_to`.
- Reductions (sum, max, min, prod, ...)
- Reshape
- Transpose
- Tensordot
- triu, tril
- Slicing with integers, lists, and slices (with no step value)
- Concatenation and stacking
- Addition with other sparse arrays of the same shape
This may yet support
--------------------
......@@ -30,9 +33,10 @@ A "does not support" list is hard to build because it is infinitely long.
However the following things are in scope, relatively doable, and not yet built
(help welcome).
- Broadcasting
- Incremental buliding of arrays and inplace updates
- More reductions
- More operations supported by Numpy :code:`ndarray`s, such as :code:`argmin` and :code:`argmax`.
- Array building functions such as :code:`eye`, :code:`spdiags`. See `building sparse matrices`_.
- Linear algebra operations such as :code:`inv`, :code:`norm` and :code:`solve`. See scipy.sparse.linalg_.
There are no plans to support
-----------------------------
......@@ -139,5 +143,7 @@ LICENSE
This is licensed under New BSD-3
.. _scipy.sparse.coo_matrix: https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.html
.. _building sparse matrices: https://docs.scipy.org/doc/scipy/reference/sparse.html#functions
.. _scipy.sparse.linalg: https://docs.scipy.org/doc/scipy/reference/sparse.linalg.html
.. |Build Status| image:: https://travis-ci.org/mrocklin/sparse.svg?branch=master
:target: https://travis-ci.org/mrocklin/sparse
{{ objname | escape | underline}}
.. currentmodule:: {{ module }}
.. auto{{ objtype }}:: {{ objname }}
{{ objname | escape | underline}}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
{% block attributes %}
{% if attributes %}
.. rubric:: Attributes
.. autosummary::
:toctree:
{% for item in attributes %}
{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}
{% block methods %}
{% if methods %}
.. rubric:: Methods
.. autosummary::
:toctree:
{% for item in methods %}
{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}
{{ fullname | escape | underline }}
.. rubric:: Description
.. automodule:: {{ fullname }}
.. currentmodule:: {{ fullname }}
{% if classes %}
.. rubric:: Classes
.. autosummary::
:toctree:
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
{% if functions %}
.. rubric:: Functions
.. autosummary::
:toctree:
{% for function in functions %}
{{ function }}
{% endfor %}
{% endif %}
API Reference
=============
.. rubric:: Modules
.. autosummary::
:toctree: generated
sparse
\ No newline at end of file
Changelog
=========
0.2.0 / 2018-01-25
-------------------
- Add Elementwise broadcasting and broadcast_to (:pr:`35`) `Hameer Abbasi`_
- Add Bitwise ops (:pr:`38`) `Hameer Abbasi`_
- Add slicing support for Ellipsis and None (:pr:`37`) `Matthew Rocklin`_
- Add triu and tril and tests (:pr:`40`) `Hameer Abbasi`_
- Extend gitignore file (:pr:`42`) `Nils Werner`_
- Update MANIFEST.in (:pr:`45`) `Matthew Rocklin`_
- Remove auto densification and unify operator code (:pr:`46`) `Hameer Abbasi`_
- Fix nnz for scalars (:pr:`48`) `Hameer Abbasi`_
- Update README (:pr:`50`) (:pr:`53`) `Hameer Abbasi`_
- Fix large concatenations and stacks (:pr:`50`) `Hameer Abbasi`_
- Add __array_ufunc__ for __call__ and reduce (:pr:`r9`) `Hameer Abbasi`_
- Update documentation (:pr:`54`) `Hameer Abbasi`_
- Flake8 and coverage in pytest (:pr:`59`) `Nils Werner`_
- Copy constructor (:pr:`55`) `Nils Werner`_
- Add random function (:pr:`41`) `Nils Werner`_
- Add lots of indexing features (:pr:`57`) `Hameer Abbasi`_
- Validate .transpose axes (:pr:`61`) `Nils Werner`_
- Simplify axes normalization logic `Nils Werner`_
- User higher density for sparse.random in tests (:pr:`64`) `Keisuke Fujii`_
- Support left-side np.number elemwise operations (:pr:`67`) `Keisuke Fujii`_
- Support len on COO (:pr:`68`) `Nils Werner`_
- Update scipy version in requirements (:pr:`70`) `Hameer Abbasi`_
- Documentation (:pr:`43`) `Nils Werner`_ and `Hameer Abbasi`_
- Use Tox for cross Python-version testing (:pr:`77`) `Nils Werner`_
- Support mixed sparse-dense when result is sparse (:pr:`75`) `Hameer Abbasi`_
- Update contributing.rst (:pr:`76`) `Hameer Abbasi`_
- Size and density properties (:pr:`69`) `Nils Werner`_
- Fix large sum (:pr:`83`) `Hameer Abbasi`_
- Add DOK (:pr:`85`) `Hameer Abbasi`_
- Implement __array__ protocol (:pr:`87`) `Matthew Rocklin`_
.. _`Matthew Rocklin`: https://github.com/mrocklin
.. _`Hameer Abbasi`: https://github.com/hameerabbasi
.. _`Nils Werner`: https://github.com/nils-werner
.. _`Keisuke Fujii`: https://github.com/fujiisoup
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# sparse documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 29 20:58:03 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.extlinks',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
mathjax_path = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'sparse'
copyright = '2017, Sparse Developers'
author = 'Sparse Developers'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1.1'
# The full version, including alpha/beta/rc tags.
release = '0.1.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', '**tests**', '**setup**', '**extern**',
'**data**']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
autosummary_generate = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# ]
# }
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'sparsedoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'sparse.tex', 'sparse Documentation',
'Sparse Developers', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sparse', 'sparse Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'sparse', 'sparse Documentation',
author, 'sparse', 'One line description of project.',
'Miscellaneous'),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None)
}
extlinks = {
'issue': ('https://github.com/mrocklin/sparse/issues/%s', 'GH#'),
'pr': ('https://github.com/mrocklin/sparse/pull/%s', 'GH#'),
}
Contributing to sparse
======================
General Guidelines
------------------
sparse is a community-driven project on GitHub. You can find our
`repository on GitHub <https://github.com/mrocklin/sparse>`_. Feel
free to open issues for new features or bugs, or open a pull request
to fix a bug or add a new feature.
If you haven't contributed to open-source before, we recommend you read
`this excellent guide by GitHub on how to contribute to open source
<https://opensource.guide/how-to-contribute/>`_. The guide is long,
so you can gloss over things you're familiar with.
If you're not already familiar with it, we follow the `fork and pull model
<https://help.github.com/articles/about-collaborative-development-models/>`_
on GitHub.
Running/Adding Unit Tests
-------------------------
It is best if all new functionality and/or bug fixes have unit tests added
with each use-case.
Since we support both Python 2.7 and Python 3.5 and newer, it is recommended
to test with at least these two versions before committing your code or opening
a pull request. We use `pytest <https://docs.pytest.org/en/latest/>`_ as our unit
testing framework, with the pytest-cov extension to check code coverage and
pytest-flake8 to check code style. You don't need to configure these extensions
yourself. Once you've configured your environment, you can just :code:`cd` to
the root of your repository and run
.. code-block:: bash
py.test
Adding/Building the Documentation
---------------------------------
If a feature is stable and relatively finalized, it is time to add it to the
documentation. If you are adding any private/public functions, it is best to
add docstrings, to aid in reviewing code and also for the API reference.
We use `Numpy style docstrings <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_
and `Sphinx <http://www.sphinx-doc.org/en/stable/>`_ to document this library.
Sphinx, in turn, uses `reStructuredText <http://www.sphinx-doc.org/en/stable/rest.html>`_
as its markup language for adding code.
We use the `Sphinx Autosummary extension <http://www.sphinx-doc.org/en/stable/ext/autosummary.html>`_
to generate API references. In particular, you may want do look at the :code:`docs/generated`
directory to see how these files look and where to add new functions, classes or modules.
For example, if you add a new function to the :code:`sparse.COO` class, you would open up
:code:`docs/generated/sparse.COO.rst`, and add in the name of the function where appropriate.
To build the documentation, you can :code:`cd` into the :code:`docs` directory
and run
.. code-block:: bash
sphinx-build -b html . _build/html
After this, you can find an HTML version of the documentation in :code:`docs/_build/html/index.html`.
COO\.T
======
.. currentmodule:: sparse
.. autoattribute:: COO.T
\ No newline at end of file
COO\.abs
========
.. currentmodule:: sparse
.. automethod:: COO.abs
\ No newline at end of file
COO\.astype
===========
.. currentmodule:: sparse
.. automethod:: COO.astype
\ No newline at end of file
COO\.broadcast\_to
==================
.. currentmodule:: sparse
.. automethod:: COO.broadcast_to
\ No newline at end of file
COO\.ceil
=========
.. currentmodule:: sparse
.. automethod:: COO.ceil
\ No newline at end of file
COO\.conj
=========
.. currentmodule:: sparse
.. automethod:: COO.conj
\ No newline at end of file
COO\.conjugate
==============
.. currentmodule:: sparse
.. automethod:: COO.conjugate
\ No newline at end of file
COO\.density
============
.. currentmodule:: sparse
.. autoattribute:: COO.density
COO\.dot
========
.. currentmodule:: sparse
.. automethod:: COO.dot
\ No newline at end of file
COO\.dtype
==========
.. currentmodule:: sparse
.. autoattribute:: COO.dtype
\ No newline at end of file
COO\.elemwise
=============
.. currentmodule:: sparse
.. automethod:: COO.elemwise
\ No newline at end of file
COO\.enable\_caching
====================
.. currentmodule:: sparse
.. automethod:: COO.enable_caching
\ No newline at end of file
COO\.exp
========
.. currentmodule:: sparse
.. automethod:: COO.exp
\ No newline at end of file
COO\.expm1
==========
.. currentmodule:: sparse
.. automethod:: COO.expm1
\ No newline at end of file
COO\.floor
==========
.. currentmodule:: sparse
.. automethod:: COO.floor
\ No newline at end of file
COO\.from\_numpy
================
.. currentmodule:: sparse
.. automethod:: COO.from_numpy
\ No newline at end of file
COO\.from\_scipy\_sparse
========================
.. currentmodule:: sparse
.. automethod:: COO.from_scipy_sparse
\ No newline at end of file
COO\.linear\_loc
================
.. currentmodule:: sparse
.. automethod:: COO.linear_loc
\ No newline at end of file
COO\.log1p
==========
.. currentmodule:: sparse
.. automethod:: COO.log1p
\ No newline at end of file
COO\.max
========
.. currentmodule:: sparse
.. automethod:: COO.max
\ No newline at end of file
COO\.maybe\_densify
===================
.. currentmodule:: sparse
.. automethod:: COO.maybe_densify
\ No newline at end of file
COO\.min
========
.. currentmodule:: sparse
.. automethod:: COO.min
\ No newline at end of file
COO\.nbytes
===========
.. currentmodule:: sparse
.. autoattribute:: COO.nbytes
\ No newline at end of file
COO\.ndim
=========
.. currentmodule:: sparse