numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
18 stars 6 forks source link

Provide opposite dimension table method modifier #170

Closed numeredev closed 4 months ago

numeredev commented 9 months ago

DESCRIPTION

What does your feature request improve on? Please describe. The table modifier .every(...) allows selection of elements in the opposite direction of application, i.e. TAB().avg.cols.every(...) allows for selection of individual columns. It is, however, not possible to select somethin along the direction of application. It would be helpful, if such a modifier exists.

Describe the solution you'd like Provide a table method modifier, which allows for selection along the direction application as opposed to .every(). This modifier shall only apply together with rows or cols. Possible names could be TAB().other(...), TAB().subset(...), TAB().select(...), TAB().use(...) or TAB().range(...)

Additional context Add any other context or screenshots about the feature request here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The interface could be implemented similar to every, although that's not so elegant. It would be better to actually use surrounding parentheses in the corresponding VectorIndex MemoryManager::parseEvery(string& sDir, const string& sTableName) const function. Furthermore, this function should be made more abstract to actually find a passed function name instead of every= directly.

As modifier name, it is important that the meaning does not conflict with the meaning of every(). TAB().cols.every({1:3:10}).cells({4:nrows}) might be a good candidate, because cells directly reflects the fact that this selects the cells independent on the previous used direction of application.

To make that actually working, the interface has to be changed to use mu::value_type (MemoryManager::*MAF)(const std::string&, const VectorIndex&, const VectorIndex&) instead the currently used mu::value_type (MemoryManager::*MAF)(const std::string&, long long int, long long int, long long int, long long int)

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST