Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • W wendelin.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedinexedi
  • wendelin.core
  • Merge requests
  • !6

bigarray: ArrayRef utility

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Kirill Smelkov requested to merge kirr/wendelin.core:y/arrayref into master Apr 02, 2018
  • Overview 6
  • Commits 2
  • Pipelines 0
  • Changes 3

ArrayRef is a reference to NumPy array.

The reference is represented by root array object and instructions how to create original array as some view of the root.

Such reference could be useful in situations where one needs to pass arrays between processes and instead of copying array data, leverage the fact that top-level array, for example ZBigArray, is already persisted separately, and only send small amount of information referencing data in question.

Use ArrayRef(array) to create reference to an ndarray.

Use .deref() to convert ArrayRef to pointed array object.

NOTE

don't send ArrayRef unconditionally - for example when array object is small regular ndarray with also regular, but big, root ndarray, sending ArrayRef will send whole data for root object, not for small leaf.

Sending ArrayRef only makes sense when root object is known to be already persisted by other means, for example something like below in ZODB context:

  aref = ArrayRef(a)
  if isinstance(aref.root, Persistent):
      send aref
  else:
      send a 

Please see individual patches for more details.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: y/arrayref
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7