Skip to content

[tests] avaframe\tests\test_DFAfunctionsCython.py #1192

@JuLa96

Description

@JuLa96

Description
Bug 1
While running test_DFAfunctionsCython.py the test function test_computeEntMassAndForce an error is raised because the test variable areaEntrPart in line 92 mismatches the benchmark value of 1. It was found that, in the global function avaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForce only the data type of areaEntrPart in line 506 (and other variables) is defined. In test_computeEntMassAndForce the variable entrMassCell is set to 0 but the global function avaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForce is only defined for cases entrMassCell > 0. Thus, the output variable areaEntrPart is also undefined and an error is raised.
Maybe areaEntrPart (and the other variables) in avaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForce should be defined as cdef double areaEntrPart = 0?

Bug 2
While running test_DFAfunctionsCython.py ValueError: Buffer dtype mismatch, expected 'long' but got 'long long' is raised concerning the function test_updatePositionC.
The bug could be narrowed down to lines 541-544. It seems that the called global function DFAfuncC.updatePositionC in line 546 expects another data type than defined in line 541 cfg['GENERAL']['delStoppedParticles'] = '1'. It is assumed that this is a matter of defining the data type of the input variable.

To Reproduce
Steps to reproduce the behavior:

  1. Activate your AvaFrame pixi environment
  2. open your command prompt
  3. go to AvaFrame\avaframe\tests
  4. execute pytest test_DFAfunctionsCython.py
  5. See error

Expected behavior
All tests passed

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows 11 Pro
  • Version 24H2

Metadata

Metadata

Assignees

Labels

confirmedSomething isn't workingquestionFurther information is requestedtestingpytest etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions