Skip to content

Suggestion: Change the Xstart and Xstop behaviour in the LIS LogPass.setFrameSetChX(...) function #7

@erlendviggen

Description

@erlendviggen

I just tracked down a bug in my code where the last depth frame in a LIS file ended up missing. The bug stemmed from a line where I wanted to read a selection of the channels over the entire depth:

logPass.setFrameSetChX(file, channelMnemList, logPass.xAxisFirstEngVal, logPass.xAxisLastEngVal)

My expected behaviour was to get every frame from logPass.xAxisFirstEngVal to and including logPass.xAxisLastEngVal, while I got every frame to but not including the latter, since TotalDepth here follows the Python convention on ranges.

This makes it somewhat inconvenient to get all frames for a selection of channels, since I suppose it means that you have to specify a stop depth after logPass.xAxisLastEngVal in order to get every frame. Therefore, I have two possible suggestions on how to change this behaviour:

  1. Change the behaviour of LogPass.setFrameSetChX(...) so that it gets the frames to and including the specified stop frame depth. This would make it more convenient to use, although it might not be quite Pythonic.
  2. Make the Xstart and Xstop arguments optional. If they are not specified, then default to getting every frame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions