ADVANCED PROGRAMMING HOMEWORK 3: Extension of the scientific computing Toolbox
All files and folders for the third assignment of the Advanced Programming course at UniTS, A.2024/45.
Group Members
- Giovanni Billo: billogiova@gmail.com
- Tommaso Piscitelli: s309639@ds.units.it
Project Description
Python bindings were added for both modules, allowing for seamless use of C++ functions in python. On the other hand, less performance-intensive functions like those generating random vectors to generate a graph of interpolation errors were implemented in oython.
Some functionalities were added and extended:
- Better structure, modularization and code organisation.
- Possibility to build the entire unified ToolBox with setuptools.
- more getter and setter methods for DataFrameWrapper
- python function with C++ callback to reduce the size of the dataframe
- Enhance functor which polimorphically allows classes from both modules to use some magic methods and plot data.
- Easy installation with
pip
Individual contributions
Giovanni Billo
- Python bindings for the DataFrameWrapper module
- improved project structure
- added methods and functionalities to DataFrameWrapper in both languages
- Enhance functor
- comparison file
pippackaging
Tommaso Piscitelli
- Python bindings for the DataFrameWrapper module
- Interpolation part of the Enhance functor
- python tests for interpolation
Performance comparison
The file comparison.py leverages decorators and the functor Compare() to time the speed of our C++ bindings against some popular python libraries like NumPy and SciPy. As the DataFrame, our implementation lags behind pandas when it also has to format the file the right way. However, once a file is in the right format, it performs just as good and sometimes even slightly faster than Pandas.
This is also the case with the InterpolateWrapper module, which is tested against SciPy implementations of the linear, Lahgrange and Cubic splines.
Testing
All tests available for the C++ module were implemented also for python bindings. There is the possibility to enable automated testing frameworks when building the project (see BUILD INSTRUCTIONS below)
BUILD INSTRUCTIONS
The library can be directly installed via pip from here:
pip install APToolBox
Various other build options are also available:
- using setuptools, after cloning the repository, run the following commands in the main folder:
python3 setup.py build_ext
It is also possible to enable continuous integration by enabling automated tests via pytest and pytest-watch:
python3 setup.py build_ext watch_tests
This setup will run all of the tests again each time a change is made in any part of the code, ensuring continuous integration and early catching of bugs.
- using Cmake:
cmake -B build
You can find some usage examples here.
Metadata
Release files for APToolBox 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aptoolbox-1.1.0.tar.gz | 2.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| APToolBox-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.9 MB
Release files / aptoolbox-1.1.0.tar.gz
| Download URL | aptoolbox-1.1.0.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbae458fc7f385cc7f918ca0533d03820eee39fb3fa74828041386f6ed147bac
|
|
BLAKE2b-256 checksum How to use checksums |
31e9355aaf5f9c247ef24a0f69ae1e53d2333379ca8c41ef5c51d7ca05fe0d89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.12
|
Release files / APToolBox-1.1.0-py3-none-any.whl
| Download URL | APToolBox-1.1.0-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16e0b8588a3f31c9a5bdc463bf5c220f6163752ddf7e64c3ef539f22267bc419
|
|
BLAKE2b-256 checksum How to use checksums |
df0492dab2bd09aca8fc146a4dac01f5d14c40b6270a7ffac74073b18c5632b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.12
|