Skip to content

Commit

Permalink
Fix Numpy 2.x compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Oct 21, 2024
1 parent 394bd5b commit 418deec
Show file tree
Hide file tree
Showing 6 changed files with 1,150 additions and 1,126 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
cache: "poetry"
- name: Build project for distribution
run: poetry build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
Expand Down
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions fcsparser/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,13 @@ def read_data(self, file_handle):
##
# Convert to native byte order
# This is needed for working with pandas data structures
native_code = "<" if (sys.byteorder == "little") else ">"
sys_is_le = sys.byteorder == 'little'
native_code = '<' if sys_is_le else '>'
swapped_code = '>' if sys_is_le else '<'
if endian != native_code:
# swaps the actual bytes and also the endianness
data = data.byteswap().newbyteorder()
# updated to be numpy>= 2.0 compliant
data = data.view(data.dtype.newbyteorder(swapped_code)).byteswap()

# Mask off high bits if integer type data
if text["$DATATYPE"] == "I":
Expand Down
Loading

0 comments on commit 418deec

Please sign in to comment.