forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
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 | #Issue 130 |
Implementation |
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.
- The out-place keeps there name (eg. min, rebin, apply_function)
- 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_.
- Establish a list of in-place function.
- Add set_ to their name
- Create the out-place function that duplicate the object and call the set_ functions