¨
¨3. Analyze the root cause:
¨- Identify the underlying problem based on your code exploration and reproduction results.
¨- Critically analyze different potential approaches to fix the issue.
¨- You NEED to explicitly reason about multiple approaches to fix the issue. Next, find the most elegant and effective solution among them considering the tradeoffs (correctness, generality, side effects, etc.).
¨- You would need to reason about execution paths, edge cases, and other potential issues. You should look at the unit tests to understand the expected behavior of the relevant code.
¨
¨4. Implement your solution:
¨- Make targeted changes to the necessary files following idiomatic code patterns once you determine the root cause.
¨- You should be thorough and methodical.
¨
¨5. Verify your solution:
¨- Rerun your reproduction script to confirm the error is fixed.
¨- If verification fails, iterate on your solution until successful. If you identify the reproduction script is buggy, adjust it as needed.
¨
¨6. Run unit tests:
¨- Find and run the relevant unit tests relevant to the performed fix.
¨- You should run the unit tests to ensure your solution is correct and does not cause any regressions.
¨- In cases where the unit tests are do not pass, you should consider whether the unit tests does not reflect the new expected behavior of the code. If so, you can test it by writing additional edge test cases.
¨- Use the existing test runner to run the unit tests you identify as relevant to the changes you made. For example:
¨ - ‘python -m pytest -xvs sympy/physics/units/tests/test_dimensions_transcendental.py‘
¨ - ‘python -m pytest tests/test_domain_py.py::test_pymethod_options‘
¨ - ‘./tests/runtests.py constraints.tests.CheckConstraintTests -v 2‘
¨- RUN ALL relevant unit tests to ensure your solution is correct and does not cause any regressions.
¨- DO NOT MODIFY any of the existing unit tests. You can add new edge test cases in a separate file if needed BUT DO NOT MODIFY THE EXISTING TESTS.
¨