Skip to content

Commit 8a10384

Browse files
authored
Release 0.1.1 (#11)
* Bugfix reading static file in list_names * Update version
1 parent d15655f commit 8a10384

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cvrplib/list_names.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import importlib.resources as pkg_resource
12
from functools import lru_cache
23
from typing import Optional
34

@@ -44,7 +45,7 @@ def list_names(
4445

4546
@lru_cache()
4647
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()]
4950

5051
return [{"name": inst[0], "n_customers": int(inst[1])} for inst in instances]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cvrplib"
3-
version = "1.0.0"
3+
version = "0.1.1"
44
description = "Python library for reading and downloading CVRPLIB instances."
55
authors = ["Leon Lan <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)