Skip to content

Commit

Permalink
Continuing updating the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Apr 24, 2024
1 parent bfbbe3b commit 0f76683
Show file tree
Hide file tree
Showing 159 changed files with 12,500 additions and 3,444 deletions.
44 changes: 23 additions & 21 deletions docs-source/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,55 +115,57 @@ Reference: :py:mod:`prefsampling.approval`
* - Sampler
- \*\*args
- \*\*kwargs
* - :py:func:`~prefsampling.approval.identity`
* - :py:func:`~prefsampling.approval.identity.identity`
- :code:`rel_num_approvals`
- ---
* - :py:func:`~prefsampling.approval.empty`
* - :py:func:`~prefsampling.approval.identity.empty`
- ---
- ---
* - :py:func:`~prefsampling.approval.full`
* - :py:func:`~prefsampling.approval.identity.full`
- ---
- ---
* - :py:func:`~prefsampling.approval.impartial`
* - :py:func:`~prefsampling.approval.impartial.impartial`
- :code:`p`
- ---
* - :py:func:`~prefsampling.approval.impartial_constant_size`
* - :py:func:`~prefsampling.approval.impartial.impartial_constant_size`
- :code:`rel_num_approvals`
- ---
* - :py:func:`~prefsampling.approval.urn`
* - :py:func:`~prefsampling.approval.urn.urn`
- | :code:`p`
| :code:`alpha`
- ---
* - :py:func:`~prefsampling.approval.urn_constant_size`
* - :py:func:`~prefsampling.approval.urn.urn_constant_size`
- | :code:`rel_num_approvals`
| :code:`alpha`
- ---
* - :py:func:`~prefsampling.approval.urn_partylist`
* - :py:func:`~prefsampling.approval.urn.urn_partylist`
- | :code:`alpha`
| :code:`parties`
- ---
* - :py:func:`~prefsampling.approval.resampling`
- | :code:`p`
| :code:`phi`
* - :py:func:`~prefsampling.approval.resampling.resampling`
- | :code:`phi`
| :code:`rel_size_central_vote`
- | :code:`central_vote` (defaults to `{0, 1, 2, ...}`)
| :code:`impartial_central_vote` (defaults to :code:`False`)
* - :py:func:`~prefsampling.approval.disjoint_resampling`
- | :code:`p`
| :code:`phi`
- :code:`g` (defaults to 2)
* - :py:func:`~prefsampling.approval.moving_resampling`
* - :py:func:`~prefsampling.approval.resampling.disjoint_resampling`
- | :code:`phi`
| :code:`rel_size_central_vote`
- | :code:`num_central_votes` (defaults to :code:`None`)
| :code:`central_votes` (see docs for the defaults)
| :code:`impartial_central_votes` (defaults to :code:`False`)
* - :py:func:`~prefsampling.approval.resampling.moving_resampling`
- | :code:`p`
| :code:`phi`
- :code:`num_legs` (defaults to 1)
* - :py:func:`~prefsampling.approval.euclidean_threshold`
* - :py:func:`~prefsampling.approval.euclidean.euclidean_threshold`
- :code:`threshold`
- | :code:`point_sampler` (defaults to :code:`None`)
| :code:`point_sampler_args` (defaults to :code:`None`)
| :code:`candidate_point_sampler` (defaults to :code:`None`)
| :code:`candidate_point_sampler_args` (defaults to :code:`None`)
| :code:`voters_positions` (defaults to :code:`None`)
| :code:`candidates_positions` (defaults to :code:`None`)
* - :py:func:`~prefsampling.approval.euclidean_vcr`
* - :py:func:`~prefsampling.approval.euclidean.euclidean_vcr`
- | :code:`voters_radius`
| :code:`candidates_radius`
- | :code:`point_sampler` (defaults to :code:`None`)
Expand All @@ -172,19 +174,19 @@ Reference: :py:mod:`prefsampling.approval`
| :code:`candidate_point_sampler_args` (defaults to :code:`None`)
| :code:`voters_positions` (defaults to :code:`None`)
| :code:`candidates_positions` (defaults to :code:`None`)
* - :py:func:`~prefsampling.approval.euclidean_constant_size`
* - :py:func:`~prefsampling.approval.euclidean.euclidean_constant_size`
- :code:`rel_num_approvals`
- | :code:`point_sampler` (defaults to :code:`None`)
| :code:`point_sampler_args` (defaults to :code:`None`)
| :code:`candidate_point_sampler` (defaults to :code:`None`)
| :code:`candidate_point_sampler_args` (defaults to :code:`None`)
| :code:`voters_positions` (defaults to :code:`None`)
| :code:`candidates_positions` (defaults to :code:`None`)
* - :py:func:`~prefsampling.approval.noise`
* - :py:func:`~prefsampling.approval.noise.noise`
- | :code:`p`
| :code:`phi`
- :code:`noise_type` (defaults to :py:const:`~prefsampling.approval.NoiseType.HAMMING`)
* - :py:func:`~prefsampling.approval.truncated_ordinal`
* - :py:func:`~prefsampling.approval.truncated_ordinal.truncated_ordinal`
- | :code:`rel_num_approvals`
| :code:`ordinal_sampler`
| :code:`ordinal_sampler_parameters`
Expand Down
13 changes: 13 additions & 0 deletions docs-source/source/reference/approval/euclidean.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Euclidean Models
================

