Skip to content

Commit

Permalink
Merge pull request #87 from tkoolen/tk/documenter
Browse files Browse the repository at this point in the history
Basic Documenter setup.
  • Loading branch information
tkoolen authored Oct 15, 2018
2 parents 861f5cf + 4b29a43 commit f1ed757
Show file tree
Hide file tree
Showing 23 changed files with 420 additions and 78 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
docs/build

11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ matrix:
branches:
only:
- master
- /^v[0-9]+\.[0-9]+\.[0-9]+$/ # version tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ # version tags
notifications:
email: false
after_success:
- julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
jobs:
include:
- stage: Documentation
julia: 1.0
os: linux
script:
- julia --project=docs -e 'using Pkg; Pkg.instantiate()'
- julia --project=docs --color=yes docs/make.jl
after_success: skip
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![Build Status](https://travis-ci.org/tkoolen/Parametron.jl.svg?branch=master)](https://travis-ci.org/tkoolen/Parametron.jl)
[![codecov.io](http://codecov.io/github/tkoolen/Parametron.jl/coverage.svg?branch=master)](http://codecov.io/github/tkoolen/Parametron.jl?branch=master)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://tkoolen.github.io/Parametron.jl/latest)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://tkoolen.github.io/Parametron.jl/stable)

Parametron makes it easy to set up and efficiently (ideally, with *zero* allocation) solve instances of a **parameterized family** of optimization problems.

Expand Down
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ MathOptInterface 0.5 0.6
MacroTools
FunctionWrappers 0.1.0
DocStringExtensions
Documenter
130 changes: 130 additions & 0 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "2d9e14d19bad3f9ad5cc5e4cffabc3cfa59de825"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.3.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "a016e0bfe98a748c4488e2248c2ef4c67d6fdd35"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.5.0"

[[Documenter]]
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"]
git-tree-sha1 = "d3d031cf580435034c8d3b7219a9799cdc9b6939"
repo-rev = "a9c03611eea5f8721d1ce3b388be90db569e8fc5"
repo-url = "https://github.com/JuliaDocs/Documenter.jl.git"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.19.6+"

[[FunctionWrappers]]
deps = ["Compat", "Pkg"]
git-tree-sha1 = "49bf793ebd37db5adaa7ac1eae96c2c97ec86db5"
uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
version = "1.0.0"

[[InteractiveUtils]]
deps = ["LinearAlgebra", "Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[MacroTools]]
deps = ["Compat"]
git-tree-sha1 = "c443e1c8d58a4e9f61b708ad0a88286c7042145b"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.4.4"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MathOptInterface]]
deps = ["Compat", "Pkg", "Unicode"]
git-tree-sha1 = "6bb3530fb9ed16a2f9324d6de54ec5ab9e5822e0"
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
version = "0.5.1"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Parametron]]
deps = ["DocStringExtensions", "Documenter", "FunctionWrappers", "LinearAlgebra", "MacroTools", "MathOptInterface", "Pkg", "Random", "Test"]
path = ".."
uuid = "41fac6d6-0ffa-5bcc-b863-17dd4947be41"
version = "0.3.0+"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Parametron = "41fac6d6-0ffa-5bcc-b863-17dd4947be41"
31 changes: 31 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Workaround for JuliaLang/julia/pull/28625
if Base.HOME_PROJECT[] !== nothing
Base.HOME_PROJECT[] = abspath(Base.HOME_PROJECT[])
end

using Documenter, Parametron

makedocs(
modules = [Parametron, Parametron.Functions],
checkdocs = :exports,
format = :html,
root = @__DIR__,
sitename ="Parametron.jl",
authors = "Twan Koolen and contributors.",
pages = [
"Home" => "index.md",
"API" => [
"api/functions.md",
"api/parameter.md",
"api/lazyexpression.md",
"api/model.md",
"api/debug.md",
]
],
html_prettyurls = parse(Bool, get(ENV, "CI", "false")),
)

deploydocs(
repo = "github.com/tkoolen/Parametron.jl.git",
target = "build"
)
5 changes: 5 additions & 0 deletions docs/src/api/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Debugging Utilities

```@docs
findallocs
```
43 changes: 43 additions & 0 deletions docs/src/api/functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Functions

```@meta
CurrentModule = Parametron.Functions
```

```@docs
Functions
```

## Types

```@docs
LinearTerm
QuadraticTerm
AffineFunction
QuadraticFunction
```

## Exported functions

```@docs
canonicalize
canonicalize(::QuadraticTerm)
canonicalize(::AffineFunction)
canonicalize(::QuadraticFunction)
canonicalize!
```

## In-place math functions (unexported)

```@docs
add!
subtract!
muladd!
vecdot!
vecadd!
vecsubtract!
matvecmul!
bilinearmul!
scale!
vcat!
```
19 changes: 19 additions & 0 deletions docs/src/api/lazyexpression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# LazyExpression

## The `@expression` macro

```@docs
@expression
```

## The `LazyExpression` type

```@docs
Parametron.LazyExpression
```

## Wrapping `LazyExpression`s

```@docs
Parametron.wrap
```
40 changes: 40 additions & 0 deletions docs/src/api/model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Model

## Creating a `Model`

```@docs
Model
```

## Creating Decision variables

```@docs
Variable
```

## Adding constraints and an objective function

```@docs
@constraint
@objective
setobjective!
```

## Solving

```@docs
solve!
Parametron.setdirty!
Parametron.initialize!
Parametron.update!
```

## Accessing solver results

```@docs
value
objectivevalue
terminationstatus
primalstatus
dualstatus
```
6 changes: 6 additions & 0 deletions docs/src/api/parameter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Parameter

```@autodocs
Modules = [Parametron]
Pages = ["parameter.jl"]
```
43 changes: 43 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Parametron.jl

Parametron makes it easy to set up and efficiently (ideally, with zero allocation) solve instances of a parameterized family of optimization problems.

Parametron interfaces with various solvers through MathOptInterface.jl, similar to JuMP. However, unlike JuMP, the focus of Parametron is on efficient and user-friendly problem modification.

## Installation

### Installing Julia

Download links and more detailed instructions are available on the [Julia website](http://julialang.org/). The latest version of Parametron.jl requires Julia 0.7, but we recommend downloading 1.0 (the latest stable Julia release at the time of writing).

!!! warning

Do **not** use `apt-get` or `brew` to install Julia, as the versions provided by these package managers tend to be out of date.

### Installing Parametron

To install the latest tagged release of Parametron, start Julia and enter `Pkg` mode by pressing `]`. Then simply run

```julia
add Parametron
```

To use the latest master version and work on the bleeding edge (generally, not recommended), instead run

```julia
add Parametron#master
```

A third option is to clone the repository (to the directory printed by `julia -e 'import Pkg; println(Pkg.devdir())'`):

```julia
dev Parametron
```

## Usage

See the [README](https://github.com/tkoolen/Parametron.jl/blob/master/README.md) for usage examples.

## API

See the API section for detailed documentation of exported functions.
3 changes: 2 additions & 1 deletion src/Parametron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export
objectivevalue,
terminationstatus,
primalstatus,
dualstatus
dualstatus,
findallocs

# macros
export
Expand Down
Loading

0 comments on commit f1ed757

Please sign in to comment.