Skip to main content

A scientific computing toolbox

Project description

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

Contributions

Python bindings were added for both modules, allowing for seamless use of C++ functions in python. On the ohter 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.

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 easily be built using setuptools: Run the following commands in the relevant folder:

python3 setup.py build_ext

One can also 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.


cmake -B build -DCMAKE_BUILD_TYPE=Debug -DINTERPOLATION_MODULE=ON 
cd build
make

This compiles a Debug build referring to the default data directory in each of the folders, including the InterpolateWrapper module as a custom visitor. Files will contain a DATA_DIR variable for referencing the directory in code.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aptoolbox-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

APToolBox-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file aptoolbox-1.0.0.tar.gz.

File metadata

  • Download URL: aptoolbox-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for aptoolbox-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b9c243491420f4a2f0ff40b86b5b0dba91e72968bd4df51a18065060f390bb3f
MD5 89ddae79f900929d531ef59552f592b3
BLAKE2b-256 7f598bf922d53fe4b3a93ac44cd32227992a4cdebef4545108de46cb72f5f654

See more details on using hashes here.

File details

Details for the file APToolBox-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: APToolBox-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for APToolBox-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 feabe53c39fbff19da8b43113658fde93ca1a961e73547be52b25d4a29fecf72
MD5 1c4ab53274dcc3ce9e3b7b7126be5a2e
BLAKE2b-256 bed43a8cf7574f5eae33c51beb50a724f2c0516405fc559c25a262246cdc5a96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page