Skip to content

Commit

Permalink
Merge pull request #8 from psrenergy/px/qubotools-v1
Browse files Browse the repository at this point in the history
Update `QUBOTools -> v0.9; QUBODrivers -> 0.3`
  • Loading branch information
pedromxavier authored Sep 24, 2023
2 parents 2668eaf + 08e226a commit f517c0f
Show file tree
Hide file tree
Showing 55 changed files with 1,590 additions and 1,796 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
fail-fast: false
matrix:
include:
- version: '1'
- version: '1.9'
os: ubuntu-latest
arch: x64
- version: '1'
- version: '1.9'
os: windows-latest
arch: x64
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Julia
uses: julia-actions/setup-julia@latest
with:
version: '1.6'
version: '1.9'
- name: Develop QUBODrivers.jl
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(path=pwd())'
- name: Build Package
Expand Down
25 changes: 10 additions & 15 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name = "QUBODrivers"
uuid = "a3f166f7-2cd3-47b6-9e1e-6fbfe0449eb0"
version = "0.2.0"
authors = [
"pedromxavier <pedroxavier@psr-inc.com>",
"pedroripper <pedroripper@psr-inc.com>",
"AndradeTiago <tiago.andrade@psr-inc.com>",
"joaquimg <joaquim@psr-inc.com>",
"bernalde <dbernalneira@usra.edu>",
]
name = "QUBODrivers"
uuid = "a3f166f7-2cd3-47b6-9e1e-6fbfe0449eb0"
authors = ["pedromxavier <pedroxavier@psr-inc.com>", "pedroripper <pedroripper@psr-inc.com>", "AndradeTiago <tiago.andrade@psr-inc.com>", "joaquimg <joaquim@psr-inc.com>", "bernalde <dbernaln@purdue.edu>"]
version = "0.3.0"

[deps]
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
MathOptInterface = "1"
QUBOTools = "0.8"
julia = "1.6"
QUBOTools = "~0.9"
julia = "1.9"
17 changes: 9 additions & 8 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QUBODrivers = "a3f166f7-2cd3-47b6-9e1e-6fbfe0449eb0"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"

[compat]
Documenter = "0.27"
JuMP = "1"
Documenter = "1"
JuMP = "1"
MathOptInterface = "1"
Plots = "1.38"
QUBOTools = "0.8"
Plots = "1.38"
QUBOTools = "0.9"
33 changes: 21 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
using Documenter
using QUBODrivers
using QUBOTools

# Set up to run docstrings with jldoctest
DocMeta.setdocmeta!(QUBODrivers, :DocTestSetup, :(using QUBODrivers); recursive = true)
DocMeta.setdocmeta!(QUBOTools, :DocTestSetup, :(using QUBOTools); recursive = true)

