Skip to content

Commit

Permalink
update README and CONTRIBUTE, and the installation guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
epacuit committed Oct 18, 2024
1 parent 6f1114a commit 8e300ae
Show file tree
Hide file tree
Showing 7 changed files with 1,224 additions and 76 deletions.
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Welcome to pref_voting!

This is a small project, so the best way to contribute is to simply get in contact with Wes Holliday ([email protected]) and Eric Pacuit ([email protected]) or to post an [issue](https://github.com/voting-tools/pref_voting/issues).
This is a small project, so if you have any questions about the project or how to contribute, then the best thing to do is get in contact with Wes Holliday ([email protected]) and Eric Pacuit ([email protected]).

## How to contribute

Further comments:
- Documentation is available at https://pref-voting.readthedocs.io/.
- If you would like to contribute but don't have a concrete idea, please
contact us directly (Wes Holliday, [email protected] and Eric Pacuit, [email protected]).
- If there is a voting method that you think should be included in the package, please let us know.
- If there is a voting method that you think should be included in the package, please let us know by posting an [issue](https://github.com/voting-tools/pref_voting/issues).
- If you have code that you would like to contribute, feel free to clone the repository and submit a pull request (PR) once your version is functional. We can then review and discuss your code. You're also welcome to contact us before submitting a PR.

## Report issues or problems with the software

- If you encounter any issues or bugs, please post an [issue](https://github.com/voting-tools/pref_voting/issues)

## Seek support

- There is extensive documentation available at https://pref-voting.readthedocs.io/.
- You can explore some of the voting methods implemented in the package by vising [https://pref.tools/pref_voting](https://pref.tools/pref_voting).
- There are a number of helpful notebooks in the [howto directory](https://github.com/voting-tools/pref_voting/tree/main/howto) of the repository that demonstrate how to use the package.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
pref_voting
==========

> [!NOTE]
> - [**Documentation**](https://pref-voting.readthedocs.io/)
> - [**Installation**](https://pref-voting.readthedocs.io/en/latest/installation.html)
> - [**Example Notebooks**](https://github.com/voting-tools/pref_voting/tree/main/howto)
> - [**Example Elections**](https://github.com/voting-tools/election-analysis)
> - [**► pref_voting web app**](https://pref.tools/pref_voting/)
See the [COMSOC community page](https://comsoc-community.org/tools) for an overview of other software tools related to Computational Social Choice.

## Installation

The package can be installed using the ``pip3`` package manager:
Expand All @@ -11,10 +20,7 @@ pip3 install pref_voting

Note: If you have both Python 2 and Python 3 installed on your system, make sure to use ``pip3`` instead of pip to install packages for Python 3. Alternatively, you can use ``python3 -m pip`` to ensure you're using the correct version of pip. If you have modified your system's defaults or soft links, adjust accordingly.


## Documentation

Online documentation is available at [https://pref-voting.readthedocs.io](https://pref-voting.readthedocs.io).
See the [installation guide](https://pref-voting.readthedocs.io/en/latest/installation.html) for more detailed instructions.

## Example Usage

Expand All @@ -30,7 +36,7 @@ rankings = [
(1, 2, 0, 3),
(1, 3, 2, 0)]

rcounts = [5, 3, 2, 4, 3] # 5 voters submitted the first ranking ((0, 1, 2, 3)), 3 voters submitted the second ranking, and so on.
rcounts = [5, 3, 2, 4, 3] # 5 voters submitted the first ranking (0, 1, 2, 3), 3 voters submitted the second ranking, and so on.

prof = Profile(rankings, rcounts=rcounts)

Expand Down Expand Up @@ -63,13 +69,15 @@ split_cycle.display(prof) # display the winning candidates

Consult the documentation [https://pref-voting.readthedocs.io](https://pref-voting.readthedocs.io) for a complete overview of the package.

Additional notebooks that demonstrate how to use the package can be found in the [howto directory](https://github.com/voting-tools/pref_voting/tree/main/howto)

## Testing

To ensure that the package is working correctly, you can run the test suite using [pytest](https://docs.pytest.org/en/stable/). The test files are located in the `tests` directory. Follow the instructions below based on your setup.

### Prerequisites

- **Python 3.8 or higher**: Ensure you have a compatible version of Python installed.
- **Python 3.9 or higher**: Ensure you have a compatible version of Python installed.
- **`pytest`**: Install `pytest` if it's not already installed.

### Running the tests
Expand All @@ -93,6 +101,10 @@ For more detailed output, add the -v or --verbose flag:
pytest -v
```

## Contributing

If you would like to contribute to the project, please see the [contributing guidelines](CONTRIBUTING.md).

## Questions?

Feel free to [send an email](https://pacuit.org/) if you have questions about the project.
Expand Down
15 changes: 13 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
Installation
================


``pref_voting`` is available on pypi and can be installed using pip.

.. code-block:: shell
pip install pref_voting
pip3 install pref_voting
Alternatively, you can install the latest development version from source:

.. code-block:: shell
git clone https://github.com/voting-tools/pref_voting
pip3 install .
Requirements:

* Python 3.9+
* The following pip packages are required and installed automatically: filelock, scipy, networkx, tabulate, matplotlib, nashpy, numba, ortools, pathos, preflibtools, prefsampling, and seaborn

Loading

0 comments on commit 8e300ae

Please sign in to comment.