mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-08 02:18:51 -06:00
17 lines
645 B
Python
17 lines
645 B
Python
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
|
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
|
|
# Released under the modified BSD license. See COPYING.md for more details.
|
|
import tempfile
|
|
|
|
from miplearn.instance.picklegz import write_pickle_gz, PickleGzInstance
|
|
from miplearn.solvers.gurobi import GurobiSolver
|
|
|
|
|
|
def test_usage() -> None:
|
|
original = GurobiSolver().build_test_instance_knapsack()
|
|
file = tempfile.NamedTemporaryFile()
|
|
write_pickle_gz(original, file.name)
|
|
pickled = PickleGzInstance(file.name)
|
|
pickled.load()
|
|
assert pickled.to_model() is not None
|