Skip to content

Commit ef01153

Browse files
committed
Getting ready for PyPi
1 parent 260d87b commit ef01153

File tree

6 files changed

+191
-121
lines changed

6 files changed

+191
-121
lines changed

README.md

-109
This file was deleted.

README.rst

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
DPPy: Sampling Determinantal Point Processes with Python
2+
========================================================
3+
4+
|Documentation Status| |Build Status|
5+
6+
*"Anything that can go wrong, will go wrong"*. − `Murphy's
7+
Law <http://phdcomics.com/comics/archive.php?comicid=1867>`__
8+
9+
Introduction
10+
------------
11+
12+
Determinantal point processes (DPPs) are specific probability
13+
distributions over clouds of points that have been popular as models or
14+
computational tools across physics, probability, statistics, and more
15+
recently of booming interest in machine learning. Sampling from DPPs is
16+
a nontrivial matter, and many approaches have been proposed. DPPy is a
17+
`Python <https://www.python.org/>`__ library that puts together all
18+
exact and approximate sampling algorithms for DPPs.
19+
20+
Requirements
21+
------------
22+
23+
DPPy works with `Python 3.4+ <http://docs.python.org/3/>`__
24+
25+
Dependencies
26+
~~~~~~~~~~~~
27+
28+
- `NumPy <http://www.numpy.org>`__
29+
- `SciPy <http://www.scipy.org/>`__
30+
- `Matplotlib <http://matplotlib.org/>`__
31+
- `Networkx <http://networkx.github.io/>`__ to play with `uniform
32+
spanning
33+
trees <https://dppy.readthedocs.io/en/latest/exotic_dpps/index.html#uniform-spanning-trees>`__
34+
- `CVXOPT <http://cvxopt.org>`__ to use the ``zono_sampling`` MCMC
35+
sampler for finite DPPs. **CVXOPT itself requires**
36+
`GCC <http://gcc.gnu.org>`__,
37+
38+
- On MAC it comes with
39+
`Xcode <https://developer.apple.com/xcode/>`__
40+
- On UNIX, use your package manager (``apt``, ``yum`` etc)
41+
42+
.. code:: bash
43+
44+
sudo apt install -qq gcc g++
45+
46+
Installation
47+
------------
48+
49+
1. If you have a GitHub account
50+
51+
- Please consider forking DPPy
52+
- Use git to clone your copy of the repo
53+
54+
.. code:: bash
55+
56+
cd <directory_of_your_choice>
57+
git clone https://github.com/<username>/DPPy.git
58+
59+
2. If you only use git, clone this repository
60+
61+
.. code:: bash
62+
63+
cd <directory_of_your_choice>
64+
git clone https://github.com/guilgautier/DPPy.git
65+
66+
3. Otherwise simply dowload the project
67+
68+
Finally, in any case, install the project
69+
70+
.. code:: bash
71+
72+
cd DPPy
73+
pip install .
74+
75+
Tutorial in `a Jupyter notebook <https://www.Jupyter.org/>`__
76+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77+
78+
You can read and work on this interactive tutorial, directly from your
79+
web browser, without having to download or install Python or anything.
80+
Just click, wait a little bit, and play with the notebook!
81+
82+
- `Tutorial for DPPy (Tuto\_DPPy) <https://github.com/guilgautier/DPPy/blob/master/notebooks/Tuto_DPPy.ipynb>`__: |Google Colab|
83+
84+
Contribute to the documentation
85+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86+
87+
The
88+
`documentation <http://dppy.readthedocs.io/>`__
89+
is generated locally with
90+
`Sphinx <http://www.sphinx-doc.org/en/master/>`__ and then built online
91+
by `ReadTheDocs <https://readthedocs.org/projects/dppy/>`__.
92+
93+
If you wish to contribute to the documentation or just play with it
94+
locally, you can:
95+
96+
- Install Sphinx
97+
98+
.. code:: bash
99+
100+
pip install -U sphinx
101+
102+
- Generate the docs locally
103+
104+
.. code:: bash
105+
106+
cd DPPy/docs
107+
make html
108+
109+
- Open the local HTML version of the documentation located at
110+
``DPPy/docs/_build/html/index.html``
111+
112+
.. code:: bash
113+
114+
open _build/html/index.html
115+
116+
If you wish pull request your contribution, please use the ``docs``
117+
branch.
118+
119+
How to cite this work?
120+
~~~~~~~~~~~~~~~~~~~~~~
121+
122+
We wrote a companion paper to
123+
`DPPy <https://github.com/guilgautier/DPPy>`__ for latter submission to
124+
the `MLOSS <http://www.jmlr.org/mloss/>`__ track of JMLR.
125+
126+
The companion paper is available on
127+
128+
- `arXiv <http://arxiv.org/abs/1809.07258>`__
129+
- `GitHub <https://github.com/guilgautier/DPPy_paper>`__, see the
130+
`arxiv <https://github.com/guilgautier/DPPy_paper/tree/arxiv>`__
131+
branch
132+
133+
If you use this package, please consider citing it with this piece of
134+
BibTeX:
135+
136+
.. code:: bibtex
137+
138+
@article{GaBaVa18,,
139+
archivePrefix = {arXiv},
140+
arxivId = {1809.07258},
141+
author = {Gautier, Guillaume and Bardenet, R{\'{e}}mi and Valko, Michal},
142+
eprint = {1809.07258},
143+
journal = {ArXiv e-prints},
144+
title = {{DPPy: Sampling Determinantal Point Processes with Python}},
145+
keywords = {Computer Science - Machine Learning, Computer Science - Mathematical Software, Statistics - Machine Learning},
146+
url = {http://arxiv.org/abs/1809.07258},
147+
year = {2018},
148+
note = {Code at http://github.com/guilgautier/DPPy/ Documentation at http://dppy.readthedocs.io/}
149+
}
150+
151+
Reproducibility
152+
---------------
153+
154+
We would like to thank `Guillermo Polito <https://guillep.github.io/>`__
155+
for leading our reproducible research
156+
`workgroup <https://github.com/CRIStAL-PADR/reproducible-research-SE-notes>`__,
157+
this project owes him a lot.
158+
159+
Take a look at the corresponding
160+
`booklet <https://github.com/CRIStAL-PADR/reproducible-research-SE-notes>`__
161+
to learn more on how to make your research reproducible!
162+
163+
.. |Documentation Status| image:: https://readthedocs.org/projects/dppy/badge/?version=latest
164+
:target: https://dppy.readthedocs.io/en/latest/?badge=latest
165+
.. |Build Status| image:: https://travis-ci.com/guilgautier/DPPy.svg?branch=master
166+
:target: https://travis-ci.com/guilgautier/DPPy
167+
.. |Google Colab| image:: https://badgen.net/badge/Launch/on%20Google%20Colab/blue?icon=terminal
168+
:target: https://colab.research.google.com/github/guilgautier/DPPy/blob/master/notebooks/Tuto_DPPy.ipynb

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As :ref:`exotic <exotic_dpps>` as it may sound the uniform measure on spanning t
3131
Installation instructions
3232
=========================
3333

34-
See `README <https://github.com/guilgautier/DPPy/blob/master/README.md>`_
34+
See `README <https://github.com/guilgautier/DPPy/blob/master/README.rst>`_
3535

3636
Documentation contents
3737
======================

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy
2-
scipy
2+
scipy>=1.1.0
33
matplotlib
44
cvxopt==1.2.1
55
networkx

scripts/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
1111
# I didn't do this above because it works and I'm lazy.
1212
brew outdated pyenv || brew upgrade pyenv
1313
# virtualenv doesn't work without pyenv knowledge. venv in Python 3.3
14-
# doesn't provide Pip by default. So, use `pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv/blob/master/README.md>`_.
14+
# doesn't provide Pip by default. So, use `pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv/blob/master/README.rst>`_.
1515
brew install pyenv-virtualenv
1616
PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install $PYTHON # Try to fix matplotlib backend issue #6, repeated in tests branch
1717
# I would expect something like ``pyenv init; pyenv local $PYTHON`` or

setup.py

+20-9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
here = path.abspath(path.dirname(__file__))
1616

1717
# Get the long description from the README file
18-
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
18+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
1919
long_description = f.read()
2020

2121
setup(
22-
name='DPPy',
22+
name='dppy-dpps',
2323

2424
# Versions should comply with PEP440. For a discussion on single-sourcing
2525
# the version across setup.py and the project code, see
2626
# https://packaging.python.org/en/latest/single_source_version.html
27-
version='0.1.0-dev',
27+
version='0.0.2-dev4',
2828

2929
description='DPPy is a Python library for exact and approximate sampling of Determinantal Point Processes.',
3030
long_description=long_description,
@@ -45,11 +45,12 @@
4545
# 3 - Alpha
4646
# 4 - Beta
4747
# 5 - Production/Stable
48-
'Development Status :: 3 - Alpha',
48+
'Development Status :: 4 - Beta',
4949

5050
# Indicate who your project is intended for
5151
'Intended Audience :: Science/Research',
52-
'Topic :: Software Development :: Build Tools',
52+
'Topic :: Scientific/Engineering :: Mathematics',
53+
'Topic :: Scientific/Engineering',
5354

5455
# Pick your license as you wish (should match "license" above)
5556
'License :: OSI Approved :: MIT License',
@@ -58,14 +59,17 @@
5859
# that you indicate whether you support Python 2, Python 3 or both.
5960
# 'Programming Language :: Python :: 2.7',
6061
'Programming Language :: Python :: 3.4',
62+
'Programming Language :: Python :: 3.5',
63+
'Programming Language :: Python :: 3.6',
64+
'Programming Language :: Python :: 3.7',
6165

6266
# Specify supported OS.
6367
'Operating System :: Unix',
6468
'Operating System :: MacOS'
6569
],
6670

6771
# What does your project relate to?
68-
keywords='Determinantal Point Processes, sampling schemes',
72+
keywords='Determinantal Point Processes, sampling schemes, random matrices',
6973

7074
# You can just specify the packages manually here if your project is
7175
# simple. Or you can use find_packages().
@@ -79,13 +83,20 @@
7983
# These will be installed by pip when your project is installed. For an analysis of "install_requires" vs pip's requirements files see:
8084
# https://packaging.python.org/en/latest/requirements.html
8185
install_requires=['numpy',
82-
'scipy',
86+
'scipy>=1.1.0',
8387
'matplotlib',
8488
'cvxopt==1.2.1', # For zonotope MCMC sampler
8589
'networkx',
8690
'sphinxcontrib-bibtex', # Documentation bibliography
87-
'sphinx_rtd_theme'] # Documentation theme
88-
91+
'sphinx_rtd_theme'], # Documentation theme
92+
93+
project_urls={ # Optional
94+
"Companion paper": "https://github.com/guilgautier/DPPy_paper",
95+
"arXiv": "https://arxiv.org/abs/1809.07258",
96+
"Travis": "https://travis-ci.com/guilgautier/DPPy",
97+
"Documentation": "https://dppy.readthedocs.io/en/latest/",
98+
"Source": "https://github.com/guilgautier/DPPy"
99+
}
89100
# List additional groups of dependencies here (e.g. development dependencies). You can install these using the following syntax, for example:
90101
# $ pip install -e .[dev,test]
91102
# extras_require={

0 commit comments

Comments
 (0)