opi.output.cube¶
Classes¶
Class that stores the path to a cube file and provides easy access to the cube |
Module Contents¶
- class opi.output.cube.CubeOutput(path)¶
Class that stores the path to a cube file and provides easy access to the cube data via the cube property. Reads the cube file upon access to cube property.
- Parameters:
path (pathlib.Path)
- property path: pathlib.Path¶
Read only access to the path.
- Return type:
pathlib.Path
- property cube: str¶
Reads the cube data from file at stored path and returns it as string.
- Returns:
Returns a string with the cube data.
- Return type:
str
- Raises:
FileNotFoundError -- If the cube file does not exist.
- __iter__()¶
Lazily yields lines from the cube file (memory efficient).
- Returns:
Iterator that yields the cube data line by line.
- Return type:
Iterator[str]
- Raises:
FileNotFoundError -- If the cube file does not exist.
- __str__()¶
Returns the name of the class and the path the object holds
- Return type:
str