Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #103 from fedden/develop
Browse files Browse the repository at this point in the history
merge to master
  • Loading branch information
fedden authored Jul 5, 2020
2 parents 0879e78 + 294da2d commit 3c4dbb5
Show file tree
Hide file tree
Showing 153 changed files with 8,178 additions and 5,571 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
applications
assets
clustering_cache
docs
paper
poker_ai.egg-info
research
!research/blueprint_algo/preflop_lossless.pkl
!research/blueprint_algo/flop_lossy_2.pkl
!research/blueprint_algo/river_lossy_2.pkl
!research/blueprint_algo/turn_lossy_2.pkl
!research/size_of_problem/action_sequences.pkl
tags
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # free_poker_artificial_intelligence
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: fedden

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to path '...'
2. Run command '....'
3. Check output of '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Linux, Mac OS X, Windows]
- Python version: [e.g 3.7, 3.8]
- Browser [e.g. chrome, safari]
- Any other relevant environment information...

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: fedden, big-c-note

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
32 changes: 32 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
research/
tags
tags/
*.pkl
Expand Down
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements.txt
24 changes: 8 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
language: python

# Environment variables.
env:
global:
- CC_TEST_REPORTER_ID=607f73633cb88df8c21568f855bd394dc47772d2228b2f0476ad8c87b625a334
services:
- docker

# Which version(s) of python we want to use for testing.
python:
- "3.7"

# command to install dependencies
install:
- pip install -r requirements.txt
- pip install pytest pytest-cov
- pip install .
before_install:
- docker build -t pokeraitest .

# Hook up code coverage in the before test script.
before_script:
Expand All @@ -22,12 +13,13 @@ before_script:
- ./cc-test-reporter before-build

# command to run test script.
script: pytest
script:
- docker run -ti pokeraitest pytest test -v --cov-report term --cov-report xml --cov-fail-under=50 --cov=/poker_ai/poker_ai
- MOST_RECENT_IMAGE=$(docker ps -a --format "{{.Image}}" | head -1)

# Code to run after the test script.
after_script:
- pytest test -v --cov-report term --cov-report xml --cov-fail-under=90 --cov=pluribus
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker run -ti $MOST_RECENT_IMAGE ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

# Alert us in slack.
notifications:
Expand Down
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at leonfedden@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ If you want to work on the codebase, then although you don't have to, it is reco

With ssh (recommended):
```bash
git clone git@github.com:fedden/pluribus-poker-AI.git
git clone git@github.com:fedden/poker_ai.git
```

With https:
```bash
git clone https://github.com/fedden/pluribus-poker-AI.git
git clone https://github.com/fedden/poker_ai.git
```

### 2. Initialise the repo with git flow
Expand All @@ -27,7 +27,7 @@ sudo apt install git-flow

If you are using Mac OS X, please checkout the [install instructions](https://github.com/nvie/gitflow/wiki/Mac-OS-X).

Now `cd` to the root of the pluribus repo.
Now `cd` to the root of the poker_ai repo.

Run:
```bash
Expand Down Expand Up @@ -98,4 +98,4 @@ git push origin feature/my-feature-branch-name-here --force

Once you have wrote your cool new feature, you'll need to make a PR. If you can write any tests to support any new features introduced, this would be very welcome. If you have any conflicts with `develop` please ensure you have rebased with `develop` as instructed in step (3).

Please open a pull request via the github UI and request to merge into `develop`. Once there has been a successful review of your PR, and the automated tests pass, then feel free to merge at your leisure.
Please open a pull request via the github UI and request to merge into `develop`. Once there has been a successful review of your PR, and the automated tests pass, then feel free to merge at your leisure.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM pokerai/pokerai:1.0.0rc1
# Copy the requirements.
COPY requirements.txt requirements.txt
# Install python modules.
RUN pip install -r requirements.txt
# Copy everything else.
COPY . /poker_ai
RUN pip install -e .
# Setup tests.
RUN pip install pytest-cov
ENV CC_TEST_REPORTER_ID=607f73633cb88df8c21568f855bd394dc47772d2228b2f0476ad8c87b625a334
RUN curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
RUN chmod +x ./cc-test-reporter
RUN ./cc-test-reporter before-build
CMD ["/bin/bash"]
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1.0.0rc1
--------

* Adding script to train AI.
* Adding script to cluster hands.
* Adding script to RT search on top of offline strategy.
* Adding Sphinx auto documentation.
* Adding CLI for all key supported scripts.
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,22 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.



EXCEPTIONS AND ADDITIONAL PERMISSIONS

Indemnification

You hereby indemnify the licensors and authors from all liability and
claims arising from your use of the licensed technology. The copyright
holder, or any other party who modifies and/or conveys the Program as
permitted above, will be responsible for and will indemnify and keep
indemnified the authors of the Program in respect of any liability, loss,
damage, cost, expense, deduction, contribution, assessment, penalty, fine,
or interest arising from or made in connection with any claim arising out
of the use, provision, or conveyance of the Program.


END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs
Expand Down Expand Up @@ -672,3 +688,4 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

14 changes: 14 additions & 0 deletions ParentDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.7
RUN mkdir /poker_ai
# Work from the root of the repo.
WORKDIR /poker_ai
# Supply '--build_arg LUT_DIR=research/blueprint_algo' here.
ARG LUT_DIR
# Copy pickle LUTs over.
COPY "${LUT_DIR}/flop_lossy_2.pkl" .
COPY "${LUT_DIR}/preflop_lossless.pkl" .
COPY "${LUT_DIR}/river_lossy_2.pkl" .
COPY "${LUT_DIR}/turn_lossy_2.pkl" .
# Set the environment variable for the tests
ENV LUT_DIR="/poker_ai"
CMD ["/bin/bash"]
Loading

0 comments on commit 3c4dbb5

Please sign in to comment.