Refactoring #1918

Core API: review IHistogram class family

Added by dmitry almost 3 years ago. Updated 4 days ago.

Status:BacklogStart date:06 Dec 2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Currently IHistogram class contains methods like getXaxis(), getYaxis(), getYmin(), getYmax(), etc., which imply its being two-dimensional. They should adhere to Histogram2D, while IHistogram should be a common interface for Histogram1D and Histogram2D


Related issues

Related to BornAgain - Refactoring #2130: Core API: Reduce the number of possible ways to access data through SimulationResult Backlog 30 Jul 2018
Related to BornAgain - Refactoring #2011: PythonAPI: improve access to the simulation results Backlog 14 Mar 2018

History

#1 Updated by pospelov over 2 years ago

  • Subject changed from Remove dependency on dimensions from IHistogram class to Revise IHistogram class family
  • Status changed from New to Backlog

Possible improvements (to be discussed):

  • Remove dependency on dimensions from IHistogram class
  • Provide a way to sum-up two histograms with weights
  • Provide a way to project along one of the axis by summing whole content along the other axis.
  • Provide a way to add numpy array to histogram content with given weight.
  • Revise IHistogram return type in Python context

Python doesn't have dynamic_cast, so construction like real_data = ba.Histogram2D.dynamicCast(real_data) is required to access Histogram2D methods
See FitAlongSlices.py example

  • Revise all static methods in IHistogram class
  • Remove all 'get' and 'set' prefixes

#2 Updated by wuttke 4 days ago

  • Subject changed from Revise IHistogram class family to Core: IHistogram class family: imporve API

#3 Updated by wuttke 4 days ago

  • Related to Refactoring #2130: Core API: Reduce the number of possible ways to access data through SimulationResult added

#4 Updated by wuttke 4 days ago

  • Subject changed from Core: IHistogram class family: imporve API to Core API: review IHistogram class family

#5 Updated by wuttke 4 days ago

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

Also available in: Atom PDF