Project

General

Profile

Feature #147

Implement dimension-sort API (1rst STEP)

Added by Ramon Bertran over 6 years ago. Updated about 6 years ago.

Status:
Assigned
Priority:
Normal
Assignee:
Start date:
02/02/2012
Due date:
% Done:

0%


Description

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.

API

In the future will be a processing pass called 'DimensionSort', with a single parameter:

[DimensionSort]
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.

HACK

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:
  1. Implement the Dimension-Sort plugin as normal, the call function will be empty
  2. the Initialization will register the parameters and store the parameters.
  3. Add an extra function to that plugin that returns the iterator
  4. Modify potra-cmd frond-end to always initialize that plugin.
  5. Substitute every iterldim function call with the new plugin function call.

History

#1 Updated by Victor Jimenez about 6 years ago

Add support for numerical sort (sort -n)

Ex:

1-xxx
2-xxx
...
10-xxx

Also available in: Atom PDF