An automatic differentiation package
Project description
Welcome to PyADBCXY
PyADBCXY is an automatic differentiation software package that can calculate the values and derivatives of complex functions while maintaining high levels of accuracy.
Contributors
Group Name: cs107-BCXY
Group Number: 12
Group Members:
- Charlie Harrington, Harvard University, charlesharrington@g.harvard.edu
- Bowen Zhu, Harvard University, bszhu@fas.hardvard.edu
- Yaxin Lei, Harvard University, yaxin_lei@g.harvard.edu
- Xiang Bai, Harvard University, xbai@hsph.harvard.edu
Installation
Install the package with pip:
pip install pyadbcxy
Then you can run a simple example such as
import pyadbcxy as ad
x = ad.Variable(3) # instantiate x variable
y = ad.Variable(4., 5.) # instantiate y variable
f = lambda x, y: x + y # define function of interest
fmode = ad.Forward(f, (x, y)) # instantiate forward mode
fmode.calculate() # evaluate function at x and y
print(fmode.value) # print value of f at x and y
print(fmode.derivative) # print derivative of f and x and y
For further details on package usage as well as the math behind it, please see the documentation.
For developers
To install the package for further development, clone the repository to your machine:
git clone https://github.com/cs107-BCXY/cs107-FinalProject.git
Then, move into the repository and install the package dependencies
cd cs107-FinalProject
pip install -r requirements.txt
Testing
To run the tests, you can execute
python -m unittest discover -s tests -p 'test_*.py'
Alternatively, you can run the test driver script. The default testing framework is unittest and can be run with:
bash tests/run_tests.sh
If you'd like to execute the tests using pytest, simply specify in the command:
bash tests/run_tests.sh pytest
Finally, if you'd like to see the code coverage report, you can do so with the coverage keyword:
bash tests/run_tests.sh coverage
License
This project is licensed under the MIT License - see the LICENSE for more details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyadbcxy-0.0.3.tar.gz.
File metadata
- Download URL: pyadbcxy-0.0.3.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5fe2c5ef5697748883918984e96850fe5ef25d4c42f8cdff53e0dad14859078
|
|
| MD5 |
92b5b634f7359eeaa34263aca3ca849c
|
|
| BLAKE2b-256 |
6ff82d8e16ef576331a4a7307399db51b39181e4ddffb896e5e06f3511e9a14c
|
File details
Details for the file pyadbcxy-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pyadbcxy-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
348c0d3c043cfa126d4af37710f921493ed79e64a9c11da521ebd50649f19bbf
|
|
| MD5 |
dd89324ae8c666eadbe7900b9d6def67
|
|
| BLAKE2b-256 |
40c9a0d0cf34d7e7d1e2f40f29a6be4b38677ee6555f07c9f0b78801d764eeba
|