mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Reorganize directories
This commit is contained in:
15
Makefile
15
Makefile
@@ -2,13 +2,24 @@ PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG
|
||||
|
||||
all: docs test
|
||||
|
||||
develop:
|
||||
cd src/python && python setup.py develop
|
||||
julia --project=src/julia -e "using Pkg; Pkg.instantiate()"
|
||||
|
||||
install:
|
||||
cd src/python && python setup.py install
|
||||
julia --project=src/julia -e "using Pkg; Pkg.instantiate()"
|
||||
|
||||
uninstall:
|
||||
pip uninstall miplearn
|
||||
|
||||
docs:
|
||||
mkdocs build
|
||||
|
||||
test:
|
||||
pytest $(PYTEST_ARGS)
|
||||
cd src/python && pytest $(PYTEST_ARGS)
|
||||
|
||||
test-watch:
|
||||
pytest-watch -- $(PYTEST_ARGS)
|
||||
cd src/python && pytest-watch -- $(PYTEST_ARGS)
|
||||
|
||||
.PHONY: test test-watch docs
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../benchmark/knapsack/ChallengeA/performance.png
|
||||
@@ -1 +0,0 @@
|
||||
../../benchmark/stab/ChallengeA/performance.png
|
||||
@@ -1 +0,0 @@
|
||||
../../benchmark/tsp/ChallengeA/performance.png
|
||||
@@ -18,7 +18,7 @@ markdown_extensions:
|
||||
extra_javascript:
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
||||
- js/mathjax.js
|
||||
docs_dir: docs-src
|
||||
docs_dir: src/docs
|
||||
site_dir: docs
|
||||
extra_css:
|
||||
- "css/custom.css"
|
||||
1
src/docs/figures/benchmark_knapsack_a.png
Symbolic link
1
src/docs/figures/benchmark_knapsack_a.png
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../benchmark/knapsack/ChallengeA/performance.png
|
||||
1
src/docs/figures/benchmark_stab_a.png
Symbolic link
1
src/docs/figures/benchmark_stab_a.png
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../benchmark/stab/ChallengeA/performance.png
|
||||
1
src/docs/figures/benchmark_tsp_a.png
Symbolic link
1
src/docs/figures/benchmark_tsp_a.png
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../benchmark/tsp/ChallengeA/performance.png
|
||||
@@ -3,14 +3,26 @@
|
||||
|
||||
### Installation
|
||||
|
||||
The package is currently available for Python and Pyomo. It can be installed as follows:
|
||||
MIPLearn is mainly written in Python, with some components written in Julia. For this
|
||||
reason, both Python 3.6+ and Julia 1.3+ are required. A mixed-integer solver is also required, and
|
||||
its Python bindings must be properly installed. Currently supported solvers include CPLEX and
|
||||
Gurobi. To install MIPLearn, run the following commands:
|
||||
|
||||
```bash
|
||||
pip install git+ssh://git@github.com/ANL-CEEESA/MIPLearn.git
|
||||
git clone https://github.com/ANL-CEEESA/MIPLearn.git
|
||||
cd MIPLearn
|
||||
make install
|
||||
```
|
||||
|
||||
A Julia + JuMP version of the package is planned.
|
||||
After installation, the package `miplearn` should become available to Python. It can be imported
|
||||
as follows:
|
||||
|
||||
```python
|
||||
import miplearn
|
||||
```
|
||||
|
||||
!!! note
|
||||
To install MIPLearn in another Python environment, switch to that enviroment before running `make install`. To install the package in development mode, run `make develop` instead.
|
||||
|
||||
### Using `LearningSolver`
|
||||
|
||||
119
src/julia/Manifest.toml
Normal file
119
src/julia/Manifest.toml
Normal file
@@ -0,0 +1,119 @@
|
||||
# This file is machine-generated - editing it directly is not advised
|
||||
|
||||
[[Base64]]
|
||||
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
|
||||
[[CEnum]]
|
||||
git-tree-sha1 = "62847acab40e6855a9b5905ccb99c2b5cf6b3ebb"
|
||||
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
|
||||
version = "0.2.0"
|
||||
|
||||
[[CPLEXW]]
|
||||
deps = ["CEnum", "Libdl"]
|
||||
git-tree-sha1 = "ebad297748ee2a12cc13b5fb07f9bbfa8a900494"
|
||||
repo-rev = "master"
|
||||
repo-url = "git@github.com:iSoron/CPLEXW.git"
|
||||
uuid = "cfecb002-79c2-11e9-35be-cb59aa640f85"
|
||||
version = "1.0.0"
|
||||
|
||||
[[CodeTracking]]
|
||||
deps = ["InteractiveUtils", "UUIDs"]
|
||||
git-tree-sha1 = "0becdab7e6fbbcb7b88d8de5b72e5bb2f28239f3"
|
||||
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
|
||||
version = "0.5.8"
|
||||
|
||||
[[Dates]]
|
||||
deps = ["Printf"]
|
||||
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||
|
||||
[[Distributed]]
|
||||
deps = ["Random", "Serialization", "Sockets"]
|
||||
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
||||
|
||||
[[FileWatching]]
|
||||
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
|
||||
|
||||
[[InteractiveUtils]]
|
||||
deps = ["Markdown"]
|
||||
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
|
||||
|
||||
[[JuliaInterpreter]]
|
||||
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
|
||||
git-tree-sha1 = "cf43000752f15c92bef4a080966810de886f3560"
|
||||
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
|
||||
version = "0.7.6"
|
||||
|
||||
[[LibGit2]]
|
||||
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
|
||||
|
||||
[[Libdl]]
|
||||
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
|
||||
|
||||
[[Logging]]
|
||||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
|
||||
[[LoweredCodeUtils]]
|
||||
deps = ["JuliaInterpreter"]
|
||||
git-tree-sha1 = "b416a30717e9109fffd4d9869f2f962b5dca3162"
|
||||
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
|
||||
version = "0.4.2"
|
||||
|
||||
[[Markdown]]
|
||||
deps = ["Base64"]
|
||||
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
|
||||
|
||||
[[OrderedCollections]]
|
||||
deps = ["Random", "Serialization", "Test"]
|
||||
git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1"
|
||||
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
|
||||
version = "1.1.0"
|
||||
|
||||
[[Pkg]]
|
||||
deps = ["Dates", "LibGit2", "Libdl", "Logging", "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"
|
||||
|
||||
[[Revise]]
|
||||
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "UUIDs", "Unicode"]
|
||||
git-tree-sha1 = "2ecbd19f31a934b035bfc38036d5f7ac575d0878"
|
||||
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
|
||||
version = "2.5.0"
|
||||
|
||||
[[SHA]]
|
||||
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
||||
|
||||
[[Serialization]]
|
||||
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
|
||||
|
||||
[[Sockets]]
|
||||
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
|
||||
|
||||
[[Test]]
|
||||
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
|
||||
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[[TinyBnB]]
|
||||
deps = ["CPLEXW", "Printf", "Random", "Revise", "Test"]
|
||||
git-tree-sha1 = "921ad42ac9dd4d44e42941eb63c59bcb50f30b6f"
|
||||
repo-rev = "master"
|
||||
repo-url = "git@github.com:iSoron/TinyBnB.jl.git"
|
||||
uuid = "1b2a1171-e557-4eeb-a4d6-6c23d7e94fcd"
|
||||
version = "1.1.0"
|
||||
|
||||
[[UUIDs]]
|
||||
deps = ["Random", "SHA"]
|
||||
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||
|
||||
[[Unicode]]
|
||||
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
||||
8
src/julia/Project.toml
Normal file
8
src/julia/Project.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
name = "MIPLearn"
|
||||
uuid = "2b1277c3-b477-4c49-a15e-7ba350325c68"
|
||||
authors = ["Alinson S Xavier <git@axavier.org>"]
|
||||
version = "0.1.0"
|
||||
|
||||
[deps]
|
||||
CPLEXW = "cfecb002-79c2-11e9-35be-cb59aa640f85"
|
||||
TinyBnB = "1b2a1171-e557-4eeb-a4d6-6c23d7e94fcd"
|
||||
5
src/julia/src/MIPLearn.jl
Normal file
5
src/julia/src/MIPLearn.jl
Normal file
@@ -0,0 +1,5 @@
|
||||
module MIPLearn
|
||||
|
||||
greet() = print("Hello World!")
|
||||
|
||||
end # module
|
||||
0
src/julia/test/runtests.jl
Normal file
0
src/julia/test/runtests.jl
Normal file
@@ -57,9 +57,11 @@ class BranchPriorityComponent(Component):
|
||||
|
||||
# Run Julia script
|
||||
src_dirname = os.path.dirname(os.path.realpath(__file__))
|
||||
julia_dirname = "%s/../../../julia" % src_dirname
|
||||
priority_file = tempfile.NamedTemporaryFile(mode="r")
|
||||
subprocess.run(["julia",
|
||||
"%s/branching.jl" % src_dirname,
|
||||
"--project=%s" % julia_dirname,
|
||||
"%s/src/branching.jl" % julia_dirname,
|
||||
lp_file.name,
|
||||
priority_file.name,
|
||||
str(self.node_limit),
|
||||
Reference in New Issue
Block a user