Skip to content

Conversation

@hiker
Copy link
Collaborator

@hiker hiker commented Oct 16, 2025

A small change to fix #3189 by converting Fortran == into SymPy Eq(...).

@hiker hiker added the bug label Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (761be74) to head (d995f56).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3191   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files         376      376           
  Lines       53156    53161    +5     
=======================================
+ Hits        53104    53109    +5     
  Misses         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hiker
Copy link
Collaborator Author

hiker commented Oct 16, 2025

The link check failure is because of https://www.khronos.org/files/opencl22-reference-guide.pdf, which I just manually tested and it seems to work now.

This is basically ready for review, but it must run the full CI (since previously logical comparisons using == will likely have been incorrectly been converted to .false. :( ). Not sure if there is anything that actually uses this.

I hit that problem when inlining (for my training), and it converted the condition pointed out in #3189 to a .false.

This PR is blocking #1623 for that reason.

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Joerg. Just a couple of things to tidy and then this can be merged.

def test_sympy_writer_logicals(fortran_reader: FortranReader,
fortran_expr: str,
sympy_str: str):
'''Test handling of user-defined types, e.g. conversion of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the fault of this PR but I've just noticed that this docstring is wrong :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Done.

is .NEQV.'''
return f"({'.NEQV.' .join(self._print(i) for i in expr.args)})"

def _print_Equality(self, expr):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you add -> str to all of these handlers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - I tried to look at what expr is, but that appears to be not straight forward, and I didn't want to dive any further into SymPy ... so I left them :) I also disabled two pylint warnings.

@hiker
Copy link
Collaborator Author

hiker commented Oct 24, 2025

Updated to latest master. I will trigger the CI on Monday.

@hiker
Copy link
Collaborator Author

hiker commented Oct 25, 2025

CI passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sympy evaluates == incorrect

3 participants