Skip to content
Snippets Groups Projects

Fix: Replaced accidental `continue` by `break` in boundaries/createindexlist.py

Merged Frederik Hennig requested to merge da15siwa/pystencils:fix_single_link into master
1 unresolved thread

There was a continue instead of a break statement in the python code for index list creation, causing the single_link flag to be ignored. The test cases for this are updated in lbmpy!41 (merged).

Edited by Frederik Hennig

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • It should probably the same as in _create_boundary_cell_index_list_python. Could you extend the test case in lbmpy to also check single_link=True. You can use @pytest.mark.parametrize('single_link', (True, False)) and give the test case a parameter single_link.

      This should fail now, but pass with your fix.

      Edited by Stephan Seitz
    • You mean test_equivalence_cython_python_version? I was looking for a test case like this in the pystencils repo but didn't find any. Good to know they are in the lbmpy repo. Thanks!

    • Yes, I found it also strange that those methods were never used in pystencils but then grepped lbmpy.

    • I updated the test cases and opened a seperate MR: lbmpy!41 (merged). The pipeline there still fails because the fix isn't yet merged to the pystencils master.

      Edited by Frederik Hennig
    • I think it would be a good idea to just move the test case from lbmpy to pystencils since it has no real lbmpy dependency as you have also mentioned.

      The stencil then needs to be implemented manually in order to not have lbmpy as a dependency in the pystencils test suite. Would this be ok for you?

    • lbmpy as a test dependency for sympy wouldn't be that bad I guess (such tests can be skipped with pytest.importorskip. There's lots of stuff in pystencils that is only tested in lbmpy.

      We could also just run lbmpy Pipefile in full CI.

      Edited by Stephan Seitz
    • Yes, you are right it wouldn't be too bad. But I still think it is better to have as little dependencies as possible and in this case, it would be easy to not introduce the dependency.

    • I'd agree with Markus on this. It would be sensible to move the test case to pystencils and specify the stencils manually. After all, the index list creation is supposed to work not only for LBM boundary handling and LBM stencils, but for any kind of application.

    • Please register or sign in to reply
  • Frederik Hennig mentioned in merge request lbmpy!41 (merged)

    mentioned in merge request lbmpy!41 (merged)

  • Frederik Hennig changed the description

    changed the description

  • Frederik Hennig changed title from Fix: Replaced accidental {-break by continue-} in boundaries/createindexlist.py to Fix: Replaced accidental {+continue by break+} in boundaries/createindexlist.py

    changed title from Fix: Replaced accidental {-break by continue-} in boundaries/createindexlist.py to Fix: Replaced accidental {+continue by break+} in boundaries/createindexlist.py

  • Frederik Hennig added 1 commit

    added 1 commit

    • 57935b1b - migrated index_list tests to pystencils

    Compare with previous version

  • merged

  • Markus Holzer mentioned in commit f2e811e8

    mentioned in commit f2e811e8

Please register or sign in to reply