Skip to content

Commit

Permalink
update test and test matrix for pandas versions (#16)
Browse files Browse the repository at this point in the history
* update test and test matrix for pandas versions

* sort explicitly in `as_pandas` during join
  • Loading branch information
CagtayFabry authored Apr 13, 2023
1 parent 201c07d commit c4be348
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
matrix:
os: [ubuntu-latest]
py: ['3.8', '3.9', '3.10', '3.11']
pandas: [ '1.*' ]
include:
- os: ubuntu-latest
py: '3.10'
pandas: '1.3'
- os: ubuntu-latest
py: '3.10'
pandas: '1.4'
steps:
- uses: actions/checkout@v3
with:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# pytcs

## unreleased
## v0.1.2

### added

- add support for reading `StringIO` and `BytesIO` #10

### fixed

- explicitly sort index in `ScopeFile.as_pandas` #16

## v0.1.1

initial release with basic functions
Expand Down
2 changes: 1 addition & 1 deletion pytcs/pytcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def as_pandas(

_list = [v for v in _dict.values() if not v.empty]

df = pd.DataFrame().join(_list, how="outer")
df = pd.DataFrame().join(_list, how="outer", sort=True)

if time_fmt == "timedelta":
df.index = pd.TimedeltaIndex((df.index * 1e6).astype(np.int64))
Expand Down
4 changes: 3 additions & 1 deletion tests/test_scope_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def test_scope_file(filenames, backend, native_dtypes, use_buffer):
)
assert all([type(v) == np.ndarray for v in sf._data.values()])

str(sf)
# monotonic time
for c in sf:
assert np.allclose(np.diff(sf[c].time), sf[c].sample_time)

@staticmethod
@pytest.mark.parametrize("backend", ["pandas"])
Expand Down

0 comments on commit c4be348

Please sign in to comment.