Skip to content

Commit b7a8008

Browse files
committed
Expand block model docstrings
1 parent 61fba85 commit b7a8008

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

pydatalab/schemas/cell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"definitions": {
177177
"DataBlockResponse": {
178178
"title": "DataBlockResponse",
179-
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.",
179+
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.\n\nIt is expected but not mandatory that this model will be extended by the specific block type\nwhere possible.",
180180
"type": "object",
181181
"properties": {
182182
"blocktype": {

pydatalab/schemas/equipment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"definitions": {
141141
"DataBlockResponse": {
142142
"title": "DataBlockResponse",
143-
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.",
143+
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.\n\nIt is expected but not mandatory that this model will be extended by the specific block type\nwhere possible.",
144144
"type": "object",
145145
"properties": {
146146
"blocktype": {

pydatalab/schemas/sample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
},
230230
"DataBlockResponse": {
231231
"title": "DataBlockResponse",
232-
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.",
232+
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.\n\nIt is expected but not mandatory that this model will be extended by the specific block type\nwhere possible.",
233233
"type": "object",
234234
"properties": {
235235
"blocktype": {

pydatalab/schemas/startingmaterial.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
},
283283
"DataBlockResponse": {
284284
"title": "DataBlockResponse",
285-
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.",
285+
"description": "A generic response model for a block, i.e., what is stored in `self.data`\nin the corresponding DataBlock class.\n\nIt is expected but not mandatory that this model will be extended by the specific block type\nwhere possible.",
286286
"type": "object",
287287
"properties": {
288288
"blocktype": {

pydatalab/src/pydatalab/models/blocks.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
class DataBlockResponse(BaseModel):
77
"""A generic response model for a block, i.e., what is stored in `self.data`
88
in the corresponding DataBlock class.
9+
10+
It is expected but not mandatory that this model will be extended by the specific block type
11+
where possible.
912
"""
1013

1114
blocktype: str
@@ -39,16 +42,20 @@ class DataBlockResponse(BaseModel):
3942
"""Any warnings that occurred during block processing."""
4043

4144
b64_encoded_image: dict[PyObjectId, str] | None
42-
"""Any base64-encoded image data associated with the block, keyed by file_id, if any."""
45+
"""Any base64-encoded image data associated with the block, keyed by `file_id`."""
4346

4447
bokeh_plot_data: dict | None
4548
"""A JSON-encoded string containing the Bokeh plot data, if any."""
4649

4750
processed_data: dict | None = None
48-
"""Any processed data associated with the block, small enough to store."""
51+
"""Any processed data associated with the block, small enough to store and filter directly in the database,
52+
i.e., strings or a few hundred numbers not exceeding 16KB in size.
53+
Examples could include peak positions, and widths, but not the full spectrum.
54+
"""
4955

5056
metadata: dict | None = None
51-
"""Any metadata associated with the block."""
57+
"""Any structured metadata associated with the block, for example,
58+
experimental acquisition parameters."""
5259

5360
class Config:
5461
allow_population_by_field_name = True

0 commit comments

Comments
 (0)