Skip to content

Commit

Permalink
Release 0.1.1 (#11)
Browse files Browse the repository at this point in the history
* Bugfix reading static file in list_names

* Update version
  • Loading branch information
leonlan authored Jul 14, 2022
1 parent d15655f commit 8a10384
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cvrplib/list_names.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib.resources as pkg_resource
from functools import lru_cache
from typing import Optional

Expand Down Expand Up @@ -44,7 +45,7 @@ def list_names(

@lru_cache()
def _parse_instance_data():
with open("cvrplib/instance_data.csv", "r") as fi:
instances = [line.strip().split(",") for line in fi.readlines()]
fi = pkg_resource.read_text(__package__, "instance_data.csv")
instances = [line.strip().split(",") for line in fi.split()]

return [{"name": inst[0], "n_customers": int(inst[1])} for inst in instances]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cvrplib"
version = "1.0.0"
version = "0.1.1"
description = "Python library for reading and downloading CVRPLIB instances."
authors = ["Leon Lan <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 8a10384

Please sign in to comment.