Skip to content

Commit c6fd355

Browse files
authored
Update README.md [no ci]
1 parent 76b345f commit c6fd355

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,42 @@
77
<br>
88
</div>
99

10-
## Introduction
11-
12-
This package provides a wrapper around [QUBOLibData.jl](https://github.com/pedromxavier/QUBOLibData.jl)'s artifact to easily access QUBO / Ising instances.
13-
Instances are retrieved as model objects from [QUBOTools.jl](https://github.com/psrenergy/QUBOTools.jl).
14-
1510
## Getting Started
1611

1712
### Installation
1813

1914
```julia
20-
julia> import Pkg; Pkg.add(url="https://github.com/pedromxavier/QUBOLib.jl")
15+
julia> import Pkg; Pkg.add(url="https://github.com/JuliaQUBO/QUBOLib.jl")
2116

2217
julia> using QUBOLib
2318
```
2419

2520
### Example
2621

2722
```julia
28-
julia> coll = first(list_collections()) # get code of the first registered collection
29-
30-
julia> inst = first(list_instances(coll)) # get code of the first instance from that collection
23+
julia> using QUBOLib
3124

32-
julia> model = load_instance(coll, inst) # retrieve QUBOTools model
25+
julia> QUBOLib.access() do index
26+
println(index)
27+
end
3328
```
3429

3530
## Accessing the instance index database
3631

3732
> **Warning**
3833
> This requires [SQLite.jl](https://github.com/JuliaDatabases/SQLite.jl) and [DataFrames.jl](https://github.com/JuliaData/DataFrames.jl) to be installed.
3934
40-
4135
```julia
42-
julia> using SQLite, DataFrames
36+
julia> using QUBOLib
4337

44-
julia> db = QUBOLib.database()
38+
julia> using SQLite, DataFrames
4539

46-
julia> df = DBInterface.execute(
47-
db,
48-
"SELECT collection, instance FROM instances WHERE size BETWEEN 100 AND 200;"
49-
) |> DataFrame
40+
julia> models = QUBOLib.access() do index
41+
df = DBInterface.execute(
42+
QUBOLib.database(index),
43+
"SELECT instance FROM Instances WHERE size BETWEEN 100 AND 200;"
44+
) |> DataFrame
5045

51-
julia> models = [
52-
load_instance(coll, inst)
53-
for (coll, inst) in zip(df[!, :collection], df[!, :instance])
54-
]
46+
return [load_instance(index, i) for i in df[!, :instance]]
47+
end
5548
```

0 commit comments

Comments
 (0)