diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 4be95d7..5ec9667 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -26,10 +26,6 @@ concurrency: group: "pages" cancel-in-progress: false -# Set shared directory variable -env: - SHARE_DIR: $(openssl rand -base64 12) - ########################################################################################## # Jobs ########################################################################################## @@ -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. @@ -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: | diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 982b413..3d1c05b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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() }} diff --git a/README.md b/README.md index 5f58d52..d79430a 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@
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. diff --git a/src/tests/game_test.py b/src/tests/game_test.py index 7bc5c89..26e13e7 100644 --- a/src/tests/game_test.py +++ b/src/tests/game_test.py @@ -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