Skip to content

HSPEP2: In place or out place functions

pburdet edited this page Dec 18, 2013 · 2 revisions
key value
Status Active
Author Pierre
Created 18th December, 2013
Updated
Discussion
Implementation

Background

To save computation memory some functions do not duplicate the object and directly modify it (in-place). The vast majority return a duplicated object (out-place). For a new user, the behavior of a function is hard to predict. A systematic way of calling the function should be established to distinguish between in-place and out-place functions.

Proposed feature

  1. The out-place keeps there name (eg. min, rebin, apply_function)
  2. The in-place functions are duplicated, eg. align and set_align. Align works out-place and set_align works in-place.

In this way the users worrying about memory space can look for the function beginning with set_.

Implementation details

  1. Establish a list of in-place function.
  2. Add set_ to their name
  3. Create the out-place function that duplicate the object and call the set_ functions
Clone this wiki locally