MetaWards Logo
0.8.2
  • Installation instructions
  • Model data
  • Tutorial
  • Usage
  • Running on a cluster
  • Documentation
  • Developer’s guide
  • Changelog
MetaWards
  • Docs »
  • metawards.Links
  • View page source

metawards.Links¶

class metawards.Links¶

This is a container class for Links. This uses arrays to store a list of Link objects as a “struct of arrays”. This should improve speed of loading and access.

__init__(self, N: int = 0)¶

Create a container for up to “N” Links

Attributes

assert_not_null Assert that this collection of links is not null
assert_valid_index Assert that the passed index ‘i’ is valid for this collection.
is_null
resize Resize this container to hold ‘N’ links.
assert_not_null¶

Assert that this collection of links is not null

assert_valid_index¶

Assert that the passed index ‘i’ is valid for this collection. This will return the index with Python reverse indexing, so that “-1” refers to the last link in the collection

is_null¶
resize¶

Resize this container to hold ‘N’ links. This will expand the container if ‘N’ is greater than len(self), or will contract the container (deleting excess links) if ‘N’ is less than len(self). This function is called typically when you pre-allocate a large Links container, and then want to reduce the size to fit the number of loaded links


Last updated on Apr 21, 2020.