Skip to content

Commit 415c32b

Browse files
Add some missing parameter docstrings (#245)
* docstr typos, style nits * add missing arg docstrs
1 parent 3e52505 commit 415c32b

4 files changed

Lines changed: 46 additions & 6 deletions

File tree

python-spec/src/somacore/data.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def create(
8484
the minimum and maximum possible values for the column's
8585
datatype. This makes a dataframe growable.
8686
87+
platform_config: platform-specific configuration; keys are SOMA
88+
implementation names.
89+
90+
context: Other implementation-specific configuration.
91+
8792
Returns:
8893
The newly created dataframe, opened for writing.
8994
@@ -326,6 +331,8 @@ def read(
326331
a partitioned read, and which part of the data to include.
327332
result_order: the order to return results, specified as a
328333
:class:`~options.ResultOrder` or its string value.
334+
platform_config: platform-specific configuration; keys are SOMA
335+
implementation names.
329336
330337
Returns: The data over the requested range as a tensor.
331338
@@ -426,6 +433,8 @@ def read(
426433
and which partition to include, if present.
427434
result_order: the order to return results, specified as a
428435
:class:`~options.ResultOrder` or its string value.
436+
platform_config: platform-specific configuration; keys are SOMA
437+
implementation names.
429438
430439
Returns: The data that was requested in a :class:`SparseRead`,
431440
allowing access in any supported format.
@@ -479,6 +488,8 @@ def write(
479488
480489
Arrow table: a COO table, with columns named ``soma_dim_0``,
481490
..., ``soma_dim_N`` and ``soma_data``.
491+
platform_config: platform-specific configuration; keys are SOMA
492+
implementation names.
482493
483494
Returns: ``self``, to enable method chaining.
484495

python-spec/src/somacore/query/axis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ class AxisQuery:
7272
7373
AxisQuery() # all data
7474
AxisQuery(coords=()) # also all data
75-
AxisQuery(coords=(slice(1,10),)) # 1D, slice
76-
AxisQuery(coords=([0,1,2])) # 1D, point indexing using array-like
77-
AxisQuery(coords=(slice(None), numpy.array([0,88,1001]))) # 2D
75+
AxisQuery(coords=(slice(1, 10),)) # 1D, slice
76+
AxisQuery(coords=([0, 1, 2])) # 1D, point indexing using array-like
77+
AxisQuery(coords=(slice(None), numpy.array([0, 88, 1001]))) # 2D
7878
AxisQuery(value_filter="tissue == 'lung'")
7979
AxisQuery(coords=(slice(1,None),), value_filter="tissue == 'lung'")
8080

python-spec/src/somacore/query/query.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ def X(
223223
and which partition to include, if present.
224224
result_order: the order to return results, specified as a
225225
:class:`~options.ResultOrder` or its string value.
226+
platform_config: platform-specific configuration; keys are SOMA
227+
implementation names.
226228
227229
Lifecycle: maturing
228230
"""
@@ -539,7 +541,7 @@ def _read_axis_dataframe(
539541

540542
# Do the actual query.
541543
arrow_table = axis_df.read(
542-
axis_query.coords,
544+
coords=axis_query.coords,
543545
value_filter=axis_query.value_filter,
544546
column_names=query_columns,
545547
).concat()
@@ -679,7 +681,7 @@ class _AxisQueryResult:
679681
var: pd.DataFrame
680682
"""Experiment.ms[...].var query slice, as a pandas DataFrame"""
681683
X: sparse.csr_matrix
682-
"""Experiment.ms[...].X[...] query slice, as an SciPy sparse.csr_matrix """
684+
"""Experiment.ms[...].X[...] query slice, as a SciPy sparse.csr_matrix """
683685
X_layers: Dict[str, sparse.csr_matrix] = attrs.field(factory=dict)
684686
"""Any additional X layers requested, as SciPy sparse.csr_matrix(s)"""
685687
obsm: Dict[str, np.ndarray] = attrs.field(factory=dict)

python-spec/src/somacore/spatial.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def create(
9393
or if ``None`` in a given dimension, the corresponding index-column
9494
domain will use the minimum and maximum possible values for the
9595
column's datatype. This makes a point cloud dataframe growable.
96+
platform_config: platform-specific configuration; keys are SOMA
97+
implementation names.
98+
context: Other implementation-specific configuration.
9699
97100
Returns:
98101
The newly created geometry dataframe, opened for writing.
@@ -122,6 +125,8 @@ def read(
122125
Defaults to ``()``, meaning no constraint -- all IDs.
123126
column_names: the named columns to read and return.
124127
Defaults to ``None``, meaning no constraint -- all column names.
128+
batch_size: The size of batches that should be returned from a read.
129+
See :class:`options.BatchSize` for details.
125130
partitions: If present, specifies that this is part of
126131
a partitioned read, and which part of the data to include.
127132
result_order: the order to return results, specified as a
@@ -130,6 +135,8 @@ def read(
130135
The default of ``None`` represents no filter. Value filter
131136
syntax is implementation-defined; see the documentation
132137
for the particular SOMA implementation for details.
138+
platform_config: platform-specific configuration; keys are SOMA
139+
implementation names.
133140
Returns:
134141
A :class:`ReadIter` of :class:`pa.Table`s.
135142
@@ -177,6 +184,8 @@ def read_spatial_region(
177184
The default of ``None`` represents no filter. Value filter
178185
syntax is implementation-defined; see the documentation
179186
for the particular SOMA implementation for details.
187+
platform_config: platform-specific configuration; keys are SOMA
188+
implementation names.
180189
181190
Returns:
182191
A :class:`SpatialRead` with :class:`ReadIter` of :class:`pa.Table`s data.
@@ -201,6 +210,8 @@ def write(
201210
values: An Arrow table containing all columns, including
202211
the index columns. The schema for the values must match
203212
the schema for the ``DataFrame``.
213+
platform_config: platform-specific configuration; keys are SOMA
214+
implementation names.
204215
205216
Returns: ``self``, to enable method chaining.
206217
@@ -323,6 +334,9 @@ def create(
323334
the corresponding index-column domain will use the minimum and maximum
324335
possible values for the column's datatype. This makes a dataframe
325336
growable.
337+
platform_config: platform-specific configuration; keys are SOMA
338+
implementation names.
339+
context: Other implementation-specific configuration.
326340
327341
Returns:
328342
The newly created geometry dataframe, opened for writing.
@@ -352,6 +366,8 @@ def read(
352366
Defaults to ``()``, meaning no constraint -- all IDs.
353367
column_names: the named columns to read and return.
354368
Defaults to ``None``, meaning no constraint -- all column names.
369+
batch_size: The size of batches that should be returned from a read.
370+
See :class:`options.BatchSize` for details.
355371
partitions: If present, specifies that this is part of
356372
a partitioned read, and which part of the data to include.
357373
result_order: the order to return results, specified as a
@@ -360,6 +376,8 @@ def read(
360376
The default of ``None`` represents no filter. Value filter
361377
syntax is implementation-defined; see the documentation
362378
for the particular SOMA implementation for details.
379+
platform_config: platform-specific configuration; keys are SOMA
380+
implementation names.
363381
Returns:
364382
A :class:`ReadIter` of :class:`pa.Table`s.
365383
@@ -407,6 +425,8 @@ def read_spatial_region(
407425
The default of ``None`` represents no filter. Value filter
408426
syntax is implementation-defined; see the documentation
409427
for the particular SOMA implementation for details.
428+
platform_config: platform-specific configuration; keys are SOMA
429+
implementation names.
410430
411431
Returns:
412432
A :class:`SpatialRead` with :class:`ReadIter` of :class:`pa.Table`s data.
@@ -431,6 +451,8 @@ def write(
431451
values: An Arrow table containing all columns, including
432452
the index columns. The schema for the values must match
433453
the schema for the ``DataFrame``.
454+
platform_config: platform-specific configuration; keys are SOMA
455+
implementation names.
434456
435457
Returns: ``self``, to enable method chaining.
436458
@@ -553,7 +575,7 @@ def create(
553575
SOMADenseNDArray it must match have the shape provided by
554576
``level_shape`` and type specified in ``type. If set to ``None``, the
555577
``level_key`` will be used to construct a default child URI. For more
556-
on URIs see :meth:`collection.Collection.add_new_collction`.
578+
on URIs see :meth:`collection.Collection.add_new_collection`.
557579
coordinate_space: Either the coordinate space or the axis names for the
558580
coordinate space the ``level=0`` image is defined on. This does not
559581
include the channel dimension, only spatial dimensions.
@@ -562,6 +584,9 @@ def create(
562584
axis is provided, this defaults to the channel axis followed by the
563585
coordinate space axes in reverse order (e.g.
564586
``("soma_channel", "y", "x")`` if ``coordinate_space=("x", "y")``).
587+
platform_config: platform-specific configuration; keys are SOMA
588+
implementation names.
589+
context: Other implementation-specific configuration.
565590
566591
Returns:
567592
The newly created collection, opened for writing.
@@ -662,6 +687,8 @@ def read_spatial_region(
662687
:class:`~options.ResultOrder` or its string value. This is the result
663688
order the data is read from disk. It may be permuted if
664689
``data_axis_order`` is not the default order.
690+
platform_config: platform-specific configuration; keys are SOMA
691+
implementation names.
665692
666693
Returns:
667694
The data bounding the requested region as a :class:`SpatialRead` with

0 commit comments

Comments
 (0)