Refactoring #2130

Core API: Reduce the number of possible ways to access data through SimulationResult

Added by dmitry over 2 years ago. Updated about 1 month ago.

Status:BacklogStart date:30 Jul 2018
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Currently three ways of accessing results in SimulationResult exist:

1. through SimulationResult::data (returns OutputData array)
2. methods SimulationResult::histogram1d and SimulationResult::histogram2d
3. getting intensity values as a numpy array

Histogram methods should be probably removed for the following reasons:

1. histogram interface is heavier than underlying
2. It is not universal (depending on the task one need to call histogram1d or histogram2d, and sometimes it is enough to have just histogram)
3. Histogram functionality is not important in python.

One need also carefully handle accessing the innards of temporary objects during this refactoring.

The best solution would be also hiding OutputData from python scope and leaving only SimulationResult with
numpy array accessors (without OutputData or Histogram exposed to python).


Related issues

Related to BornAgain - Refactoring #2011: PythonAPI: improve access to the simulation results Backlog 14 Mar 2018
Related to BornAgain - Refactoring #1918: Core API: review IHistogram class family Backlog 06 Dec 2017

History

#1 Updated by wuttke about 1 month ago

  • Subject changed from Reduce the number of possible ways to access data through SimulationResult to Core API: Reduce the number of possible ways to access data through SimulationResult

#2 Updated by wuttke about 1 month ago

  • Related to Refactoring #2011: PythonAPI: improve access to the simulation results added

#3 Updated by wuttke about 1 month ago

Also available in: Atom PDF