.. automodule:: prefsampling.approval.euclidean

.. autofunction:: prefsampling.approval.euclidean.euclidean_threshold

.. autofunction:: prefsampling.approval.euclidean.euclidean_vcr

.. autofunction:: prefsampling.approval.euclidean.euclidean_constant_size

.. autoclass:: prefsampling.approval.euclidean.EuclideanSpace
:members:
24 changes: 4 additions & 20 deletions docs-source/source/reference/approval/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,8 @@ Approval

impartial
identity
euclidean
urn
noise

.. autofunction:: prefsampling.approval.urn

.. autofunction:: prefsampling.approval.urn_constant_size

.. autofunction:: prefsampling.approval.urn_partylist

.. autofunction:: prefsampling.approval.resampling

.. autofunction:: prefsampling.approval.disjoint_resampling

.. autofunction:: prefsampling.approval.moving_resampling

.. autofunction:: prefsampling.approval.euclidean_threshold

.. autofunction:: prefsampling.approval.euclidean_vcr

.. autofunction:: prefsampling.approval.euclidean_constant_size

.. autofunction:: prefsampling.approval.truncated_ordinal
resampling
truncatedordinal
10 changes: 10 additions & 0 deletions docs-source/source/reference/approval/resampling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Resampling Models
=================

.. automodule:: prefsampling.approval.resampling

.. autofunction:: prefsampling.approval.resampling.resampling

.. autofunction:: prefsampling.approval.resampling.disjoint_resampling

.. autofunction:: prefsampling.approval.resampling.moving_resampling
8 changes: 8 additions & 0 deletions docs-source/source/reference/approval/truncatedordinal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Truncated Ordinal Models
========================

.. automodule:: prefsampling.approval.truncated_ordinal

.. autofunction:: prefsampling.approval.truncated_ordinal.truncated_ordinal


10 changes: 10 additions & 0 deletions docs-source/source/reference/approval/urn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Urn Models
=================

.. automodule:: prefsampling.approval.urn

.. autofunction:: prefsampling.approval.urn.urn

.. autofunction:: prefsampling.approval.urn.urn_constant_size

