Skip to content

Commit

Permalink
Introducing BudgetAllocation as the outcome of the rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Feb 22, 2024
1 parent 871531f commit 30906a1
Show file tree
Hide file tree
Showing 141 changed files with 6,846 additions and 4,633 deletions.
7 changes: 7 additions & 0 deletions docs-source/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=source
set BUILDDIR=build
set BUILDDIRGITHUB=../docs

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand All @@ -25,9 +26,15 @@ if errorlevel 9009 (

if "%1" == "" goto help

if "%1" == "github" goto github

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:github
%SPHINXBUILD% -b html %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

Expand Down
5 changes: 5 additions & 0 deletions docs-source/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ Other methods can be used, such as Phragmén's sequential rule or the method of
outcome1 = sequential_phragmen(instance, profile)
outcome2 = method_of_equal_shares(instance, profile, sat_class=Cost_Sat)
All rules return a :py:class:`~pabutools.rules.budgetallocation.BudgetAllocation` object.
The :py:class:`~pabutools.rules.budgetallocation.BudgetAllocation` class inherits from
:code:`list` and behave similarly. It is used to store additional information about the
outcome (for visualisation/explanation purposes).
2 changes: 2 additions & 0 deletions docs-source/source/reference/rules/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Rules module

.. automodule:: pabutools.rules

.. autoclass:: pabutools.rules.budgetallocation.BudgetAllocation

.. autofunction:: pabutools.rules.greedywelfare.greedy_utilitarian_welfare

.. autofunction:: pabutools.rules.maxwelfare.max_additive_utilitarian_welfare
Expand Down
8 changes: 8 additions & 0 deletions docs-source/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@ For reference, see the module :py:mod:`~pabutools.rules`.

We provide the implementation of the most celebrated rules for participatory budgeting.

Budget Allocation
^^^^^^^^^^^^^^^^^

All rules return a :py:class:`~pabutools.rules.budgetallocation.BudgetAllocation` object.
The :py:class:`~pabutools.rules.budgetallocation.BudgetAllocation` class inherits from
:code:`list` and behave similarly. It is used to store additional information about the
outcome (for visualisation/explanation purposes).

Additive Utilitarian Welfare Maximiser
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
100 changes: 64 additions & 36 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE html>


<html lang="en" data-theme="light">
<html lang="en" data-content_root="../" data-theme="light">

<head>
<meta charset="utf-8" />
Expand All @@ -17,27 +17,28 @@
</script>

<!-- Loaded before other Sphinx assets -->
<link href="../_static/styles/theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="../_static/styles/bootstrap.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="../_static/styles/theme.css?digest=8d27b9dea8ad943066ae" rel="stylesheet" />
<link href="../_static/styles/bootstrap.css?digest=8d27b9dea8ad943066ae" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=8d27b9dea8ad943066ae" rel="stylesheet" />


<link href="../_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=e353d410970836974a52" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />
<link href="../_static/vendor/fontawesome/6.5.1/css/all.min.css?digest=8d27b9dea8ad943066ae" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-regular-400.woff2" />

<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" href="../_static/styles/sphinx-book-theme.css?digest=14f4ca6b54d191a8c7657f6c759bf11a5fb86285" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=384b581d" />

<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=e353d410970836974a52" />
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=e353d410970836974a52" />

<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/scripts/sphinx-book-theme.js?digest=5a5c038af52cf7bc1a1ec88eea08e6366ee68824"></script>
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=8d27b9dea8ad943066ae" />
<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=3c867bb8"></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>
<script>DOCUMENTATION_OPTIONS.pagename = '_modules/index';</script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand All @@ -50,7 +51,15 @@



<a class="skip-link" href="#main-content">Skip to main content</a>
<a id="pst-skip-link" class="skip-link" href="#main-content">Skip to main content</a>

<div id="pst-scroll-pixel-helper"></div>

<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>
Back to top
</button>


<input type="checkbox"
class="sidebar-toggle"
Expand Down Expand Up @@ -85,12 +94,17 @@
</form></div>
</div>

<nav class="bd-header navbar navbar-expand-lg bd-navbar">
</nav>
<header class="bd-header navbar navbar-expand-lg bd-navbar">
</header>


<div class="bd-container">
<div class="bd-container__inner bd-page-width">





<div class="bd-sidebar-primary bd-sidebar">


Expand All @@ -104,6 +118,7 @@

<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">



<a class="navbar-brand logo" href="../index.html">
Expand All @@ -112,10 +127,22 @@




<p class="title logo__title">Pabutools</p>

</a></div>
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="sidebar-primary-item">

<script>
document.write(`
<button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Pabutools</a></li>
Expand Down Expand Up @@ -211,20 +238,22 @@
</button>



<script>
document.write(`
<button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
<span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
<span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
<button class="btn btn-sm navbar-btn theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="theme-switch nav-link" data-mode="light"><i class="fa-solid fa-sun fa-lg"></i></span>
<span class="theme-switch nav-link" data-mode="dark"><i class="fa-solid fa-moon fa-lg"></i></span>
<span class="theme-switch nav-link" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg"></i></span>
</button>
`);
</script>


<script>
document.write(`
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
Expand All @@ -251,7 +280,7 @@ <h1></h1>


<div id="searchbox"></div>
<article class="bd-article" role="main">
<article class="bd-article">

<h1>All modules for which code is available</h1>
<ul><li><a href="pabutools/analysis/category.html">pabutools.analysis.category</a></li>
Expand Down Expand Up @@ -292,22 +321,20 @@ <h1>All modules for which code is available</h1>



<footer class="bd-footer-article">


<footer class="prev-next-footer">

<div class="footer-article-items footer-article__inner">

<div class="footer-article-item"><!-- Previous / next buttons -->
<div class="prev-next-area">
</div></div>

</div>

</footer>

</div>



<div class="bd-sidebar-secondary bd-toc"></div>


</div>
<footer class="bd-footer-content">
Expand All @@ -324,6 +351,7 @@ <h1>All modules for which code is available</h1>

<div class="footer-item">


<p class="copyright">

© Copyright 2023, Simon Rey, Grzegorz Pierczyński, Markus Utke and Piotr Skowron.
Expand All @@ -350,8 +378,8 @@ <h1>All modules for which code is available</h1>
</div>

<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../_static/scripts/bootstrap.js?digest=e353d410970836974a52"></script>
<script src="../_static/scripts/pydata-sphinx-theme.js?digest=e353d410970836974a52"></script>
<script src="../_static/scripts/bootstrap.js?digest=8d27b9dea8ad943066ae"></script>
<script src="../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae"></script>

<footer class="bd-footer">
</footer>
Expand Down
Loading

0 comments on commit 30906a1

Please sign in to comment.