Skip to content

Commit 7c10dda

Browse files
committed
add missing docstrings
1 parent 5cc92f5 commit 7c10dda

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/bids_validator/context.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ def from_file(cls, file: FileTree, schema: Namespace) -> t.Self:
301301

302302
@attrs.define
303303
class Context:
304+
"""A context object that creates context for file on access."""
304305

305306
file: FileTree
306307
dataset: Dataset
@@ -316,67 +317,83 @@ def schema(self) -> Namespace:
316317

317318
@property
318319
def path(self) -> str:
320+
"""Path of the current file."""
319321
return self.file_parts.path
320322

321323
@property
322324
def entities(self) -> dict[str, str] | None:
325+
"""Entities parsed from the current filename."""
323326
return self.file_parts.entities
324327

325328
@property
326329
def datatype(self) -> str | None:
330+
"""Datatype of current file, for examples, anat."""
327331
return self.file_parts.datatype
328332

329333
@property
330334
def suffix(self) -> str | None:
335+
"""Suffix of current file."""
331336
return self.file_parts.suffix
332337

333338
@property
334339
def extension(self) -> str | None:
340+
"""Extension of current file including initial dot."""
335341
return self.file_parts.extension
336342

337343
@property
338344
def modality(self) -> str | None:
345+
"""Modality of current file, for examples, MRI."""
339346
modalities = self.schema.rules.modalities
340347
for mod_name, mod_dtypes in modalities.items():
341348
if self.datatype in mod_dtypes.datatypes:
342349
return mod_name
343350

344351
@property
345352
def size(self) -> int:
353+
"""Length of the current file in bytes."""
346354
return self.file.direntry.stat().st_size
347355

348356
@property
349357
def subject(self) -> ctx.Subject | None:
358+
"""Properties and contents of the current subject."""
350359
return ctx.Subject()
351360

352361
@property
353362
def associations(self) -> ctx.Associations:
363+
"""Associated files, indexed by suffix, selected according to the inheritance principle."""
354364
return ctx.Associations()
355365

356366
@property
357367
def columns(self) -> None:
368+
"""TSV columns, indexed by column header, values are arrays with column contents."""
358369
pass
359370

360371
@property
361372
def json(self) -> None:
373+
"""Contents of the current JSON file."""
362374
pass
363375

364376
@property
365377
def gzip(self) -> None:
378+
"""Parsed contents of gzip header."""
366379
pass
367380

368381
@property
369382
def nifti_header(self) -> None:
383+
"""Parsed contents of NIfTI header referenced elsewhere in schema."""
370384
pass
371385

372386
@property
373387
def ome(self) -> None:
388+
"""Parsed contents of OME-XML header, which may be found in OME-TIFF or OME-ZARR files."""
374389
pass
375390

376391
@property
377392
def tiff(self) -> None:
393+
"""TIFF file format metadata."""
378394
pass
379395

380396
@property
381397
def sidecar(self) -> None:
398+
"""Sidecar metadata constructed via the inheritance principle."""
382399
pass

0 commit comments

Comments
 (0)