Skip to content

Commit 670af58

Browse files
authored
Merge pull request #1 from numpy/main
2 parents c64b152 + 1111a86 commit 670af58

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ jobs:
8181
then
8282
rm -r build
8383
fi
84-
meson setup build -Db_sanitize=address,undefined
84+
meson setup build
8585
python -m build --no-isolation --wheel -Cbuilddir=build --config-setting='compile-args=-v' -Csetup-args="-Dbuildtype=debug"
8686
find ./dist/*.whl | xargs python -m pip install
8787
- name: Run stringdtype tests
8888
working-directory: stringdtype
8989
run: |
90-
ASAN_OPTIONS=detect_leaks=false LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/11/libasan.so pytest -s -vvv --color=yes
90+
pytest -s -vvv --color=yes
9191
pip uninstall -y pandas
92-
ASAN_OPTIONS=detect_leaks=false LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/11/libasan.so pytest -s -vvv --color=yes
92+
pytest -s -vvv --color=yes

quaddtype/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,39 @@ np.array([1,2,3], dtype=QuadPrecDType("sleef"))
2020
# using longdouble backend
2121
np.array([1,2,3], dtype=QuadPrecDType("longdouble"))
2222
```
23+
24+
## Install from source
25+
26+
The code needs the quad precision pieces of the sleef library, which
27+
is not available on most systems by default, so we have to generate
28+
that first. The below assumes one has the required pieces to build
29+
sleef (cmake and libmpfr-dev), and that one is in the package
30+
directory locally.
31+
32+
```
33+
git clone https://github.com/shibatch/sleef.git
34+
cd sleef
35+
cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
36+
cmake --build build/ --clean-first -j
37+
cd ..
38+
```
39+
40+
In principle, one can now install this system-wide, but easier would
41+
seem to use the version that was just created, as follows:
42+
```
43+
export SLEEF_DIR=$PWD/sleef/build
44+
export LIBRARY_PATH=$SLEEF_DIR/lib
45+
export C_INCLUDE_PATH=$SLEEF_DIR/include
46+
export CPLUS_INCLUDE_PATH=$SLEEF_DIR/include
47+
python3 -m venv temp
48+
source temp/bin/activate
49+
pip install meson-python numpy pytest
50+
pip install -e . -v --no-build-isolation
51+
export LD_LIBRARY_PATH=$SLEEF_DIR/lib
52+
```
53+
54+
Here, we created an editable install on purpose, so one can just work
55+
from the package directory if needed, e.g., to run the tests with,
56+
```
57+
python -m pytest
58+
```

quaddtype/tests/test_quaddtype.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ def test_unary_ops(op, val, expected):
7272

7373

7474
def test_nan_and_inf():
75-
assert (QuadPrecision("nan") != QuadPrecision("nan")) == (
76-
QuadPrecision("nan") == QuadPrecision("nan"))
75+
# NaN should not equal itself
76+
assert QuadPrecision("nan") != QuadPrecision("nan")
77+
78+
# Test infinity comparisons
7779
assert QuadPrecision("inf") > QuadPrecision("1e1000")
7880
assert QuadPrecision("-inf") < QuadPrecision("-1e1000")
7981

0 commit comments

Comments
 (0)