Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitshift and Complexity Testing #31

Merged
merged 7 commits into from
Apr 12, 2024

Conversation

AzeezIsh
Copy link
Contributor

@AzeezIsh AzeezIsh commented Mar 19, 2024

This PR introduces a suite of unit tests for arithmetic_operations.py and complex_operations.py located within the within the mathematical functions directory. The primary functions in this file are based around bitshifts, creating complex arrays, conjugates and imaginary/real numbers.

Standard Operations and Data Handling Tests
Complex Operations for Supported Data Types: The tests confirm the ability to perform complex operations across all supported data types, with a particular focus on floating-point precision variants such as 32-bit floats as these were the only compatible data types for complex operations. Each operation's success across varied input shapes—from scalar to four-dimensional arrays—shows the library's robust handling of complex data structures.
Error Handling for Unsupported Data Types: Tests are important for ensuring stability, as they check that attempting complex operations with unsupported data types (notably 64-bit floats and complex numbers) correctly raises runtime errors. Prevents undefined behavior and reinforces the library's reliability.

Parameter Variability across Operations
Bit Shifting Across Data Types: Testing extends to bit shifting operations (both left and right shifts) across various data types, underlining the library's capability to manipulate bits effectively within the supported numerical range. The attention to diverse data types, including integer and boolean, highlights the library's versatility.
Handling Varying Input Sizes and Shapes: The library's adaptability is further demonstrated through tests that evaluate bit shifting operations with different input sizes and shapes. These tests affirm that the library can accurately process data arrays of various dimensions, reinforcing its utility in handling real-world data complexities.
Varying Shift Amounts: By experimenting with different shift amounts from negatives to extremely large numbers, and comparing outcomes across array shapes, the tests validate the library's correctness and resilience in scenarios that diverge from typical use cases. This comprehensive approach ensures the library remains reliable across a spectrum of applications.

@AzeezIsh AzeezIsh force-pushed the complexity_testing branch from d8265d2 to 55dda7c Compare March 26, 2024 18:25
@syurkevi syurkevi force-pushed the complexity_testing branch from 7b8fe9e to 99092da Compare April 12, 2024 20:40
@syurkevi syurkevi merged commit 6671167 into arrayfire:master Apr 12, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants