diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100644 index dd821e6..0000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: CompatHelper - -on: - schedule: - - cron: '00 00 * * *' - -jobs: - CompatHelper: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@latest - with: - version: 1.3 - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..778c06f 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,9 +1,12 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d6d271..3743a4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: branches: [master] pull_request: types: [opened, synchronize, reopened] +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -11,33 +15,25 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.6', '1'] # Test against LTS and current minor release + version: ['1.6', '1'] os: [ubuntu-latest, macOS-latest, windows-latest] arch: [x64] include: - # Also test against 32-bit Linux on LTS. - - version: '1.6' + # Also test against 32-bit Linux. + - version: '1' os: ubuntu-latest arch: x86 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v4 with: file: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a101e03..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: julia -codecov: true -coveralls: true -os: - - linux - - osx -julia: - - 1.0 - - 1.1 - - 1.2 - - 1.3 - - 1.4 -notifications: - email: false diff --git a/Project.toml b/Project.toml index 8967c2d..50d9b8c 100644 --- a/Project.toml +++ b/Project.toml @@ -20,4 +20,4 @@ Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "Cbc"] +test = ["Cbc", "Test"] diff --git a/README.md b/README.md index 9a4ebba..d11db62 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ # PiecewiseLinearOpt -A package for modeling optimization problems containing piecewise linear functions. Current support is for (the graphs of) continuous univariate functions. +[![Build Status](https://github.com/jump-dev/PiecewiseLinearOpt.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/PiecewiseLinearOpt.jl/actions?query=workflow%3ACI) +[![codecov](https://codecov.io/gh/jump-dev/PiecewiseLinearOpt.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/PiecewiseLinearOpt.jl) -This package is an accompaniment to a paper entitled [_Nonconvex piecewise linear functions: Advanced formulations and simple modeling tools_](https://arxiv.org/abs/1708.00050), by Joey Huchette and Juan Pablo Vielma. +A package for modeling optimization problems containing piecewise linear +functions. Current support is for (the graphs of) continuous univariate +functions. -[![Build Status](https://travis-ci.org/joehuchette/PiecewiseLinearOpt.jl.svg?branch=master)](https://travis-ci.org/joehuchette/PiecewiseLinearOpt.jl) +This package is an accompaniment to a paper entitled +[_Nonconvex piecewise linear functions: Advanced formulations and simple modeling tools_](https://arxiv.org/abs/1708.00050), +by Joey Huchette and Juan Pablo Vielma. -[![Coverage Status](https://coveralls.io/repos/joehuchette/PiecewiseLinearOpt.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/joehuchette/PiecewiseLinearOpt.jl?branch=master) +This package offers helper functions for the +[JuMP algebraic modeling language](https://github.com/jump-dev/JuMP.jl). -[![codecov.io](http://codecov.io/github/joehuchette/PiecewiseLinearOpt.jl/coverage.svg?branch=master)](http://codecov.io/github/joehuchette/PiecewiseLinearOpt.jl?branch=master) - -This package offers helper functions for the [JuMP algebraic modeling language](https://github.com/JuliaOpt/JuMP.jl). - -Consider a piecewise linear function. The function is described in terms of the breakpoints between pieces, and the function value at those breakpoints. +Consider a piecewise linear function. The function is described in terms of the +breakpoints between pieces, and the function value at those breakpoints. Consider a JuMP model @@ -22,14 +25,18 @@ m = Model() @variable(m, x) ``` -To model the graph of a piecewise linear function ``f(x)``, take ``d`` as some set of breakpoints along the real line, and ``fd = [f(x) for x in d]`` as the corresponding function values. You can model this function in JuMP using the following function: +To model the graph of a piecewise linear function ``f(x)``, take ``d`` as some +set of breakpoints along the real line, and ``fd = [f(x) for x in d]`` as the +corresponding function values. You can model this function in JuMP using the +following function: ```julia z = piecewiselinear(m, x, d, fd) @objective(m, Min, z) # minimize f(x) ``` -For another example, think of a piecewise linear approximation for for the function $f(x,y) = exp(x+y)$: +For another example, think of a piecewise linear approximation for the function +$f(x,y) = exp(x+y)$: ```julia using JuMP, PiecewiseLinearOpt @@ -41,7 +48,9 @@ z = piecewiselinear(m, x, y, 0:0.1:1, 0:0.1:1, (u,v) -> exp(u+v)) @objective(m, Min, z) ``` -Current support is limited to modeling the graph of a continuous piecewise linear function, either univariate or bivariate, with the goal of adding support for the epigraphs of lower semicontinuous piecewise linear functions. +Current support is limited to modeling the graph of a continuous piecewise +linear function, either univariate or bivariate, with the goal of adding support +for the epigraphs of lower semicontinuous piecewise linear functions. Supported univariate formulations: @@ -60,7 +69,11 @@ Supported bivariate formulations for entire constraint: * Multiple choice (``:MC``) * Dissaggregated Logarithmic (``:DisaggLogarithmic``) -Also, you can use any univariate formulation for bivariate functions as well. They will be used to impose two axis-aligned SOS2 constraints, along with the "6-stencil" formulation for the triangle selection portion of the constraint. See the associated paper for more details. In particular, the following are also acceptable bivariate formulation choices: +Also, you can use any univariate formulation for bivariate functions as well. +They will be used to impose two axis-aligned SOS2 constraints, along with the +"6-stencil" formulation for the triangle selection portion of the constraint. +See the associated paper for more details. In particular, the following are also +acceptable bivariate formulation choices: * Native SOS2 branching (``:SOS2``) * Incremental (``:Incremental``) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3d8ea54..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,36 +0,0 @@ -environment: - matrix: - - julia_version: 0.7 - - julia_version: 1.0 - -platform: - - x86 # 32-bit - - x64 # 64-bit - -matrix: - allow_failures: - - julia_version: 0.7 - platform: x86 - - julia_version: 1.0 - platform: x86 - -branches: - only: - - master - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"