Coverage for moptipyapps / qap / qaplib / __init__.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-11 04:40 +0000

1""" 

2QAPLIB -- A Quadratic Assignment Problem Library. 

3 

41. QAPLIB - A Quadratic Assignment Problem Library. The Websites 

5 <https://qaplib.mgi.polymtl.ca/> (updated 2018) and 

6 <https://coral.ise.lehigh.edu/data-sets/qaplib/> (updated 2011), including 

7 the benchmark instances, on visited 2023-10-21. 

82. Rainer E. Burkard, Stefan E. Karisch, and Franz Rendl. QAPLIB - A Quadratic 

9 Assignment Problem Library. Journal of Global Optimization. 10:391-403, 

10 1997. https://doi.org/10.1023/A:1008293323270. 

11""" 

12 

13from importlib import resources # nosem 

14from typing import TextIO, cast 

15 

16from pycommons.io.path import UTF8 

17 

18 

19def open_resource_stream(file_name: str) -> TextIO: 

20 """ 

21 Open a QAPLib resource stream. 

22 

23 :param file_name: the file name of the resource 

24 :return: the stream 

25 """ 

26 return cast("TextIO", resources.files(__package__).joinpath( 

27 file_name).open("r", encoding=UTF8))