Coverage for moptipyapps / ttp / robinx / __init__.py: 100%

5 statements  

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

1""" 

2The `RobinX` example data for the Traveling Tournament Problem (TTP). 

3 

4David Van Bulck of the Sports Scheduling Research group, part of the 

5Faculty of Economics and Business Administration at Ghent University, Belgium, 

6maintains "RobinX: An XML-driven Classification for Round-Robin Sports 

7Timetabling", a set of benchmark data instances and results of the TTP. 

8Here we include some of these TTP instances into our package. 

9 

10This package does not offer anything useful except for holding the TTP 

11files. You can find the documentation and actual classes for solving and 

12playing around with the TSP in package :mod:`~moptipyapps.ttp`. 

13 

14The original data of `robinX` can be found at 

15<https://robinxval.ugent.be/RobinX/travelRepo.php> 

16""" 

17 

18from importlib import resources # nosem 

19from typing import TextIO, cast 

20 

21from pycommons.io.path import UTF8 

22 

23 

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

25 """ 

26 Open a RobinX resource stream. 

27 

28 :param file_name: the file name of the resource 

29 :return: the stream 

30 """ 

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

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