makedocs(;
modules = [QUBODrivers],
doctest = true,
clean = true,
format = Documenter.HTML(
modules = [QUBODrivers, QUBODrivers.QUBOTools],
doctest = true,
clean = true,
warnonly = [:missing_docs],
format = Documenter.HTML(
assets = ["assets/extra_styles.css"], #, "assets/favicon.ico"],
mathengine = Documenter.KaTeX(),
sidebar_sitename = false,
),
sitename = "QUBODrivers.jl",
authors = "Pedro Xavier and Pedro Ripper and Tiago Andrade and Joaquim Garcia and David Bernal",
pages = [
"Home" => "index.md",
# "Manual" => "manual.md",
# "Examples" => "examples.md",
# "Samplers" => "samplers.md",
"Home" => "index.md",
"Manual" => [
"Introduction" => "manual/1-intro.md",
"Solving QUBO" => "manual/2-solve.md",
"Samplers" => "manual/3-samplers.md",
"Sampler Setup" => "manual/4-setup.md",
"Test Suite" => "manual/5-tests.md",
"Benchmarking" => "manual/6-benchmarks.md",
],
"Booklet" => [
"Itroduction" => "booklet/1-intro.md",
"Sampler Interface" => "booklet/2-interface.md",
"Attribute System" => "booklet/3-attributes.md",
],
],
workdir = @__DIR__,
workdir = @__DIR__
)

if "--skip-deploy" ARGS
@warn "Skipping deployment"
else
deploydocs(repo = raw"github.com/psrenergy/QUBODrivers.jl.git", push_preview = true)
deploydocs(; repo = raw"github.com/psrenergy/QUBODrivers.jl.git", push_preview = true)
end
12 changes: 12 additions & 0 deletions docs/src/booklet/1-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# QUBODrivers.jl Booklet

This booklet aims to provide an advanced overview of the QUBODrivers.jl package, delving into the details of the package's inner workings.
It is meant to discuss the package's design choices and provide a guide for developers who wish not only to implement new interfaces but also to extend the package's functionality.
Reading this booklet is not required to use the package, but it is strongly recommended for those who wish to contribute to the project.

## Table of Contents

```@contents
Pages = ["2-interface.md", "3-attributes.md"]
Depth = 2
```
9 changes: 9 additions & 0 deletions docs/src/booklet/2-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Sampler Interface

```@docs
QUBODrivers.AbstractSampler
```

```@docs
QUBODrivers.set_model!
```
61 changes: 61 additions & 0 deletions docs/src/booklet/3-attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Attributes

## API

```@docs
QUBODrivers.SamplerAttribute
```

```@docs
QUBODrivers.RawSamplerAttribute
QUBODrivers.@raw_attr_str
```

```@docs
QUBODrivers.get_raw_attr
QUBODrivers.set_raw_attr!
QUBODrivers.default_raw_attr
```

## An advanced example

```julia
module SuperSampler

import QUBODrivers
import QUBODrivers: QUBOTools
import MathOptInterface as MOI

QUBODrivers.@setup Optimizer begin
name = "Super Sampler"
version = v"1.0.2"
attributes = begin
NumberOfReads["num_reads"]::Integer = 100_000
SuperAttribute["super_attr"]::String = "super"
end
end

function MOI.set(sampler::Optimizer, attr::raw_attr"", value)
if !(value isa Integer)
error("'num_reads' must be an integer")
else
QUBODrivers.set_raw_attr!(sampler, attr, value)
end

return nothing
end

function MOI.set(sampler::Optimizer, attr::raw_attr"super_attr", value)
if !(value isa AbstractString)
error("'super_attr' must be a string")
elseif !(value ("super", "ultra", "mega"))
error("'super_attr' must be one of the following: 'super', 'ultra', 'mega'")
else
QUBODrivers.set_raw_attr!(sampler, attr, value)
end

return nothing
end

end # SuperSampler module
```
49 changes: 0 additions & 49 deletions docs/src/examples.md

This file was deleted.

24 changes: 13 additions & 11 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# QUBODrivers.jl Documentation

## Introduction

This package aims to provide a common [MOI](https://github.com/jump-dev/MathOptInterface.jl)-compliant API for [QUBO](https://en.wikipedia.org/wiki/Quadratic_unconstrained_binary_optimization) Sampling & Annealing machines.
It also contains a few utility samplers and testing tools for performance comparison, sanity checks and basic analysis features.

## Quick Start

### Installation

[QUBODrivers.jl](https://github.com/psrenergy/QUBODrivers.jl) is registered in Julia's General Registry and is available for download using the standard package manager.

```julia-repl
julia> import Pkg
julia> Pkg.add("QUBODrivers")
```
```

### Example

```@example
using JuMP
using QUBODrivers
Expand All @@ -36,22 +39,21 @@ optimize!(model)
for i = 1:result_count(model)
xi = value.(x; result=i)
yi = objective_value(model; result=i)
ri = reads(model; result=i)
println("f($xi) = $yi ($ri)")
println("f($xi) = $yi")
end
```

<!-- ## Citing QUBODrivers.jl
```tex
@software{QUBODrivers.jl:2023,
author = {Pedro Xavier and Pedro Ripper and Tiago Andrade and Joaquim Garcia and David Bernal},
title = {QUBODrivers.jl},
month = {apr},
year = {2023},
publisher = {Zenodo},
version = {v0.1.0},
doi = {10.5281/zenodo.6390515},
url = {https://doi.org/10.5281/zenodo.6390515}
author = {Pedro Xavier and Pedro Ripper and Tiago Andrade and Joaquim Garcia and David Bernal},
title = {QUBODrivers.jl},
month = {apr},
year = {2023},
publisher = {Zenodo},
version = {v0.1.0},
doi = {10.5281/zenodo.6390515},
url = {https://doi.org/10.5281/zenodo.6390515}
}
``` -->
Loading

2 comments on commit f517c0f

@pedromxavier
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/92106

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" f517c0f4f96dfadb3df6398fb95cde6017aa0613
git push origin v0.3.0

Please sign in to comment.