File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1+ import importlib .resources as pkg_resource
12from functools import lru_cache
23from typing import Optional
34
@@ -44,7 +45,7 @@ def list_names(
4445
4546@lru_cache ()
4647def _parse_instance_data ():
47- with open ( "cvrplib/ instance_data.csv", "r" ) as fi :
48- instances = [line .strip ().split ("," ) for line in fi .readlines ()]
48+ fi = pkg_resource . read_text ( __package__ , " instance_data.csv")
49+ instances = [line .strip ().split ("," ) for line in fi .split ()]
4950
5051 return [{"name" : inst [0 ], "n_customers" : int (inst [1 ])} for inst in instances ]
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " cvrplib"
3- version = " 1.0.0 "
3+ version = " 0.1.1 "
44description = " Python library for reading and downloading CVRPLIB instances."
55authors = [" Leon Lan <leon.lanyidong@gmail.com>" ]
66license = " MIT"
You can’t perform that action at this time.
0 commit comments