mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Reorganize instance package
This commit is contained in:
3
tests/instance/__init__.py
Normal file
3
tests/instance/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# 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.
|
||||
16
tests/instance/test_picklegz.py
Normal file
16
tests/instance/test_picklegz.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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
|
||||
from tests.fixtures.knapsack import get_knapsack_instance
|
||||
|
||||
|
||||
def test_usage() -> None:
|
||||
original = get_knapsack_instance(GurobiSolver())
|
||||
file = tempfile.NamedTemporaryFile()
|
||||
write_pickle_gz(original, file.name)
|
||||
pickled = PickleGzInstance(file.name)
|
||||
assert pickled.to_model() is not None
|
||||
Reference in New Issue
Block a user