Skip to content

Commit

Permalink
Updated files for julia 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsipher committed Apr 4, 2019
1 parent 5f9428f commit c27c68f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 42 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ FlexJuMP.jl is not yet a registered Julia package, but can still be installed by
with the url of the repository instead of the name.

```julia
Pkg.clone("git://github.com/pulsipher/FlexJuMP.jl.git")
using Pkg
Pkg.add("git://github.com/pulsipher/FlexJuMP.jl.git")
```

## Documentation
Expand All @@ -28,9 +29,9 @@ an API library.

## Project Status

The package is tested against Julia `0.6` on Linux, macOS, and Windows.
The package is tested against Julia `0.7`, `1.0`, and `1.1` on Linux, macOS, and Windows.

There is not yet support for Julia `0.7` or `1.0`.
A working version for Julia `0.6` can be found in julia-0.6 branch.

## Contributing
FlexJuMP is being actively developed and suggestions or other forms of contribution are encouraged.
Expand Down
39 changes: 14 additions & 25 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: 1.0
- julia_version: 1.1

platform:
- x86 # 32-bit
- x64 # 64-bit

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
matrix:
allow_failures:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
# matrix:
# allow_failures:
# - julia_version: latest

branches:
only:
Expand All @@ -30,24 +31,12 @@ notifications:
on_build_status_changed: false

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"FlexJuMP\"); Pkg.build(\"FlexJuMP\")"
- echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"

test_script:
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"FlexJuMP\")"
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
2 changes: 1 addition & 1 deletion docs/REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Documenter 0.19.6
Documenter
11 changes: 4 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
using Documenter, FlexJuMP

makedocs(modules = [FlexJuMP],
format = :html,
sitename = "FlexJuMP.jl",
doctest=true,html_prettyurls = get(ENV, "CI", nothing) == "true"
sitename = "FlexJuMP.jl - A Framework for Flexibility Analysis",
authors = "Joshua Pulsipher",
pages = ["Home" => "index.md",
"Background" => "background.md",
"User Guide" => "guide.md",
"Examples" => "examples.md",
"Library" => "api.md"])

deploydocs(
repo = "github.com/pulsipher/FlexJuMP.jl.git",
target = "build",
julia = "0.6",
deps = nothing,
make = nothing
repo = "github.com/pulsipher/FlexJuMP.jl.git"
)
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ismeanfeasible
findcenteredmean
getflexibilityindex
getconfidencelevel
getsolutiontime
getactiveconstraints
JuMP.getvalue(v::FlexibilityVariable)
rankinequalities
Expand Down
13 changes: 13 additions & 0 deletions docs/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,19 @@ data = getflexibilitydata(m)
FlexJuMP.FlexibilityData(JuMP.AbstractConstraint[-0.67*Qc + 2*T[2] + x - 100 <= 0, -1*T[2] + -x - 250 == 0, 0.5*Qc + -0.75*T[1] + -1*T[2] + -1*T[3] + 1388.5 <= 0, -1*Qc + 1.5*T[1] + 2*T[2] + 1*T[3] + -2044 >= 0, 1*Qc + -1.5*T[1] + -2*T[2] + -1*T[3] + -2*T[4] + 2830 <= 0, -1*Qc + 1.5*T[1] + 2*T[2] + 1*T[3] + 3*T[4] + -3153 <= 0], 4, Number[620, 388, 583, 313], AbstractString["T[1]", "T[2]", "T[3]", "T[4]"], [1, 2, 3, 4], 1, AbstractString["Qc"], [5], FlexJuMP.EllipsoidalSet(:Ellipsoid, false), Number[11.11 0.0 0.0 0.0; 0.0 11.11 0.0 0.0; 0.0 0.0 11.11 0.0; 0.0 0.0 0.0 11.11], 3.600355086286672, [3, 6])
```

### Solution Time Extraction
The optimal solution time stored in `m` can be extracted using the
[`getsolutiontime`](@ref) method. This is extracted from the if it is supported,
otherwise it is determined using the `@elapsed` macro. With the current example we
have:

```julia
opt_time = getsolutiontime(m)
```
```julia
0.0034827596723466
```

## Analysis Methods

### Ranking Limiting Constraints
Expand Down
7 changes: 4 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ FlexJuMP.jl is not yet a registered Julia package, but can still be installed by
with the url of the repository instead of the name.

```julia
Pkg.clone("git://github.com/pulsipher/FlexJuMP.jl.git")
using Pkg
Pkg.add("git://github.com/pulsipher/FlexJuMP.jl.git")
```
Also, FlexJuMP.jl only supports Julia 0.6, but soon will be compatible with Julia 0.7 and
Julia 1.0.
The latest version of FlexJuMP.jl now only supports Julia 0.7 and above. A version is still available for use
with Julia 0.6 under the julia-0.6 branch.

## Quick Start
Below is a brief example of the high-level API, more explanation and examples are provided in [User Guide](@ref) and [Examples](@ref).
Expand Down
2 changes: 1 addition & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function solvehook(m::Model; suppress_warnings::Bool = false, U::Number = 10000,
end

# Parse the active active constraints
active_inds = findall(abs.(getvalue(y) - 1) .<= 1e-4)
active_inds = findall(abs.(getvalue(y) - ones(n_f)) .<= 1e-4)
flex_data.active_constraints = inequal_inds[active_inds]

# Save the flexibility index
Expand Down
4 changes: 2 additions & 2 deletions test/solvehook_checks.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Test the solvehook's options
# @test_logs (:warn, "Problem requires use of active set constraint. Setting active_constr = true") solve(m) == :Optimal
@test_logs (:warn, "Problem requires use of active set constraint. Setting active_constr = true") solve(m) == :Optimal
@test solve(m, active_constr = true) == :Optimal && abs(getflexibilityindex(m) - 3.6) <= 1e-2
@test solve(m, active_constr = true, diag = true) == :Optimal && abs(getflexibilityindex(m) - 3.6) <= 1e-2
@test solve(m, active_constr = true, conic_δ = true) == :Optimal && abs(getflexibilityindex(m) - 3.6) <= 1e-2
@test solve(m, active_constr = true) == :Optimal && abs(getflexibilityindex(m) - 3.6) <= 1e-2
# @test_logs (:warn, "The slack upper bound (U)") solve(m, active_constr = true, U = 1000) == :Optimal
@test_logs (:warn, "The slack upper bound (U) value of 1000 is too low for this problem. Thus, U is being set to 10000.0 !") solve(m, active_constr = true, U = 1000) == :Optimal

# Test with other uncertainty sets
dev = ones(flex_data.numRVs) * 10
Expand Down

0 comments on commit c27c68f

Please sign in to comment.