diff --git a/.buildinfo b/.buildinfo
index 52b758e..cd56e74 100644
--- a/.buildinfo
+++ b/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: ddd11be611183f39ea557ead8d38c6d8
+config: 0541f6fbfae9d9f6363b5bc93638b973
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/_modules/biocutils/Factor.html b/_modules/biocutils/Factor.html
index 78de586..f411926 100644
--- a/_modules/biocutils/Factor.html
+++ b/_modules/biocutils/Factor.html
@@ -4,10 +4,10 @@
+[docs]
+defassign(x:Any,indices:Sequence[int],replacement:Any)->Any:
+"""
+ Generic assign that checks if the objects are n-dimensional for n > 1 (i.e.
+ has a ``shape`` property of length greater than 1); if so, it calls
+ :py:func:`~biocutils.assign_rows.assign_rows` to assign them along the
+ first dimension, otherwise it assumes that they are vector-like and calls
+ :py:func:`~biocutils.assign_sequence.assign_sequence` instead.
+
+ Args:
+ x: Object to be assignted.
+
+ Returns:
+ The object after assignment, typically the same type as ``x``.
+ """
+ ifis_high_dimensional(x):
+ returnassign_rows(x,indices,replacement)
+ else:
+ returnassign_sequence(x,indices,replacement)
+[docs]
+@singledispatch
+defassign_rows(x:Any,indices:Sequence[int],replacement:Any)->Any:
+"""
+ Assign ``replacement`` values to a copy of ``x`` at the rows specified by
+ ``indices``. This defaults to creating a deep copy of ``x`` and then
+ assigning ``replacement`` to the first dimension of the copy.
+
+ Args:
+ x:
+ Any high-dimensional object.
+
+ indices:
+ Sequence of non-negative integers specifying rows of ``x``.
+
+ replacement:
+ Replacement values to be assigned to ``x``. This should have the
+ same number of rows as the length of ``indices``. Typically
+ ``replacement`` will have the same dimensionality as ``x``.
+
+ Returns:
+ A copy of ``x`` with the rows replaced at ``indices``.
+ """
+ output=deepcopy(x)
+ tmp=[slice(None)]*len(x.shape)
+ tmp[0]=indices
+ output[(*tmp,)]=replacement
+ returnoutput
+[docs]
+@singledispatch
+defassign_sequence(x:Any,indices:Sequence[int],replacement:Any)->Any:
+"""
+ Assign ``replacement`` values to a copy of ``x`` at the specified ``indices``.
+ This defaults to creating a deep copy of ``x`` and then iterating through
+ ``indices`` to assign the values of ``replacement``.
+
+ Args:
+ x:
+ Any sequence-like object that can be assigned.
+
+ indices:
+ Sequence of non-negative integers specifying positions on ``x``.
+
+ replacement:
+ Replacement values to be assigned to ``x``. This should have the
+ same length as ``indices``.
+
+ Returns:
+ A copy of ``x`` with the replacement values.
+ """
+ output=deepcopy(x)
+ fori,jinenumerate(indices):
+ output[j]=replacement[i]
+ returnoutput
sub (Union[int, bool, Sequence]) β Sequence of integers or booleans specifying the elements of
interest. Alternatively, an integer/boolean scalar specifying a
single element.
x (Sequence[str]) β A sequence of strings. Any value may be None to indicate
+
x (Sequence[str]) β A sequence of strings. Any value may be None to indicate
missingness.
-
levels (Optional[Sequence[str]]) β Sequence of reference levels, against which the entries in x are compared.
+
levels (Optional[Sequence[str]]) β Sequence of reference levels, against which the entries in x are compared.
If None, this defaults to all unique values of x.
-
sort_levels (bool) β Whether to sort the automatically-determined levels. If False,
+
sort_levels (bool) β Whether to sort the automatically-determined levels. If False,
the levels are kept in order of their appearance in x. Not
used if levels is explicitly supplied.
ordered (bool) β Whether the levels should be assumed to be ordered. Note that
@@ -174,7 +174,7 @@
A sequence of replacement levels. These should be unique
strings with no missing values.
Alternatively a single string containing an existing level in
this object. The new levels are defined as a permutation of the
existing levels where the provided string is now the first
level. The order of all other levels is preserved.
-
in_place (bool) β Whether to perform this modification in-place.
+
in_place (bool) β Whether to perform this modification in-place.
Generic assign that checks if the objects are n-dimensional for n > 1 (i.e.
+has a shape property of length greater than 1); if so, it calls
+assign_rows() to assign them along the
+first dimension, otherwise it assumes that they are vector-like and calls
+assign_sequence() instead.
Assign replacement values to a copy of x at the rows specified by
+indices. This defaults to creating a deep copy of x and then
+assigning replacement to the first dimension of the copy.
indices (Sequence[int]) β Sequence of non-negative integers specifying rows of x.
+
replacement (Any) β Replacement values to be assigned to x. This should have the
+same number of rows as the length of indices. Typically
+replacement will have the same dimensionality as x.
Assign replacement values to a copy of x at the specified indices.
+This defaults to creating a deep copy of x and then iterating through
+indices to assign the values of replacement.
+
+
Parameters:
+
+
x (Any) β Any sequence-like object that can be assigned.
+
indices (Sequence[int]) β Sequence of non-negative integers specifying positions on x.
+
replacement (Any) β Replacement values to be assigned to x. This should have the
+same length as indices.
x (Sequence) β A sequence of hashable values.
Any value may be None to indicate missingness.
-
levels (Optional[Sequence]) β Sequence of reference levels, against which the entries in x are compared.
+
levels (Optional[Sequence]) β Sequence of reference levels, against which the entries in x are compared.
If None, this defaults to all unique values of x.
-
sort_levels (bool) β Whether to sort the automatically-determined levels.
+
sort_levels (bool) β Whether to sort the automatically-determined levels.
If False, the levels are kept in order of their appearance in x.
Not used if levels is explicitly supplied.
x (Sequence) β Zero, one or more sequences of interest containing hashable values.
+
x (Sequence) β Zero, one or more sequences of interest containing hashable values.
We ignore missing values as defined by
is_missing_scalar().
-
duplicate_method (Literal['first', 'last']) β Whether to keep the first or last occurrence of duplicated values
+
duplicate_method (Literal['first', 'last']) β Whether to keep the first or last occurrence of duplicated values
when preserving order in the first sequence.
truncated_to (int) β Number of elements to truncate to, at the start and end of the list
+
truncated_to (int) β Number of elements to truncate to, at the start and end of the list
or dictionary. This should be less than half of full_threshold.
-
full_threshold (int) β Threshold on the number of elements, below which the list or
+
full_threshold (int) β Threshold on the number of elements, below which the list or
dictionary is shown in its entirety.
truncated_to (int) β Number of elements to truncate to, at the start and end of the
sequence. This should be less than half of full_threshold.
-
full_threshold (int) β Threshold on the number of elements, below which the list is
+
full_threshold (int) β Threshold on the number of elements, below which the list is
shown in its entirety.
-
transform (Optional[Callable]) β Optional transformation to apply to the values of x after
+
transform (Optional[Callable]) β Optional transformation to apply to the values of x after
truncation but before printing. Defaults to
print_truncated() if not supplied.
-
sep (str) β Separator between elements in the printed list.
-
include_brackets (bool) β Whether to include the start/end brackets.
+
sep (str) β Separator between elements in the printed list.
+
include_brackets (bool) β Whether to include the start/end brackets.
truncated_to (int) β Number of elements to truncate to, at the start and end of the
list. This should be less than half of full_threshold.
-
full_threshold (int) β Threshold on the number of elements, below which the list is
+
full_threshold (int) β Threshold on the number of elements, below which the list is
shown in its entirety.
-
transform (Optional[Callable]) β Optional transformation to apply to the elements of x
+
transform (Optional[Callable]) β Optional transformation to apply to the elements of x
after truncation but before printing. Defaults to
print_truncated() if not supplied.
-
sep (str) β Separator between elements in the printed list.
-
include_brackets (bool) β Whether to include the start/end brackets.
+
sep (str) β Separator between elements in the printed list.
+
include_brackets (bool) β Whether to include the start/end brackets.
List of list of strings, where each inner list is the same length
and contains the visible contents of a column. Strings are
typically generated by calling repr() on data column values.
Callers are responsible for inserting ellipses, adding column type
information (e.g., with print_type()) or truncating long
strings (e.g., with truncate_strings()).
x (Sequence) β Zero, one or more sequences of interest containing hashable values.
+
x (Sequence) β Zero, one or more sequences of interest containing hashable values.
We ignore missing values as defined by
is_missing_scalar().
-
duplicate_method (Literal['first', 'last']) β Whether to take the first or last occurrence of each value in the
+
duplicate_method (Literal['first', 'last']) β Whether to take the first or last occurrence of each value in the
ordering of the output. If first, the first occurrence in the
earliest sequence of x is reported; if last, the last
occurrence in the latest sequence of x is reported.