Implement dimension-sort API (1rst STEP)
One of the current tasks is to be synchronized with to the latest version of SciExp. Once we finish that step, we will have support from the underlying infrastructure to re-sort the dimensions. However, while we do that, we can add (temporally) support to that sorting feature. The idea is to define the API that we will use in the future, and implement a 'hack' that uses it with the current infrastructure.
In the future will be a processing pass called 'DimensionSort', with a single parameter:
dimension-sort = <DIMENSION_NAME> [ASC|DESC|[CUSTOM [list]]]
DIMENSION_NAME -> specifies the dimension to sort
The keyword after the DIMENSION_NAME specifies how the dimension is going to be sorted:
ASC -> ascending order
DESC -> descending order
CUSTOM -> custom sorting. In that case a third parameter (a comma separated list of names in the wanted order) is required. If the list is not complete, the remaining items will be added at the end in the order in which the were originally.
Current dimension order depends on the iterldim() function of the Data object. That function needs to be externalized, as a part of the new Dimension-sort plugin. Then, it will be initialized using the commandline arguments. Then, whenever this function is called is will return an iterator with the dimensions sorted.Steps:
- Implement the Dimension-Sort plugin as normal, the call function will be empty
- the Initialization will register the parameters and store the parameters.
- Add an extra function to that plugin that returns the iterator
- Modify potra-cmd frond-end to always initialize that plugin.
- Substitute every iterldim function call with the new plugin function call.