mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-10 11:28:51 -06:00
MIPLearn v0.3
This commit is contained in:
19
tests/extractors/test_dummy.py
Normal file
19
tests/extractors/test_dummy.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
||||
# Copyright (C) 2020-2022, UChicago Argonne, LLC. All rights reserved.
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
from typing import List
|
||||
|
||||
from miplearn.extractors.dummy import DummyExtractor
|
||||
from miplearn.h5 import H5File
|
||||
|
||||
|
||||
def test_dummy(multiknapsack_h5: List[str]) -> None:
|
||||
ext = DummyExtractor()
|
||||
with H5File(multiknapsack_h5[0], "r") as h5:
|
||||
x = ext.get_instance_features(h5)
|
||||
assert x.shape == (1,)
|
||||
x = ext.get_var_features(h5)
|
||||
assert x.shape == (100, 1)
|
||||
x = ext.get_constr_features(h5)
|
||||
assert x.shape == (4, 1)
|
||||
Reference in New Issue
Block a user