Closed yashksaini-coder closed 2 weeks ago
š Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!
Feel free to join our community on Discord to discuss more!
ā Closes: #421
This pull request introduces a comprehensive Python package for complex number operations, including arithmetic, advanced operations, parsing, logging, error handling, and unit testing. The most important changes include the implementation of the
ComplexNumber
class, custom exceptions, logging configuration, utility functions, and unit tests.Implementation of Complex Number Operations:
pysnippets/Complex_number/complex_number.py
: Added theComplexNumber
class with methods for addition, subtraction, multiplication, division, magnitude calculation, and conjugation. Included detailed logging for each operation.Error Handling:
pysnippets/Complex_number/exceptions.py
: Added custom exceptionsComplexNumberError
andDivisionByZeroError
for robust error management.Logging Configuration:
pysnippets/Complex_number/logger_config.py
: Added a function to set up logging with a specific format and level.Utility Functions:
pysnippets/Complex_number/utils.py
: Added theparse_complex
function to convert string representations of complex numbers intoComplexNumber
objects, with logging and error handling.Unit Testing:
pysnippets/Complex_number/test_all.py
: Added a test suite to run all unit tests.pysnippets/Complex_number/test_complex_number.py
: Added unit tests for theComplexNumber
class, including tests for division and division by zero.pysnippets/Complex_number/test_operations.py
: Added unit tests for thepower
function, including tests for zero and negative exponents.pysnippets/Complex_number/test_utils.py
: Added unit tests for theparse_complex
function, including tests for valid and invalid formats.TESTING
@UTSAVS26 kindly review this PR