File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change
1
+ import importlib .resources as pkg_resource
1
2
from functools import lru_cache
2
3
from typing import Optional
3
4
@@ -44,7 +45,7 @@ def list_names(
44
45
45
46
@lru_cache ()
46
47
def _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 ()]
49
50
50
51
return [{"name" : inst [0 ], "n_customers" : int (inst [1 ])} for inst in instances ]
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " cvrplib"
3
- version = " 1.0.0 "
3
+ version = " 0.1.1 "
4
4
description = " Python library for reading and downloading CVRPLIB instances."
5
5
authors = [
" Leon Lan <[email protected] >" ]
6
6
license = " MIT"
You can’t perform that action at this time.
0 commit comments