From 4327d3fec5622baad967d218964819161ba24fab Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 21 Sep 2021 09:08:41 -0400 Subject: [PATCH] testing rename of package --- .github/workflows/ci.yml | 4 ++-- LICENSE.md | 2 +- Project.toml | 6 +++--- README.md | 6 +++--- benchmark/README.md | 8 ++++---- benchmark/benchmarks.jl | 4 ++-- docs/README.md | 6 +++--- docs/auto_doc_gen.jl | 14 +++++++------- docs/make.jl | 8 ++++---- docs/src/index.md | 14 +++++++------- src/{Games.jl => GameTheory.jl} | 2 +- src/generators/Generators.jl | 2 +- src/normal_form_game.jl | 8 ++++---- src/repeated_game.jl | 6 +++--- src/util.jl | 2 +- test/generators/runtests.jl | 4 ++-- test/runtests.jl | 2 +- test/test_repeated_game.jl | 6 +++--- 18 files changed, 52 insertions(+), 52 deletions(-) rename src/{Games.jl => GameTheory.jl} (99%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa2b4e89..11e7537e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,8 +57,8 @@ jobs: - run: | julia --project=docs -e ' using Documenter: doctest - using Games - doctest(Games)' + using GameTheory + doctest(GameTheory)' - run: julia --project=docs docs/make.jl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/LICENSE.md b/LICENSE.md index 8aa9650c..c1c92ac1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The Games.jl package is licensed under the BSD-3 License. All rights reserved. +The GameTheory.jl package is licensed under the BSD-3 License. All rights reserved. > Copyright (c) 2016: The QuantEcon team > diff --git a/Project.toml b/Project.toml index 3f37d87d..063665b2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ -name = "Games" -uuid = "d5cce6e7-4428-536b-a17f-94dfa0e3a07a" -repo = "https://github.com/QuantEcon/Games.jl.git" +name = "GameTheory" +uuid = "64a4ffa8-f47c-4a47-8dad-aee7aadc3b51" +repo = "https://github.com/QuantEcon/GameTheory.jl.git" version = "0.1.0" [deps] diff --git a/README.md b/README.md index 7e0ec7a5..43cee341 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Games -[![Build Status](https://github.com/QuantEcon/Games.jl/workflows/CI/badge.svg)](https://github.com/QuantEcon/Games.jl/actions/workflows/ci.yml) -[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://QuantEcon.github.io/Games.jl/latest) -[![codecov](https://codecov.io/gh/QuantEcon/Games.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/QuantEcon/Games.jl) +[![Build Status](https://github.com/QuantEcon/GameTheory.jl/workflows/CI/badge.svg)](https://github.com/QuantEcon/GameTheory.jl/actions/workflows/ci.yml) +[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://QuantEcon.github.io/GameTheory.jl/latest) +[![codecov](https://codecov.io/gh/QuantEcon/GameTheory.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/QuantEcon/GameTheory.jl) Algorithms and data structures for game theory in Julia diff --git a/benchmark/README.md b/benchmark/README.md index 6c113d54..7a9c2559 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -1,4 +1,4 @@ -# Games.jl Benchmarks +# GameTheory.jl Benchmarks ## Running the benchmark suite @@ -9,12 +9,12 @@ using PkgBenchmark ``` As an example, let us run the benchmarks (defined in `benchmarks.jl`) and compare the performance changes for the two commits -[`68f3c4b`](https://github.com/QuantEcon/Games.jl/commit/68f3c4bef03554a00384350a047f1e95abd865df) (target) +[`68f3c4b`](https://github.com/QuantEcon/GameTheory.jl/commit/68f3c4bef03554a00384350a047f1e95abd865df) (target) and -[`d6682de`](https://github.com/QuantEcon/Games.jl/commit/d6682deb9fdae6f16a89b17fbeee9061d763710a) (baseline): +[`d6682de`](https://github.com/QuantEcon/GameTheory.jl/commit/d6682deb9fdae6f16a89b17fbeee9061d763710a) (baseline): ```jl -jud = judge("Games", "68f3c4b", "d6682de") +jud = judge("GameTheory", "68f3c4b", "d6682de") ``` To show the results: diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index a393bf82..49eb7e96 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -1,5 +1,5 @@ -using Games -using Games.Generators +using GameTheory +using GameTheory.Generators using BenchmarkTools const SUITE = BenchmarkGroup() diff --git a/docs/README.md b/docs/README.md index cfd1b012..76ffb0db 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,9 +1,9 @@ ## Generate docs automatically -To generate documentation for `Games.jl` locally, run +To generate documentation for `GameTheory.jl` locally, run ``` -$ cd ~/.julia/v0.6/Games/docs +$ cd ~/.julia/v0.6/GameTheory/docs $ julia make.jl ``` @@ -16,7 +16,7 @@ There are three parts to generate the documentation. ### auto_doc_gen.jl -Main part of documentation generation. It reads `src/Games.jl` to find +Main part of documentation generation. It reads `src/GameTheory.jl` to find out all the source files (include the ones used in submodules), and then write markdown files for each by the structure instructed by `docs/build/Structure`, which will be utilized by "Documenter.jl" later. diff --git a/docs/auto_doc_gen.jl b/docs/auto_doc_gen.jl index cd109993..58e92536 100644 --- a/docs/auto_doc_gen.jl +++ b/docs/auto_doc_gen.jl @@ -6,7 +6,7 @@ docs using `Documenter.jl`. =# -path = replace(pathof(Games), "src/Games.jl" => "") +path = replace(pathof(GameTheory), "src/GameTheory.jl" => "") # read the basic structures order = SubString{String}[] @@ -31,19 +31,19 @@ open(joinpath(path, "docs/Structure")) do f end end -modules = String["Games"] -# find all files used in Games.jl +modules = String["GameTheory"] +# find all files used in GameTheory.jl re = r"include\(\"(.*)\.jl\"\)" files = String[] -open(joinpath(path, "src/Games.jl")) do f +open(joinpath(path, "src/GameTheory.jl")) do f for match in eachmatch(re, String(read(f))) # check if it is a submodule if occursin("/", match.captures[1]) submodule_path = match.captures[1] submodule_dir, submodule_name = split(submodule_path, "/") # add submodule name to modules - push!(modules, "Games.$submodule_name") + push!(modules, "GameTheory.$submodule_name") # find all files used in submodules open(joinpath(path, "src/$submodule_path.jl")) do f_submodule for match_sub in eachmatch(re, String(read(f_submodule))) @@ -116,9 +116,9 @@ for section_name in sections_names section_name_lower = replace(lowercase(section_name), " " => "_") section_file_list = join(map(i -> string("\"", i, ".jl\""), section_files), ", ") - # include "Games.jl" in "Base Types and Methods" + # include "GameTheory.jl" in "Base Types and Methods" if section_name == "Base Types and Methods" - section_file_list = string("\"Games.jl\", ", section_file_list) + section_file_list = string("\"GameTheory.jl\", ", section_file_list) end section_page = """ # [$section_name](@id $section_name_lower) diff --git a/docs/make.jl b/docs/make.jl index 136c7247..2d326eba 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,16 +1,16 @@ -using Documenter, Games +using Documenter, GameTheory include("auto_doc_gen.jl") makedocs( - modules = [Games], + modules = [GameTheory], format = Documenter.HTML(prettyurls = false), - sitename = "Games.jl", + sitename = "GameTheory.jl", pages = PAGES, ) deploydocs( - repo = "github.com/QuantEcon/Games.jl.git", + repo = "github.com/QuantEcon/GameTheory.jl.git", branch = "gh-pages", target = "build", deps = nothing, diff --git a/docs/src/index.md b/docs/src/index.md index 312ef04d..f6a360e4 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,23 +1,23 @@ -# Games.jl +# GameTheory.jl -*Games.jl* is a [`Julia`](http://www.julialang.org) package about algorithms and data structures for Game Theory. +*GameTheory.jl* is a [`Julia`](http://www.julialang.org) package about algorithms and data structures for Game Theory. ## Installation -*Games.jl* is an unregistered package that is currently under development. +*GameTheory.jl* is an unregistered package that is currently under development. To install the package, enter the Pkg mode by pressing `]` and run ```julia -add https://github.com/QuantEcon/Games.jl +add https://github.com/QuantEcon/GameTheory.jl ``` ## Usage -Once installed, the `Games` package can be used by typing +Once installed, the `GameTheory` package can be used by typing ```@example 1 -using Games +using GameTheory ``` The Base type `Player` can be created by passing a payoff matrix. @@ -44,7 +44,7 @@ payoff_bimatrix[2, 2, :] = [2, 3] g = NormalFormGame(payoff_bimatrix) ``` -After constructing a `NormalFormGame`, we can find its Nash Equilibria by using methods of `Games`. For example, `pure_nash` finds all pure action Nash Equilibria by enumeration. +After constructing a `NormalFormGame`, we can find its Nash Equilibria by using methods of `GameTheory`. For example, `pure_nash` finds all pure action Nash Equilibria by enumeration. ```@example 1 pure_nash(g) diff --git a/src/Games.jl b/src/GameTheory.jl similarity index 99% rename from src/Games.jl rename to src/GameTheory.jl index c39b4581..bd5fbbee 100644 --- a/src/Games.jl +++ b/src/GameTheory.jl @@ -1,4 +1,4 @@ -module Games +module GameTheory # stdlib using LinearAlgebra, Random diff --git a/src/generators/Generators.jl b/src/generators/Generators.jl index bc8546dc..0e00e5aa 100644 --- a/src/generators/Generators.jl +++ b/src/generators/Generators.jl @@ -2,7 +2,7 @@ module Generators using Random -using Games: Player, NormalFormGame +using GameTheory: Player, NormalFormGame include("bimatrix_generators.jl") export blotto_game, ranking_game, sgc_game, unit_vector_game, tournament_game diff --git a/src/normal_form_game.jl b/src/normal_form_game.jl index 5f7d845e..b3aa5364 100644 --- a/src/normal_form_game.jl +++ b/src/normal_form_game.jl @@ -881,7 +881,7 @@ Return true if `action_profile` is Pareto dominant for game `g`. # is_dominated """ - is_dominated(player, action; tol=1e-8, lp_solver=Games.clp_optimizer_silent) + is_dominated(player, action; tol=1e-8, lp_solver=GameTheory.clp_optimizer_silent) Determine whether `action` is strictly dominated by some mixed action. @@ -892,7 +892,7 @@ Determine whether `action` is strictly dominated by some mixed action. - `tol::Real` : Tolerance level used in determining domination. - `lp_solver` : Linear programming solver to be used internally. Pass a `MathOptInterface.AbstractOptimizer` type (such as `Clp.Optimizer`) if no - option is needed, or a function (such as `Games.clp_optimizer_silent`) to + option is needed, or a function (such as `GameTheory.clp_optimizer_silent`) to supply options. # Returns @@ -980,7 +980,7 @@ is_dominated( # dominated_actions """ - dominated_actions(player; tol=1e-8, lp_solver=Games.clp_optimizer_silent) + dominated_actions(player; tol=1e-8, lp_solver=GameTheory.clp_optimizer_silent) Return a vector of actions that are strictly dominated by some mixed actions. @@ -991,7 +991,7 @@ Return a vector of actions that are strictly dominated by some mixed actions. - `lp_solver::Union{Type{<:MathOptInterface.AbstractOptimizer},Function}` : Linear programming solver to be used internally. Pass a `MathOptInterface.AbstractOptimizer` type (such as `Clp.Optimizer`) if no - option is needed, or a function (such as `Games.clp_optimizer_silent`) to + option is needed, or a function (such as `GameTheory.clp_optimizer_silent`) to supply options. # Returns diff --git a/src/repeated_game.jl b/src/repeated_game.jl index d9fcfcfb..5d91c8a3 100644 --- a/src/repeated_game.jl +++ b/src/repeated_game.jl @@ -254,7 +254,7 @@ Given a constraint w ∈ W, this finds the worst possible payoff for agent i. - `i::Int` : The player of interest. - `lp_solver` : Linear programming solver to be used internally. Pass a `MathOptInterface.AbstractOptimizer` type (such as `Clp.Optimizer`) if no - option is needed, or a function (such as `Games.clp_optimizer_silent`) + option is needed, or a function (such as `GameTheory.clp_optimizer_silent`) to supply options. @@ -330,7 +330,7 @@ worst_value_2( outerapproximation(rpd; nH=32, tol=1e-8, maxiter=500, check_pure_nash=true, verbose=false, nskipprint=50, plib=default_library(2, Float64), - lp_solver=Games.clp_optimizer_silent) + lp_solver=GameTheory.clp_optimizer_silent) Approximates the set of equilibrium values for a repeated game with the outer hyperplane approximation described by Judd, Yeltekin, Conklin (2002). @@ -352,7 +352,7 @@ hyperplane approximation described by Judd, Yeltekin, Conklin (2002). docs for more info). By default, it chooses to use `Polyhedra.DefaultLibrary`. - `lp_solver` : Linear programming solver to be used internally. Pass a `MathOptInterface.AbstractOptimizer` type (such as `Clp.Optimizer`) if no - option is needed, or a function (such as `Games.clp_optimizer_silent`) + option is needed, or a function (such as `GameTheory.clp_optimizer_silent`) to supply options. # Returns diff --git a/src/util.jl b/src/util.jl index 5dffced4..f58a3cd4 100644 --- a/src/util.jl +++ b/src/util.jl @@ -1,5 +1,5 @@ #= -Utility functions used in Games.jl +Utility functions used in GameTheory.jl =# """ diff --git a/test/generators/runtests.jl b/test/generators/runtests.jl index 237039bf..f38067c9 100644 --- a/test/generators/runtests.jl +++ b/test/generators/runtests.jl @@ -1,5 +1,5 @@ -using Games: pure_nash +using GameTheory: pure_nash using QuantEcon: MVNSampler -using Games.Generators +using GameTheory.Generators include("test_bimatrix_generators.jl") diff --git a/test/runtests.jl b/test/runtests.jl index 1e30e86b..f7ed5b47 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using Games +using GameTheory using Test include("test_pure_nash.jl") diff --git a/test/test_repeated_game.jl b/test/test_repeated_game.jl index 0ae573fe..8e48fa99 100644 --- a/test/test_repeated_game.jl +++ b/test/test_repeated_game.jl @@ -11,7 +11,7 @@ using CDDLib # Tests construction of repeated game rpd = RepeatedGame(nfg, 0.75) - C, H, Z = Games.initialize_sg_hpl(4, [0.0, 0.0], 1.0) + C, H, Z = GameTheory.initialize_sg_hpl(4, [0.0, 0.0], 1.0) # # Test various helper functions @@ -27,7 +27,7 @@ using CDDLib end @testset "Testing unit circle function" begin - H = Games.unitcircle(4) + H = GameTheory.unitcircle(4) points = [1.0 0.0 0.0 1.0 -1.0 0.0 @@ -37,7 +37,7 @@ using CDDLib end @testset "Testing subgradient and hyperplane level initialize" begin - C, H, Z = Games.initialize_sg_hpl(4, [0.0, 0.0], 1.0) + C, H, Z = GameTheory.initialize_sg_hpl(4, [0.0, 0.0], 1.0) @test maximum(abs, C - ones(4)) < 1e-12 @test maximum(abs, H - Z') < 1e-12