lapy.io¶
Functions to read and write spectra and vertex functions.
- lapy.io.read_ev(filename)[source]¶
Load EV file.
- Parameters:
- filename
str Filename of input.
- filename
- Returns:
dictDictionary of eigenvalues, eigenvectors (optional), and associated information. Contains keys like ‘Eigenvalues’ (np.ndarray), ‘Eigenvectors’ (np.ndarray, optional), and metadata fields.
- Raises:
OSErrorIf file is not readable.
- Parameters:
filename (str)
- Return type:
- lapy.io.read_vfunc(filename)[source]¶
Import vertex functions from txt file.
Values can be separated by
;or,and surrounded by{}or()brackets. Also first line can have the keyword “Solution:”, i.e. the PSOL format from ShapeDNA.
- lapy.io.write_ev(filename, d)[source]¶
Save EV data structures as txt file (format from ShapeDNA).
- Parameters:
- Raises:
OSErrorIf file is not writable.
ValueErrorIf ‘Eigenvalues’ key is missing from dictionary.
- Parameters:
- Return type:
None
- lapy.io.write_vfunc(filename, vfunc)[source]¶
Save vertex function in PSOL txt file.
First line “Solution:”, “,” separated values inside ()
- Parameters:
- filename
str Filename to save to.
- vfunc
np.ndarray Array of vfunc parameters, shape (n_vertices,).
- filename
- Raises:
OSErrorIf file is not writable.
- Parameters:
- Return type:
None