[CODER] [CODER] Write the temperature conversion function #21

Open
sam wants to merge 1 commits from feature/issue-18 into main
Owner

Closes #18

What

Assigned to: coder

Develop a Python function convert_temperature with parameters for the value to convert and a string indicating the units ('Celsius', 'Fahrenheit', 'Kelvin'). The function should validate input and use appropriate formulas for conversion. Include detailed docstrings.


Created by MARSHAL

Files changed

  • generated_code.py

Generated by CODER agent (model: qwen2.5-coder)

Closes #18 ## What **Assigned to**: coder Develop a Python function `convert_temperature` with parameters for the value to convert and a string indicating the units ('Celsius', 'Fahrenheit', 'Kelvin'). The function should validate input and use appropriate formulas for conversion. Include detailed docstrings. --- _Created by MARSHAL_ ## Files changed - `generated_code.py` --- _Generated by CODER agent (model: qwen2.5-coder)_
sam added 1 commit 2026-07-22 20:13:46 +00:00
Author
Owner

QA Analysis

Summary: This PR adds a temperature conversion utility function to the project.

Issues found: 2

  • No support for Kelvin to Fahrenheit or Celsius to Kelvin direct conversions in the provided code.
  • The example usage does not cover all possible valid unit combinations.

Test suggestions:

  • Add test cases for all supported unit conversions, including edge cases like negative temperatures and non-numeric input handling.
  • Ensure that the function handles invalid inputs correctly by adding more tests with different types of incorrect data.

Reviewed by QA agent (model: qwen2.5-coder)

## QA Analysis **Summary**: This PR adds a temperature conversion utility function to the project. **Issues found**: 2 - No support for Kelvin to Fahrenheit or Celsius to Kelvin direct conversions in the provided code. - The example usage does not cover all possible valid unit combinations. **Test suggestions**: - Add test cases for all supported unit conversions, including edge cases like negative temperatures and non-numeric input handling. - Ensure that the function handles invalid inputs correctly by adding more tests with different types of incorrect data. --- _Reviewed by QA agent (model: qwen2.5-coder)_
Author
Owner

Code Review

Summary: Adds a utility function for converting temperatures between Celsius, Fahrenheit, and Kelvin.

Architecture: The conversion logic and function are straightforward and contained within a single function. However, this design is limited to a one-way conversion (e.g., Kelvin to Celsius) and does not offer reverse conversions directly.

🐛 Correctness Issues:

  • The function only converts Kelvin to Celsius but does not support direct conversion from Celsius or Fahrenheit to Kelvin.
  • The unit handling is case-sensitive, which can lead to unexpected ValueError for inputs like 'celsius', 'FAHRENHEIT'.

💡 Suggestions:

  • Extend functionality to support conversions from Celsius and Fahrenheit to Kelvin, and vice-versa.
  • Consider making unit input case-insensitive to improve usability.
  • Add more comprehensive test cases to validate conversions in both directions.
  • Return a consistent data type, such as raising an error if non-numeric input is detected before attempting float conversion.

Verdict: REQUEST_CHANGES (confidence: high)


Reviewed by REVIEWER agent (model: gpt-4o)

## Code Review **Summary**: Adds a utility function for converting temperatures between Celsius, Fahrenheit, and Kelvin. **Architecture**: The conversion logic and function are straightforward and contained within a single function. However, this design is limited to a one-way conversion (e.g., Kelvin to Celsius) and does not offer reverse conversions directly. **🐛 Correctness Issues**: - The function only converts Kelvin to Celsius but does not support direct conversion from Celsius or Fahrenheit to Kelvin. - The unit handling is case-sensitive, which can lead to unexpected `ValueError` for inputs like 'celsius', 'FAHRENHEIT'. **💡 Suggestions**: - Extend functionality to support conversions from Celsius and Fahrenheit to Kelvin, and vice-versa. - Consider making unit input case-insensitive to improve usability. - Add more comprehensive test cases to validate conversions in both directions. - Return a consistent data type, such as raising an error if non-numeric input is detected before attempting float conversion. **Verdict**: REQUEST_CHANGES (confidence: high) --- _Reviewed by REVIEWER agent (model: gpt-4o)_
Author
Owner

PR #23 opened: feature/issue-21
Files: generated_code.py

PR #23 opened: feature/issue-21 Files: generated_code.py
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/issue-18:feature/issue-18
git checkout feature/issue-18
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sam/sns-network-solutions#21
No description provided.