pymor.tools.io
¶
Submodules¶
Package Contents¶
Classes¶
Decorator for marking functions as deprecated. |
Functions¶
Load matrix from file. |
|
Save matrix to file. |
|
Cross~platform safe equivalent of re-opening a NamedTemporaryFile. |
|
Change current working directory to |
|
Attributes¶
- pymor.tools.io.load_matrix(path, key=None)[source]¶
Load matrix from file.
Parameters
- path
Path to the file (
str
orpathlib.Path
).- key
Key of the matrix (only for NPY, NPZ, and MATLAB files).
Returns
- matrix
Raises
- IOError
If loading fails.
- pymor.tools.io.save_matrix(path, matrix, key=None)[source]¶
Save matrix to file.
Parameters
- path
Path to the file (
str
orpathlib.Path
).- matrix
Matrix to save.
- key
Key of the matrix (only for NPY, NPZ, and MATLAB files).
Raises
- IOError
If saving fails.
- class pymor.tools.io.Deprecated(alt='no alternative given')[source]¶
Decorator for marking functions as deprecated.
It will result in a warning being emitted when the function is used.
- exception pymor.tools.io.IOLibsMissing(msg=None)[source]¶
Bases:
ImportError
Import can’t find module, or can’t find name in module.
- pymor.tools.io.safe_temporary_filename(name=None, parent_dir=None)[source]¶
Cross~platform safe equivalent of re-opening a NamedTemporaryFile.
Creates an automatically cleaned up temporary directory with a single file therein.
Parameters
- name
Filename component, defaults to ‘temp_file’.
- dir
The parent dir of the new temporary directory. Defaults to tempfile.gettempdir().