You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

 

Objectives:

  • GET: To retrieve subset of data elements
  • GET_SIZE: To interrogate the size of subset of data elements,

 

Assumptions:

  • GET_SLICE type methods are not in the scope of the task (they are alternative ways to retrieve parts of the data elements) – although may be useful to add (independently of the deliverable) if straightforward to implement.
  • Implementation in Python only, no plans for other languages
  • IMPLEMENTATION IN NEW LL ONLY!!!!!

Functionality:

  • A simple structure or a leaf with no more than one array of structure ancestor, 
    • Returned: an array of the field i, containing the desired indices of its parent array of structure (optional argument, valid only if the requested leaf has the same size for all desired indices).
    • Example : magnetics.flux_loop(indices).flux
    • Q: how can we specify this with Bartek’s method ? Does a Python method accept a syntax such as magnetics.flux_loop(:).flux.get or magnetics.flux_loop.flux.get(:) ? 
  • An array of structure
    • Returned: an array of structure containing the desired indices (optional argument, by default all indices are returned).
    • Example : magnetics.flux_loop(indices) à straightforward with Bartek’s method
  • An array of structure with an array of structure ancestor:
    • Example. ic_antennas.antenna(indices1).module.get(indices2)
    •  It will be investigated if the method can be also easily implemented (i.e. the result is not guaranteed and the need is less obvious)
  • A field or a simple structure with more than one array of structure ancestor
    • Example: ic_antennas.antenna(indices1).module(indices2).power_launched.get
    •  It will be investigated if the method can be also easily implemented (i.e. the result is not guaranteed and the need is less obvious)

Syntax:

 

Syntax used by of DEMUX actor

..... first you have to add a ; (semicolon) after the name of the field, then you have to specify the dimension in which you consider the data (1 is the first dim). After that, you can add as many ;index as you want (a semicolon followed by an index you want to extract). You can also replace the index by an expression index1:index2 (with a colon) to specify a set of indexes between both index1 and index2. For example, position/z;1;5;10;15:18 will export indexes [5,10,15,16,17,18] of the field z.

 

  • ids_get(<path_including_indices>)
    • input parameters
      • pulseCtx (OR shot, run, user, tokamak, version)
      • IDS name
      • occurence
      • QUERY
    • output parameters
      • array of primitive types (if query points to field of primitive type)
      • array of structures (if query points to field of AoS type or structure)
  • query syntax 
    • separators ( / . | ) - path within tree
    • brackets () []   - array
    • indices (fortran style)
      • ":" all elements
      • "x:y" (from x to y)
      • ":y" from begin to y
      • "x:" from x to the last 
    • only the last bracket can contain indices:
      • YES: "path/to/field/with/ancestorAoS(1)/field/AoS(n:m)"
      • NO: "path/to/field/with/ancestorAoS(x:y)/field/AoS(1)"

 

Requested changes:

  • Low Level:
    • read_data - sanity check of type only when requested
  • HLI:
    • method for creating AoS (method of classes representing AoS array) OR resize(1)
    • method to obtain AoS ctx
    • AoS classes - a special field indicating that class is AoS (question)

 

Algorithm:

Input: path (   /a/b/c(1)/d/e(m:n)/f/g  )

1) Convert path to array/list  {'a','b','c(1)','d','e(m:n)','f','g'}

2) Call traverse(ctx = p-fCtx, path, node = ids)

3) Get node name from list, look for IDS field of this name

4) Does node name contain brackets?

  • NO - cut node from list, call traverse (reducedList, currentNode)
  • YES - it is AoS (warning)  ,
    •  call createAoS from class representing AoS
      • call resize for a number of structures defined by indices
      • get AoS context (aos context - info about index? is ctx accessible? )
    • cut node from list
    • create AoS ctx in LL 
    • traverse (reducedList, aosNode)

 

 

OPEN POINTS:

  • IMPLEMENTATION IN NEW LL ONLY!!!!!
  • AoS as ancestor(s) of queried data
    • once implemented mechanism for creation of AoS could be reused to "go through" ancestors
  • returned value 
    • type provided by user?
    • AoS? if not - functionality can be placed at the Low Level and available for all HLIs (however it could be a problem with returned type  anyway)
  • Level of nesting
    • path/AoS(indices)/x/y/z ?

 

 

 

 

 

 

 

 

 

 

  • No labels