-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from OmerFI/dev
Version 1.0.0
- Loading branch information
Showing
24 changed files
with
438 additions
and
227 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install build | ||
run: python -m pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Tests | ||
|
||
on: | ||
push | ||
pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Run tests | ||
run: tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Sphinx==4.1.2 | ||
sphinx-rtd-theme==0.5.2 | ||
Sphinx>=5.2.1 | ||
sphinx-rtd-theme>=1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
API Documentation | ||
================= | ||
|
||
.. automodule:: pyprobs | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Examples | ||
======== | ||
|
||
Simple usage: | ||
|
||
.. code-block:: python | ||
>>> from pyprobs import Probability as pr | ||
>>> # You can pass float (i.e. 0.5, 0.157), int (i.e. 1, 0) or str (i.e. '50%', '3/11') | ||
>>> pr.prob(50/100) | ||
False | ||
>>> pr.prob(50/100, num=5) | ||
[False, False, False, True, False] | ||
Suggested and more advanced usage: | ||
|
||
.. code-block:: python | ||
>>> from PyProbs import Probability as pr | ||
>>> p = pr() | ||
>>> p.iProb('3/7', 0.25, num=2) | ||
[[True, True], [False, False]] | ||
>>> p.history | ||
{'3/7': [True, True], 0.25: [False, False]} | ||
>>> p.count_values('all') | ||
{True: 2, False: 2} | ||
>>> p.set_constant(1/1000, mutable=True) # If you set the mutable parameter to False, you won't be able to change the constant again. | ||
>>> # You can get the constant and mutable value: | ||
>>> p.get() | ||
{'constant': 0.001, 'mutable': True} | ||
>>> # Also you can use it like "p.get(how='constant')" or "p.get(how='mutable')", this only returns the desired value. | ||
>>> p._constant # You can more easily get the constant value. | ||
0.001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Installation | ||
============ | ||
|
||
You can install it from PyPI_:: | ||
|
||
pip install pyprobs | ||
Or you can install it from source_:: | ||
|
||
pip install . | ||
|
||
Requirements | ||
~~~~~~~~~~~~ | ||
|
||
* Python 3.6+ | ||
|
||
.. _pypi: https://pypi.org/project/pyprobs | ||
.. _source: https://github.com/OmerFI/PyProbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
License | ||
======= | ||
|
||
MIT License | ||
|
||
Copyright (c) 2021 OmerFI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/pyprobs/_version.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[metadata] | ||
name = pyprobs | ||
description = A module that returns True or False output based on given probability | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/OmerFI/PyProbs | ||
author = Ömer Furkan İşleyen | ||
author_email = [email protected] | ||
license = MIT | ||
license_files = LICENSE | ||
platforms = any | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Operating System :: MacOS :: MacOS X | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: POSIX | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Topic :: Software Development :: Libraries | ||
Topic :: Utilities | ||
keywords = probability, chance | ||
project_urls = | ||
Source=https://github.com/OmerFI/PyProbs | ||
Documentation=https://pyprobs.readthedocs.io | ||
Bug Tracker=https://github.com/OmerFI/PyProbs/issues | ||
|
||
[options] | ||
packages = find: | ||
python_requires = >=3.6 | ||
package_dir = | ||
=src | ||
zip_safe = False | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.extras_require] | ||
testing = | ||
pytest>=7.1.3 | ||
tox>=3.26.0 | ||
docs = | ||
Sphinx>=5.2.1 | ||
sphinx-rtd-theme>=1.0.0 | ||
|
||
# TODO: Add extra requirements for linting, docs, etc. as needed |
Oops, something went wrong.