from_file

method of dascore.core.spool.Spool source

from_file(
    path ,
    file_format: str | None[str, None] = None,
    file_version: str | None[str, None] = None,
)-> ‘Self’

Create a spool over a single (multi-patch capable) fiber file.

The file is scanned once; patches load lazily per row.

Parameters

Parameter Description
path The file to open.
file_format The format name, sniffed from the file when not given.
file_version The format version, sniffed from the file when not given.
Note

A format and version given together are believed rather than checked against the file, as dc.read and dc.scan believe them. Naming the wrong format therefore yields whatever that reader makes of the file, which is usually an empty spool.