lir.data package
Submodules
lir.data.io module
- class lir.data.io.DataFileBuilderCsv(path: Path, write_mode: str = 'w', write_header: bool | None = None)[source]
Bases:
objectDataFileBuilderCsv Class.
This class adds convenience methods to write data to an output CSV file.
- Parameters:
- add_column(data: ndarray, header_prefix: str = '', dimension_headers: dict[int, list[str]] | None = None) None[source]
Append data and corresponding headers to self._all_data and self._all_headers.
The data argument is an arbitrary numpy array. Its first dimension are the rows. Any other dimension will be columns in the CSV output.
of the data. Because dimension 0 corresponds to rows, it should have no headers
- lir.data.io.search_path(path: Path | str) Path[source]
Search the python path for a file.
If path is absolute, it is normalized by Path.resolve() and returned.
If path is relative, the file is searched in sys.path. The path is interpreted as relative to sys.path elements one by one, and if it exists, it is normalized by Path.resolve() and returned.
If the file is not found, it is normalized and made absolute by Path.resolve() and returned.
- Parameters:
path (Path | str) – Filesystem path used by this operation.
- Returns:
Absolute path to the resolved file location.
- Return type:
Path