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:
- Activate your AvaFrame pixi environment
- open your command prompt
- go to AvaFrame\avaframe\tests
- execute
pytest test_DFAfunctionsCython.py
- See error
Expected behavior
All tests passed
Screenshots
Desktop (please complete the following information):
- OS: Windows 11 Pro
- Version 24H2
Description
Bug 1
While running
test_DFAfunctionsCython.pythe test functiontest_computeEntMassAndForcean error is raised because the test variableareaEntrPartin line 92 mismatches the benchmark value of1. It was found that, in the global functionavaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForceonly the data type ofareaEntrPartin line 506 (and other variables) is defined. Intest_computeEntMassAndForcethe variableentrMassCellis set to0but the global functionavaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForceis only defined for casesentrMassCell > 0. Thus, the output variableareaEntrPartis also undefined and an error is raised.Maybe
areaEntrPart(and the other variables) inavaframe.tests.test_DFAfunctionsCython.pyx.computeEntMassAndForceshould be defined ascdef double areaEntrPart = 0?Bug 2
While running
test_DFAfunctionsCython.pyValueError: Buffer dtype mismatch, expected 'long' but got 'long long'is raised concerning the functiontest_updatePositionC.The bug could be narrowed down to lines 541-544. It seems that the called global function
DFAfuncC.updatePositionCin line 546 expects another data type than defined in line 541cfg['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:
pytest test_DFAfunctionsCython.pyExpected behavior
All tests passed
Screenshots
Desktop (please complete the following information):