Bug #1674

Possible bug introduced in Polygon in Python context

Added by pospelov 12 months ago. Updated 12 months ago.

Status:ResolvedStart date:24 Nov 2016
Priority:NormalDue date:
Assignee:pospelov% Done:

0%

Category:-
Target version:Sprint 33

Description

Earlier version of Polygon had copying of input arrays instead of const reference.
This was because of crash if one use it from Python like that:

simulation.addMask(ba.Polygon([[0.0*deg, 1.0*deg], [0.5*deg, 1.2*deg],[0.5*deg, 0.8*deg]]), True)

Copying of array was a solution to the problem. This was commented in implementation file as:

// IMPORTANT Input parameter is not "const reference" to be able to work from python
// (auto convertion of python list to vector<vector<double>>).

So I believe is that the bug is back again.

Within this item
  • Create a python unit test
  • return all Polygon constructors back to copying
  • Revise all vector usage in BornAgain in the context of PythonAPI

e.g. Histogram2D() constructors

History

#1 Updated by pospelov 12 months ago

Fixed in hotfix. Unit tests still have to be created.

#2 Updated by pospelov 12 months ago

  • Assignee set to pospelov

#3 Updated by pospelov 12 months ago

  • Status changed from Sprint to Resolved

Also available in: Atom PDF