Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Numpy 2.x compatibility #75

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading