Skip to content

Commit

Permalink
[python/r] Update docstrings for domain argument to create
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Dec 3, 2024
1 parent 0ce5ac9 commit 062008d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
26 changes: 16 additions & 10 deletions apis/python/src/tiledbsoma/_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,22 @@ def create(
index column name is required.
domain:
An optional sequence of tuples specifying the domain of each
index column. Each tuple should be a pair consisting of the minimum and
maximum values storable in the index column. For example, if there is a
single int64-valued index column, then ``domain`` might be ``[(100,
200)]`` to indicate that values between 100 and 200, inclusive, can be
stored in that column. If provided, this sequence must have the same
length as ``index_column_names``, and the index-column domain will be as
specified. If omitted entirely, or if ``None`` in a given dimension,
the corresponding index-column domain will use the minimum and maximum
possible values for the column's datatype. This makes a
:class:`DataFrame` growable.
index column. Each tuple must be a pair consisting of the
minimum and maximum values storable in the index column. For
example, if there is a single int64-valued index column, then
``domain`` might be ``[(100, 200)]`` to indicate that values
between 100 and 200, inclusive, can be stored in that column.
If provided, this sequence must have the same length as
``index_column_names``, and the index-column domain will be as
specified. If omitted entirely, or if ``None`` in a given
dimension, the corresponding index-column domain will use the
smallest possible values for the column's datatype, and data
writes after that will fail with "A range was set outside of the
current domain". Unless you have a particular reason not to, you
should always provide the desired `domain` at create time: this
is an optional but strongly recommended parameter. See also
``change_domain`` which allows you to expand the domain after
create.
platform_config:
Platform-specific options used to create this array.
This may be provided as settings in a dictionary, with options
Expand Down
23 changes: 15 additions & 8 deletions apis/r/R/SOMADataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ SOMADataFrame <- R6::R6Class(
#' @param index_column_names A vector of column names to use as user-defined
#' index columns. All named columns must exist in the schema, and at least
#' one index column name is required.
#' @param domain An optional list of 2-element vectors specifying the domain of each index
#' column. Each vector should be a pair consisting of the minimum and maximum values storable in
#' the index column. For example, if there is a single int64-valued index column, then `domain`
#' might be `c(100, 200)` to indicate that values between 100 and 200, inclusive, can be stored
#' in that column. If provided, this list must have the same length as `index_column_names`,
#' and the index-column domain will be as specified. If omitted entirely, or if `NULL` in a given
#' dimension, the corresponding index-column domain will use the minimum and maximum possible
#' values for the column's datatype. This makes a `DataFrame` growable.
#' @param domain An optional sequence of tuples specifying the domain of each
#' index column. Each tuple must be a pair consisting of the minimum and
#' maximum values storable in the index column. For example, if there is a
#' single int64-valued index column `soma_joinid`, then `domain` might be
#' `list(soma_joinid=c(100, 200))` to indicate that values between 100 and
#' 200, inclusive, can be stored in that column. If provided, this sequence
#' must have the same length as `index_column_names`, and the index-column
#' domain will be as specified. If omitted entirely, or if `NULL` in a given
#' dimension, the corresponding index-column domain will use the smallest
#' possible values for the column's datatype, and data writes after that will
#' fail with "A range was set outside of the current domain". Unless you have
#' a particular reason not to, you should always provide the desired `domain`
#' at create time: this is an optional but strongly recommended parameter.
#' See also `change_domain` which allows you to expand the domain after
#' create.
#' @template param-platform-config
#' @param internal_use_only Character value to signal this is a 'permitted' call,
#' as `create()` is considered internal and should not be called directly.
Expand Down

0 comments on commit 062008d

Please sign in to comment.