Coverage for moptipyapps / spoc / spoc_4 / challenge_1 / beginner / data / __init__.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-03 04:37 +0000

1""" 

2The Luna Tomato Logistics beginner problem data. 

3 

4See <https://github.com/esa/SpOC4> for the original source of the data. 

5""" 

6 

7from importlib import resources # nosem # noqa: RUF067 

8from typing import TextIO, cast # noqa: RUF067 

9 

10from pycommons.io.path import UTF8 # noqa: RUF067 

11 

12 

13def open_resource_stream(file_name: str) -> TextIO: # noqa: RUF067 

14 """ 

15 Open a matching resource stream. 

16 

17 :param file_name: the file name of the resource 

18 :return: the stream 

19 """ 

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

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