Skip to content

Commit b563182

Browse files
authored
Merge pull request #212 from Rust-Data-Science/wip-fix-0.12.0
Wip fix 0.12.0
2 parents c623f72 + 437b707 commit b563182

File tree

6 files changed

+68
-60
lines changed

6 files changed

+68
-60
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ All contributions are welcome. See `Developer Guide <https://github.com/tushushu
108108
:target: https://pypi.org/project/ulist/
109109
.. |License| image:: https://img.shields.io/github/license/tushushu/ulist
110110
:target: https://github.com/tushushu/ulist/blob/main/LICENSE
111-
.. |CI| image:: https://github.com/Rust-Data-Science/ulist/actions/workflows/main.yml/badge.svg?branch=0.11.0
111+
.. |CI| image:: https://github.com/Rust-Data-Science/ulist/actions/workflows/main.yml/badge.svg?branch=0.12.1
112112
:target: https://github.com/tushushu/ulist/actions/workflows/main.yml
113-
.. |doc| image:: https://github.com/Rust-Data-Science/ulist/actions/workflows/sphinx.yml/badge.svg?branch=0.11.0
113+
.. |doc| image:: https://github.com/Rust-Data-Science/ulist/actions/workflows/sphinx.yml/badge.svg?branch=0.12.1
114114
:target: https://github.com/tushushu/ulist/actions/workflows/sphinx.yml
115-
.. |publish| image:: https://github.com/tushushu/ulist/actions/workflows/publish.yml/badge.svg?branch=0.11.0
115+
.. |publish| image:: https://github.com/tushushu/ulist/actions/workflows/publish.yml/badge.svg?branch=0.12.1
116116
:target: https://github.com/tushushu/ulist/actions/workflows/publish.yml
117117
.. |code style| image:: https://img.shields.io/badge/style-flake8-blue
118118
:target: https://github.com/PyCQA/flake8

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'tushushu'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '0.11.0'
25+
release = '0.12.1'
2626

2727

2828
# -- General configuration ---------------------------------------------------

tests/test_exceptions.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
from pathlib import Path
12
from typing import Callable, Type
23

34
import pytest
5+
46
import ulist as ul
57

8+
here = Path(__file__).parent.resolve()
9+
610
_ARR1 = ul.from_seq(range(3), dtype='int')
711
_ARR1._values = [0, 1, 2] # type: ignore
812
_ARR2 = ul.from_seq([], dtype='int')
@@ -167,15 +171,15 @@ class _Foo:
167171
(
168172
ul.read_csv, # mismatch dtype
169173
{
170-
"path": "./test_csv/00_test_int.csv",
174+
"path": str(here / "test_csv/00_test_int.csv"),
171175
"schema": {"int32": "bool", "int64": "string"}
172176
},
173177
TypeError
174178
),
175179
(
176180
ul.read_csv, # mismatch dtype test case 2
177181
{
178-
"path": "./test_csv/04_test_nan.csv",
182+
"path": str(here / "test_csv/04_test_nan.csv"),
179183
"schema": {"int": "bool",
180184
"float": "int",
181185
"string": "float",
@@ -186,15 +190,15 @@ class _Foo:
186190
(
187191
ul.read_csv,
188192
{
189-
"path": "./non_exists_csv.csv",
193+
"path": str(here / "non_exists_csv.csv"),
190194
"schema": {"whatever": "int32"}
191195
},
192196
IOError
193197
),
194198
(
195199
ul.read_csv, # wrong dtype
196200
{
197-
"path": "./test_csv/04_test_nan.csv",
201+
"path": str(here / "test_csv/04_test_nan.csv"),
198202
"schema": {"int": "integer",
199203
"float": "double",
200204
"string": "str",

tests/test_inputs.py

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,76 @@
1+
from pathlib import Path
12
from typing import Callable, Dict, List
23

34
import pytest
4-
import ulist as ul
55
from ulist.utils import check_test_result
66

7+
import ulist as ul
8+
9+
here = Path(__file__).parent.resolve()
10+
711

812
@pytest.mark.parametrize(
913
"test_method, args, kwargs, expected_value",
1014
[
1115
(ul.read_csv, (), {
12-
"path": "./test_csv/00_test_int.csv",
13-
"schema": {"int32": "int32", "int64": "int64"}
14-
}, {
15-
"int32": [-2147483648, 2147483647, +2147483647],
16-
"int64": [-9223372036854774808,
17-
9223372036854774807,
18-
+9223372036854774807],
19-
}),
16+
"path": str(here / "test_csv/00_test_int.csv"),
17+
"schema": {"int32": "int32", "int64": "int64"}
18+
}, {
19+
"int32": [-2147483648, 2147483647, +2147483647],
20+
"int64": [-9223372036854774808,
21+
9223372036854774807,
22+
+9223372036854774807],
23+
}),
2024
(ul.read_csv, (), {
21-
"path": "./test_csv/01_test_float.csv",
22-
"schema": {"float32": "float32", "float64": "float64"}
23-
}, {
24-
# Precision problem in float32
25-
"float32": [3.14159, 0.314, 0.314],
26-
"float64": [3.14159, 31.4, 31.4]
27-
}),
25+
"path": str(here / "test_csv/01_test_float.csv"),
26+
"schema": {"float32": "float32", "float64": "float64"}
27+
}, {
28+
# Precision problem in float32
29+
"float32": [3.14159, 0.314, 0.314],
30+
"float64": [3.14159, 31.4, 31.4]
31+
}),
2832
(ul.read_csv, (), {
29-
"path": "./test_csv/02_test_bool.csv",
30-
"schema": {"bool": "bool"}
31-
}, {
32-
"bool": [True, False, True, False]
33-
}),
33+
"path": str(here / "test_csv/02_test_bool.csv"),
34+
"schema": {"bool": "bool"}
35+
}, {
36+
"bool": [True, False, True, False]
37+
}),
3438
(ul.read_csv, (), {
35-
"path": "./test_csv/03_test_string.csv",
36-
"schema": {"string": "string"}
37-
}, {
38-
"string": ["String", 'Hello, "World"', None, "Long\nString"]
39-
}),
39+
"path": str(here / "test_csv/03_test_string.csv"),
40+
"schema": {"string": "string"}
41+
}, {
42+
"string": ["String", 'Hello, "World"', None, "Long\nString"]
43+
}),
4044
(ul.read_csv, (), {
41-
"path": "./test_csv/04_test_nan.csv",
42-
"schema": {"int": "int",
43-
"float": "float",
44-
"string": "string",
45-
"bool": "bool"}
46-
}, {
47-
"int": [None, 2, 3, 4],
48-
"float": [1.0, None, 3.0, 4.0],
49-
"string": ["1", "2", None, "4"],
50-
"bool": [True, False, True, None]
51-
}),
45+
"path": str(here / "test_csv/04_test_nan.csv"),
46+
"schema": {"int": "int",
47+
"float": "float",
48+
"string": "string",
49+
"bool": "bool"}
50+
}, {
51+
"int": [None, 2, 3, 4],
52+
"float": [1.0, None, 3.0, 4.0],
53+
"string": ["1", "2", None, "4"],
54+
"bool": [True, False, True, None]
55+
}),
5256
(ul.read_csv, (), { # schema.len() < field.len()
53-
"path": "./test_csv/04_test_nan.csv",
54-
"schema": {"int": "int",
55-
"bool": "bool"}
56-
}, {
57-
"int": [None, 2, 3, 4],
58-
"bool": [True, False, True, None]
59-
}),
57+
"path": str(here / "test_csv/04_test_nan.csv"),
58+
"schema": {"int": "int",
59+
"bool": "bool"}
60+
}, {
61+
"int": [None, 2, 3, 4],
62+
"bool": [True, False, True, None]
63+
}),
6064
(ul.read_csv, (), { # schema.len() > field.len()
61-
"path": "./test_csv/02_test_bool.csv",
65+
"path": str(here / "test_csv/02_test_bool.csv"),
6266
"schema": {"foo": "int",
6367
"bar": "bool",
6468
"bool": "bool"}
65-
}, {
66-
"foo": [],
67-
"bar": [],
68-
"bool": [True, False, True, False]
69-
})
69+
}, {
70+
"foo": [],
71+
"bar": [],
72+
"bool": [True, False, True, False]
73+
})
7074
],
7175
)
7276
def test_constructors(

ulist/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ulist"
3-
version = "0.11.0"
3+
version = "0.12.1"
44
authors = ["tushushu"]
55
edition = "2018"
66

ulist/python/ulist/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .io import read_csv # noqa:F401
55
from .ulist import IndexList # noqa:F401
66

7-
__version__ = "0.11.0"
7+
__version__ = "0.12.1"

0 commit comments

Comments
 (0)