-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add casting from `FlexFloat` objects to `float` * Update `README.md` * ci: Add build and tests
- Loading branch information
Showing
7 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2024 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Test PyFlexFloat library | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Build and test package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Build | ||
run: pip install . | ||
- name: Install requirements | ||
run: pip install -r requirements.txt | ||
- name: Test | ||
run: ./test/test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
## PyFlexFloat | ||
|
||
A Python wrapper around OPRECOMP's [FlexFloat](https://github.com/oprecomp/flexfloat) library. | ||
A Python wrapper around OPRECOMP's [FlexFloat](https://github.com/oprecomp/flexfloat) library, enabling arbitrary precision floating-point arithmetic emulation in Python. | ||
|
||
## Installation | ||
|
||
Clone the repository: | ||
` | ||
git clone https://github.com/colluca/pyflexfloat.git | ||
` | ||
Simply install via pip: | ||
``` | ||
pip install pyflexfloat | ||
``` | ||
|
||
Enter the local repository folder: | ||
` | ||
cd pyflexfloat | ||
` | ||
For developers, you can create an editable installation, to test your changes to the source code: | ||
``` | ||
pip install -e . | ||
``` | ||
|
||
Install in your active Python environment: | ||
` | ||
pip install . | ||
` | ||
|
||
Test installation: | ||
` | ||
Test the installation: | ||
``` | ||
./test/test.py | ||
` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,11 @@ | |
# | ||
# Author: Luca Colagrande <[email protected]> | ||
import setuptools | ||
import cmake_build_extension | ||
from setuptools.command.build import build | ||
import subprocess | ||
from pathlib import Path | ||
|
||
|
||
class CMakeBuild(setuptools.command.build.build): | ||
class CMakeBuild(build): | ||
|
||
def run(self): | ||
# Required to generate "flexfloat_config.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters