Skip to content

Group numpy TensorGenerators into a client.numpy subpackage #565

@khatchad

Description

@khatchad

The com.ibm.wala.cast.python.ml.client package is flat (~155 classes), and the numpy-specific generators are distinguished only by an Np/Ndarray name prefix: NpArray, NpReshape, NpOnes, NpZeros, NdarrayReshape, NdarraySubscriptOperation (and the np.ndarray.astype generator).

Proposal

Move the numpy generators into a com.ibm.wala.cast.python.ml.client.numpy subpackage and drop the prefix, so they read as numpy.Array, numpy.Reshape, numpy.Ones, numpy.Zeros, etc. This cleanly disambiguates them from the TensorFlow Ones/Zeros/Reshape generators without prefix noise.

Considerations

  • This would be the first subpackage under client. For consistency it is worth deciding whether the TensorFlow generators should likewise move to a client.tensorflow subpackage, rather than leaving a lone numpy subpackage beside ~149 flat classes.
  • Pure refactor (moves + renames + import updates); no behavior change.

Surfaced during ponder-lab#355 (the #539 fix), where NpOnes/NpZeros were added flat to match the existing convention; the packaging question was deferred here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions