Skip to content

Commit 0d427f4

Browse files
committed
add missing docstrings
1 parent 5cc92f5 commit 0d427f4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/bids_validator/context.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ def from_file(cls, file: FileTree, schema: Namespace) -> t.Self:
299299
extension=extension,
300300
)
301301

302+
302303
@attrs.define
303304
class Context:
305+
"""A context object that creates context for file on access."""
304306

305307
file: FileTree
306308
dataset: Dataset
@@ -316,67 +318,83 @@ def schema(self) -> Namespace:
316318

317319
@property
318320
def path(self) -> str:
321+
"""Path of the current file."""
319322
return self.file_parts.path
320323

321324
@property
322325
def entities(self) -> dict[str, str] | None:
326+
"""Entities parsed from the current filename."""
323327
return self.file_parts.entities
324328

325329
@property
326330
def datatype(self) -> str | None:
331+
"""Datatype of current file, for examples, anat."""
327332
return self.file_parts.datatype
328333

329334
@property
330335
def suffix(self) -> str | None:
336+
"""Suffix of current file."""
331337
return self.file_parts.suffix
332338

333339
@property
334340
def extension(self) -> str | None:
341+
"""Extension of current file including initial dot."""
335342
return self.file_parts.extension
336343

337344
@property
338345
def modality(self) -> str | None:
346+
"""Modality of current file, for examples, MRI."""
339347
modalities = self.schema.rules.modalities
340348
for mod_name, mod_dtypes in modalities.items():
341349
if self.datatype in mod_dtypes.datatypes:
342350
return mod_name
343351

344352
@property
345353
def size(self) -> int:
354+
"""Length of the current file in bytes."""
346355
return self.file.direntry.stat().st_size
347356

348357
@property
349358
def subject(self) -> ctx.Subject | None:
359+
"""Properties and contents of the current subject."""
350360
return ctx.Subject()
351361

352362
@property
353363
def associations(self) -> ctx.Associations:
364+
"""Associated files, indexed by suffix, selected according to the inheritance principle."""
354365
return ctx.Associations()
355366

356367
@property
357368
def columns(self) -> None:
369+
"""TSV columns, indexed by column header, values are arrays with column contents."""
358370
pass
359371

360372
@property
361373
def json(self) -> None:
374+
"""Contents of the current JSON file."""
362375
pass
363376

364377
@property
365378
def gzip(self) -> None:
379+
"""Parsed contents of gzip header."""
366380
pass
367381

368382
@property
369383
def nifti_header(self) -> None:
384+
"""Parsed contents of NIfTI header referenced elsewhere in schema."""
370385
pass
371386

372387
@property
373388
def ome(self) -> None:
389+
"""Parsed contents of OME-XML header, which may be found in OME-TIFF or OME-ZARR files."""
374390
pass
375391

376392
@property
377393
def tiff(self) -> None:
394+
"""TIFF file format metadata."""
378395
pass
379396

380397
@property
381398
def sidecar(self) -> None:
399+
"""Sidecar metadata constructed via the inheritance principle."""
382400
pass

0 commit comments

Comments
 (0)