.. autofunction:: prefsampling.approval.urn.urn_partylist
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/disjoint_resampling_0_25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/disjoint_resampling_0_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/euclidean_line_UNIFORM_BALL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/euclidean_line_UNIFORM_CUBE.png
Binary file modified docs/_images/euclidean_uniform_GAUSSIAN_BALL.png
Binary file modified docs/_images/euclidean_uniform_GAUSSIAN_CUBE.png
Binary file modified docs/_images/euclidean_uniform_UNBOUNDED_GAUSSIAN.png
Binary file modified docs/_images/euclidean_uniform_UNIFORM_BALL.png
Binary file modified docs/_images/euclidean_uniform_UNIFORM_CUBE.png
Binary file modified docs/_images/euclidean_uniform_UNIFORM_SPHERE.png
Binary file added docs/_images/impartial_0_3.png
Binary file added docs/_images/impartial_0_5.png
Binary file added docs/_images/impartial_0_7.png
Binary file added docs/_images/impartial_constant_size_0_3.png
Binary file added docs/_images/impartial_constant_size_0_5.png
Binary file added docs/_images/impartial_constant_size_0_7.png
Binary file added docs/_images/moving_resampling_0_25.png
Binary file added docs/_images/moving_resampling_0_5.png
Binary file added docs/_images/moving_resampling_0_75.png
Binary file added docs/_images/moving_resampling_1_0.png
Binary file modified docs/_images/noise_0_0.png
Binary file modified docs/_images/noise_0_25.png
Binary file modified docs/_images/noise_0_5.png
Binary file modified docs/_images/noise_0_75.png
Binary file modified docs/_images/noise_1_0.png
Binary file added docs/_images/resampling_0_25.png
Binary file added docs/_images/resampling_0_5.png
Binary file added docs/_images/resampling_0_75.png
Binary file added docs/_images/resampling_1_0.png
6 changes: 5 additions & 1 deletion docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../_static/documentation_options.js?v=537bb3bf"></script>
<script src="../_static/documentation_options.js?v=90459621"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down Expand Up @@ -171,7 +171,11 @@
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/approval/index.html">Approval</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-4"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/impartial.html">Impartial Cultures</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/identity.html">Unanimous Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/euclidean.html">Euclidean Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/urn.html">Urn Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/noise.html">Noise Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/resampling.html">Resampling Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/truncatedordinal.html">Truncated Ordinal Models</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/point/index.html">Point</a></li>
Expand Down
11 changes: 8 additions & 3 deletions docs/_modules/prefsampling.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../_static/documentation_options.js?v=537bb3bf"></script>
<script src="../_static/documentation_options.js?v=90459621"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down Expand Up @@ -171,7 +171,11 @@
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/approval/index.html">Approval</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-4"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/impartial.html">Impartial Cultures</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/identity.html">Unanimous Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/euclidean.html">Euclidean Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/urn.html">Urn Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/noise.html">Noise Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/resampling.html">Resampling Models</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/approval/truncatedordinal.html">Truncated Ordinal Models</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/point/index.html">Point</a></li>
Expand Down Expand Up @@ -302,13 +306,14 @@ <h1></h1>
<h1>Source code for prefsampling</h1><div class="highlight"><pre>
<span></span><span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;Simon Rey and Stanisław Szufa&quot;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s2">&quot;[email protected]&quot;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;0.1.15&quot;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;0.1.16&quot;</span>

<span class="kn">from</span> <span class="nn">enum</span> <span class="kn">import</span> <span class="n">Enum</span>
<span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">chain</span>

<span class="kn">from</span> <span class="nn">prefsampling.approval</span> <span class="kn">import</span> <span class="n">SetDistance</span>
<span class="kn">from</span> <span class="nn">prefsampling.ordinal</span> <span class="kn">import</span> <span class="n">TreeSampler</span>
<span class="kn">from</span> <span class="nn">prefsampling.core.euclidean</span> <span class="kn">import</span> <span class="n">EuclideanSpace</span>


<div class="viewcode-block" id="CONSTANTS">
Expand All @@ -318,7 +323,7 @@ <h1>Source code for prefsampling</h1><div class="highlight"><pre>

<span class="n">_ignore_</span> <span class="o">=</span> <span class="s2">&quot;member cls&quot;</span>
<span class="bp">cls</span> <span class="o">=</span> <span class="nb">vars</span><span class="p">()</span>
<span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">chain</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">TreeSampler</span><span class="p">),</span> <span class="nb">list</span><span class="p">(</span><span class="n">SetDistance</span><span class="p">)):</span>
<span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">chain</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">TreeSampler</span><span class="p">),</span> <span class="nb">list</span><span class="p">(</span><span class="n">SetDistance</span><span class="p">),</span> <span class="nb">list</span><span class="p">(</span><span class="n">EuclideanSpace</span><span class="p">)):</span>
<span class="k">if</span> <span class="n">member</span><span class="o">.</span><span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;The name </span><span class="si">{</span><span class="n">member</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s2"> is used in more than one enumeration. The&quot;</span>
Expand Down
Loading

0 comments on commit 0f76683

Please sign in to comment.