@@ -435,9 +435,9 @@ def add_row(self, flags=0, time=0, population=-1, individual=-1, metadata=None):
435435 :param int flags: The bitwise flags for the new node.
436436 :param float time: The birth time for the new node.
437437 :param int population: The ID of the population in which the new node was born.
438- Defaults to :const :`.NULL`.
438+ Defaults to :data :`.NULL`.
439439 :param int individual: The ID of the individual in which the new node was born.
440- Defaults to :const :`.NULL`.
440+ Defaults to :data :`.NULL`.
441441 :param bytes metadata: The binary-encoded metadata for the new node. If not
442442 specified or None, a zero-length byte string is stored.
443443 :return: The ID of the newly added node.
@@ -463,10 +463,10 @@ def set_columns(
463463 :param time: The time values for each node. Required.
464464 :type time: numpy.ndarray, dtype=np.float64
465465 :param population: The population values for each node. If not specified
466- or None, the :const :`.NULL` value is stored for each node.
466+ or None, the :data :`.NULL` value is stored for each node.
467467 :type population: numpy.ndarray, dtype=np.int32
468468 :param individual: The individual values for each node. If not specified
469- or None, the :const :`.NULL` value is stored for each node.
469+ or None, the :data :`.NULL` value is stored for each node.
470470 :type individual: numpy.ndarray, dtype=np.int32
471471 :param metadata: The flattened metadata array. Must be specified along
472472 with ``metadata_offset``. If not specified or None, an empty metadata
@@ -498,10 +498,10 @@ def append_columns(
498498 :param time: The time values for each node. Required.
499499 :type time: numpy.ndarray, dtype=np.float64
500500 :param population: The population values for each node. If not specified
501- or None, the :const :`.NULL` value is stored for each node.
501+ or None, the :data :`.NULL` value is stored for each node.
502502 :type population: numpy.ndarray, dtype=np.int32
503503 :param individual: The individual values for each node. If not specified
504- or None, the :const :`.NULL` value is stored for each node.
504+ or None, the :data :`.NULL` value is stored for each node.
505505 :type individual: numpy.ndarray, dtype=np.int32
506506 :param metadata: The flattened metadata array. Must be specified along
507507 with ``metadata_offset``. If not specified or None, an empty metadata
@@ -1140,10 +1140,43 @@ def __str__(self):
11401140 return ret [:- 1 ]
11411141
11421142 def set_columns (self , metadata = None , metadata_offset = None ):
1143+ """
1144+ Sets the values for each column in this :class:`.PopulationTable` using the
1145+ values in the specified arrays. Overwrites any data currently stored in the
1146+ table.
1147+
1148+ The ``metadata`` and ``metadata_offset`` parameters must be supplied
1149+ together, and meet the requirements for
1150+ :ref:`sec_encoding_ragged_columns` (see
1151+ :ref:`sec_tables_api_binary_columns` for more information).
1152+
1153+ :param metadata: The flattened metadata array. Must be specified along
1154+ with ``metadata_offset``. If not specified or None, an empty metadata
1155+ value is stored for each node.
1156+ :type metadata: numpy.ndarray, dtype=np.int8
1157+ :param metadata_offset: The offsets into the ``metadata`` array.
1158+ :type metadata_offset: numpy.ndarray, dtype=np.uint32.
1159+ """
11431160 self .ll_table .set_columns (
11441161 dict (metadata = metadata , metadata_offset = metadata_offset ))
11451162
11461163 def append_columns (self , metadata = None , metadata_offset = None ):
1164+ """
1165+ Appends the specified arrays to the end of the columns of this
1166+ :class:`PopulationTable`. This allows many new rows to be added at once.
1167+
1168+ The ``metadata`` and ``metadata_offset`` parameters must be supplied
1169+ together, and meet the requirements for
1170+ :ref:`sec_encoding_ragged_columns` (see
1171+ :ref:`sec_tables_api_binary_columns` for more information).
1172+
1173+ :param metadata: The flattened metadata array. Must be specified along
1174+ with ``metadata_offset``. If not specified or None, an empty metadata
1175+ value is stored for each node.
1176+ :type metadata: numpy.ndarray, dtype=np.int8
1177+ :param metadata_offset: The offsets into the ``metadata`` array.
1178+ :type metadata_offset: numpy.ndarray, dtype=np.uint32.
1179+ """
11471180 self .ll_table .append_columns (
11481181 dict (metadata = metadata , metadata_offset = metadata_offset ))
11491182
@@ -1201,13 +1234,60 @@ def add_row(self, record, timestamp=None):
12011234 def set_columns (
12021235 self , timestamp = None , timestamp_offset = None ,
12031236 record = None , record_offset = None ):
1237+ """
1238+ Sets the values for each column in this :class:`.ProvenanceTable` using the
1239+ values in the specified arrays. Overwrites any data currently stored in the
1240+ table.
1241+
1242+ The ``timestamp`` and ``timestamp_offset`` parameters must be supplied
1243+ together, and meet the requirements for
1244+ :ref:`sec_encoding_ragged_columns` (see
1245+ :ref:`sec_tables_api_binary_columns` for more information). Likewise
1246+ for the ``record`` and ``record_offset`` columns
1247+
1248+ :param timestamp: The flattened timestamp array. Must be specified along
1249+ with ``timestamp_offset``. If not specified or None, an empty timestamp
1250+ value is stored for each node.
1251+ :type timestamp: numpy.ndarray, dtype=np.int8
1252+ :param timestamp_offset: The offsets into the ``timestamp`` array.
1253+ :type timestamp_offset: numpy.ndarray, dtype=np.uint32.
1254+ :param record: The flattened record array. Must be specified along
1255+ with ``record_offset``. If not specified or None, an empty record
1256+ value is stored for each node.
1257+ :type record: numpy.ndarray, dtype=np.int8
1258+ :param record_offset: The offsets into the ``record`` array.
1259+ :type record_offset: numpy.ndarray, dtype=np.uint32.
1260+ """
12041261 self .ll_table .set_columns (dict (
12051262 timestamp = timestamp , timestamp_offset = timestamp_offset ,
12061263 record = record , record_offset = record_offset ))
12071264
12081265 def append_columns (
12091266 self , timestamp = None , timestamp_offset = None ,
12101267 record = None , record_offset = None ):
1268+ """
1269+ Appends the specified arrays to the end of the columns of this
1270+ :class:`ProvenanceTable`. This allows many new rows to be added at once.
1271+
1272+ The ``timestamp`` and ``timestamp_offset`` parameters must be supplied
1273+ together, and meet the requirements for
1274+ :ref:`sec_encoding_ragged_columns` (see
1275+ :ref:`sec_tables_api_binary_columns` for more information). Likewise
1276+ for the ``record`` and ``record_offset`` columns
1277+
1278+ :param timestamp: The flattened timestamp array. Must be specified along
1279+ with ``timestamp_offset``. If not specified or None, an empty timestamp
1280+ value is stored for each node.
1281+ :type timestamp: numpy.ndarray, dtype=np.int8
1282+ :param timestamp_offset: The offsets into the ``timestamp`` array.
1283+ :type timestamp_offset: numpy.ndarray, dtype=np.uint32.
1284+ :param record: The flattened record array. Must be specified along
1285+ with ``record_offset``. If not specified or None, an empty record
1286+ value is stored for each node.
1287+ :type record: numpy.ndarray, dtype=np.int8
1288+ :param record_offset: The offsets into the ``record`` array.
1289+ :type record_offset: numpy.ndarray, dtype=np.uint32.
1290+ """
12111291 self .ll_table .append_columns (dict (
12121292 timestamp = timestamp , timestamp_offset = timestamp_offset ,
12131293 record = record , record_offset = record_offset ))
0 commit comments