Skip to content

Commit

Permalink
Fixing links and tests to work with public Github
Browse files Browse the repository at this point in the history
  • Loading branch information
william.li committed May 23, 2024
1 parent aa7f2e9 commit 40ef97e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/pdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ concurrency:
group: "pages"
cancel-in-progress: false

# Set shared directory variable
env:
SHARE_DIR: $(openssl rand -base64 12)

##########################################################################################
# Jobs
##########################################################################################
Expand Down Expand Up @@ -68,11 +64,12 @@ jobs:
mkdir -p save/pdocs
export PYTHONPATH=${{ github.workspace }}
nox -r -s pdoc
# Upload the artifact
- name: Upload artifact
run: |
mkdir -p /share/
cp -rf save /share/
# Upload the artifact to the next job
- name: Upload pdoc artifact
uses: actions/upload-artifact@v3
with:
name: pdoc artifact
path: save

########################################################################################
# Deploy the static HTML files to Github Pages.
Expand All @@ -87,10 +84,12 @@ jobs:
# We first need to checkout the repo for the code.
- name: Checkout
uses: actions/checkout@v4
# Download artifact
- name: Download artifact
run: |
cp -rf /share/save ${{ github.workspace }}
# Now download the artifact from the previous build for pdoc.
- name: Download pdoc artifact
uses: actions/download-artifact@v3
with:
name: pdoc artifact
path: save
# Now we need to replace the pdoc generated HTML files with the docs/ folder.
# Note: Github pages expects all of your HTML static files to reside in docs/
- run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ jobs:
--cov=./
--cov-report=xml
--cov-report=html:pytest-results-${{ matrix.python-version }}
# Save artifacts from pytests.
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: pytest-results-${{ matrix.python-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
</p>

<p align="center">
<a href="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pre-commit.yml"> <img alt="pre-commit" src="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pre-commit.yml/badge.svg"></a>
<a href="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pdoc.yml"> <img alt="pdoc" src="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pdoc.yml/badge.svg"></a>
<a href="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pytest.yml"> <img alt="pytest" src="https://llcad-github-dev.llan.ll.mit.edu/wi32347/dentro/actions/workflows/pytest.yml/badge.svg"></a>
<a href="https://github.com/destin-v/dentro/actions/workflows/pre-commit.yml"> <img alt="pre-commit" src="https://github.com/destin-v/dentro/actions/workflows/pre-commit.yml/badge.svg"></a>
<a href="https://github.com/destin-v/dentro/actions/workflows/pdoc.yml"> <img alt="pdoc" src="https://github.com/destin-v/dentro/actions/workflows/pdoc.yml/badge.svg"></a>
<a href="https://github.com/destin-v/dentro/actions/workflows/pytest.yml"> <img alt="pytest" src="https://github.com/destin-v/dentro/actions/workflows/pytest.yml/badge.svg"></a>
</p>

Dentro is an implementation of Counter Factual Regret Minimization (CFRM). It provides the basic building blocks needed to assemble your own graphs and solve the problem using the provided algorithm. This repo shows CFRM applied to the game of rock-paper-scissors.
Expand Down
26 changes: 13 additions & 13 deletions src/tests/game_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ def test_rock_paper_scissors():
edge_R1_B3 = G.edges[("R1", "B3")]

# Checks to ensure probs are within reasonable ranges. Blue will have converged to the Nash equilibrium at this point. Red has converged to a correlated equilibrium where it plays paper more than other moves.
check1 = 0.35 > (edge_B1_T1["s"]["m"] / edge_B1_T1["s"]["n"]) > 0.31
check2 = 0.35 > (edge_B1_T2["s"]["m"] / edge_B1_T2["s"]["n"]) > 0.31
check3 = 0.35 > (edge_B1_T3["s"]["m"] / edge_B1_T3["s"]["n"]) > 0.31
check4 = 0.35 > (edge_B2_T4["s"]["m"] / edge_B2_T4["s"]["n"]) > 0.31
check5 = 0.35 > (edge_B2_T5["s"]["m"] / edge_B2_T5["s"]["n"]) > 0.31
check6 = 0.35 > (edge_B2_T6["s"]["m"] / edge_B2_T6["s"]["n"]) > 0.31
check7 = 0.35 > (edge_B3_T7["s"]["m"] / edge_B3_T7["s"]["n"]) > 0.31
check8 = 0.35 > (edge_B3_T8["s"]["m"] / edge_B3_T8["s"]["n"]) > 0.31
check9 = 0.35 > (edge_B3_T9["s"]["m"] / edge_B3_T9["s"]["n"]) > 0.31

check10 = 0.30 > (edge_R1_B1["s"]["m"] / edge_R1_B1["s"]["n"]) > 0.25
check11 = 0.47 > (edge_R1_B2["s"]["m"] / edge_R1_B2["s"]["n"]) > 0.43
check12 = 0.30 > (edge_R1_B3["s"]["m"] / edge_R1_B3["s"]["n"]) > 0.25
check1 = 0.35 > (edge_B1_T1["s"]["m"] / edge_B1_T1["s"]["n"]) > 0.30
check2 = 0.35 > (edge_B1_T2["s"]["m"] / edge_B1_T2["s"]["n"]) > 0.30
check3 = 0.35 > (edge_B1_T3["s"]["m"] / edge_B1_T3["s"]["n"]) > 0.30
check4 = 0.35 > (edge_B2_T4["s"]["m"] / edge_B2_T4["s"]["n"]) > 0.30
check5 = 0.35 > (edge_B2_T5["s"]["m"] / edge_B2_T5["s"]["n"]) > 0.30
check6 = 0.35 > (edge_B2_T6["s"]["m"] / edge_B2_T6["s"]["n"]) > 0.30
check7 = 0.35 > (edge_B3_T7["s"]["m"] / edge_B3_T7["s"]["n"]) > 0.30
check8 = 0.35 > (edge_B3_T8["s"]["m"] / edge_B3_T8["s"]["n"]) > 0.30
check9 = 0.35 > (edge_B3_T9["s"]["m"] / edge_B3_T9["s"]["n"]) > 0.30

check10 = 0.40 > (edge_R1_B1["s"]["m"] / edge_R1_B1["s"]["n"]) > 0.20
check11 = 0.50 > (edge_R1_B2["s"]["m"] / edge_R1_B2["s"]["n"]) > 0.40
check12 = 0.40 > (edge_R1_B3["s"]["m"] / edge_R1_B3["s"]["n"]) > 0.20

assert (
check1
Expand Down

0 comments on commit 40ef97e

Please sign in to comment.