Skip to content

python hl

Podhorszki, Norbert requested to merge github/fork/germasch/pr/python-hl into master

Created by: germasch

This is prep work for supporting column-major data in its original order in the python high-level interface, but I think it's useful even by itself.

This PR includes a minor unrelated cleanup removing superfluous semicolons.

It then adds a bunch of tests covering all the variants of the python HL read() functionality, in particular: (1) read whole array / block (2) read a provided selection and (3) read a provided selection and step selection. All 3 overloads are tested against GlobalValue, GlobalArray, LocalValue, LocalArray datasets. Not everything is supported in the current code, so those tests are marked expected failures.

The main part of the PR merges the actual implementation of the various read() overloads into on DoRead() function, which takes a Selection and a StepSelection, those being optional:

  • An empty start means: Start at the origin (0, 0, ...)
  • An empty count means: Cover whole array (ie, shape) or whole block (ie, count) for GlobalArrays and LocalArrays respectively.
  • stepCount = 0 means: Read data from current step.

These changes are internal, ie, the python-facing HL API doesn't change.

This consolidation add support for a few cases, like reading a step selection of GlobalValues. It also makes possible to read a step selection of, say, a whole global array, without having to specify a selection, too:

     read("var', stepStart=1, stepCount=2)

Specifying a selection on a LocalArray reads does not work, neither before nor after this PR -- this seems to be an issue of core not supporting it.

This PR squashes (part of) #1668, so if one wants to follow the actual evolution of the code, the former might be easier.

Merge request reports

Loading