Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.