python package for data utility functions
- Author
- T. Lukaczyk, F. Palacios
- Version
- 5.0.0 "Raven"
SU2 Original Developers: Dr. Francisco D. Palacios. Dr. Thomas D. Economon.
SU2 Developers: Prof. Juan J. Alonso's group at Stanford University. Prof. Piero Colonna's group at Delft University of Technology. Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. Prof. Alberto Guardone's group at Polytechnic University of Milan. Prof. Rafael Palacios' group at Imperial College London. Prof. Edwin van der Weide's group at the University of Twente. Prof. Vincent Terrapon's group at the University of Liege.
Copyright (C) 2012-2017 SU2, the open-source CFD code.
SU2 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
SU2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with SU2. If not, see http://www.gnu.org/licenses/.
| def SU2.io.data.load_data |
( |
|
file_name, |
|
|
|
var_names = None, |
|
|
|
file_format = 'infer', |
|
|
|
core_name = 'python_data' |
|
) |
| |
data = load_data( file_name, var_names=None ,
file_format = 'infer' ,
core_name = 'python_data' )
loads dictionary of data from python pickle or matlab struct
Inputs:
file_name - data file name
var_names - variable names to read
file_format - 'infer', 'pickle', or 'matlab'
core_name - data is stored under a dictionary with this name
default looks for variable 'python_data' in file_name
file_format = pickle, will return any python object
file_format = matlab, will return strings or float lists and
requires scipy.io.loadmat
file_format = infer (default), will infer format from extention
('.mat','.pkl')
| def SU2.io.data.save_data |
( |
|
file_name, |
|
|
|
data_dict, |
|
|
|
append = False, |
|
|
|
file_format = 'infer', |
|
|
|
core_name = 'python_data' |
|
) |
| |
save_data( file_name, data_dict, append=False ,
file_format = 'infer' ,
core_name='python_data' ):
Inputs:
file_name - data file name
data_dict - a dictionary or bunch to write
append - True/False to append existing data
file_format - 'infer', 'pickle', or 'matlab'
core_name - data is stored under a dictionary with this name
file_format = pickle, will save any pickleable python object
file_format = matlab, will save strings or float lists and
requires scipy.io.loadmat
file_format = infer (default), will infer format from extention
('.mat','.pkl')
matlab format saves data file from matlab 5 and later
will save nested dictionaries into nested matlab structures
cannot save classes and modules
uses scipy.io.loadmat