pytornado.fileio.native package¶
Submodules¶
pytornado.fileio.native.aircraft module¶
Functions for reading and writing of PyTornado aircraft definition file.
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.native.aircraft.dump_pretty_json(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=<class 'pytornado.fileio.utils.NDArrayEncoder'>, indent=4, separators=(', ', ': '), default=None, sort_keys=False, **kw)¶ Serialize
objas a JSON formatted stream tofp(a.write()-supporting file-like object).If
skipkeysis true thendictkeys that are not basic types (str,int,float,bool,None) will be skipped instead of raising aTypeError.If
ensure_asciiis false, then the strings written tofpcan contain non-ASCII characters if they appear in strings contained inobj. Otherwise, all such characters are escaped in JSON strings.If
check_circularis false, then the circular reference check for container types will be skipped and a circular reference will result in anOverflowError(or worse).If
allow_nanis false, then it will be aValueErrorto serialize out of rangefloatvalues (nan,inf,-inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN,Infinity,-Infinity).If
indentis a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.Noneis the most compact representation.If specified,
separatorsshould be an(item_separator, key_separator)tuple. The default is(', ', ': ')if indent isNoneand(',', ': ')otherwise. To get the most compact JSON representation, you should specify(',', ':')to eliminate whitespace.default(obj)is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False), then the output of dictionaries will be sorted by key.To use a custom
JSONEncodersubclass (e.g. one that overrides the.default()method to serialize additional types), specify it with theclskwarg; otherwiseJSONEncoderis used.
-
pytornado.fileio.native.aircraft.load(settings)¶ Read aircraft model from PyTornado aircraft definition file.
Searches for file ‘aircraft.*’ in the ‘aircraft’ folder of the WKDIR.
- Args:
settings: (object) data structure for execution settings - Returns:
aircraft: (object) data structure for aircraft model
-
pytornado.fileio.native.aircraft.save(aircraft, settings)¶ Retrieve data from aircraft model and serialise
- Args:
aircraft: (object) data structure for aircraft settings: (object) data structure for execution settings
pytornado.fileio.native.deformation module¶
Reading the aircraft deformation file.
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.native.deformation.load(aircraft, settings)¶ Loads the aircraft deformation file if it exitsts.
- Args:
aircraft: (obj) aircraft settings: (obj) settings
pytornado.fileio.native.results module¶
Functions for writing of PyTornado VLM results.
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.native.results.dump_pretty_json(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=<class 'pytornado.fileio.utils.NDArrayEncoder'>, indent=4, separators=(', ', ': '), default=None, sort_keys=False, **kw)¶ Serialize
objas a JSON formatted stream tofp(a.write()-supporting file-like object).If
skipkeysis true thendictkeys that are not basic types (str,int,float,bool,None) will be skipped instead of raising aTypeError.If
ensure_asciiis false, then the strings written tofpcan contain non-ASCII characters if they appear in strings contained inobj. Otherwise, all such characters are escaped in JSON strings.If
check_circularis false, then the circular reference check for container types will be skipped and a circular reference will result in anOverflowError(or worse).If
allow_nanis false, then it will be aValueErrorto serialize out of rangefloatvalues (nan,inf,-inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN,Infinity,-Infinity).If
indentis a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.Noneis the most compact representation.If specified,
separatorsshould be an(item_separator, key_separator)tuple. The default is(', ', ': ')if indent isNoneand(',', ': ')otherwise. To get the most compact JSON representation, you should specify(',', ':')to eliminate whitespace.default(obj)is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False), then the output of dictionaries will be sorted by key.To use a custom
JSONEncodersubclass (e.g. one that overrides the.default()method to serialize additional types), specify it with theclskwarg; otherwiseJSONEncoderis used.
-
pytornado.fileio.native.results.save_aeroperformance_map(state, settings)¶ Save the aeroperformance map
- Args:
state: (object) data structure for operating conditions settings: (object) data structure for execution settings
-
pytornado.fileio.native.results.save_all(settings, aircraft, state, vlmdata)¶ Evaluate all ‘save’ settings and create result files
- Args:
settings: settings instance aircraft: (object) data structure for aircraft model state: (object) data structure for operating conditions vlmdata: (object) data structure for VLM calculation data lattice: (object) data structure for VLM lattice
pytornado.fileio.native.settings module¶
Functions for reading and writing of PyTornado execution settings file.
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.native.settings.clean_dict(dictionary, to_del='_')¶ Delete dictionary items with keys starting with specified string
Works recursively
- Args:
dictionary: Dictionary object to_del: Starts-with identifier
-
pytornado.fileio.native.settings.dump_pretty_json(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=<class 'pytornado.fileio.utils.NDArrayEncoder'>, indent=4, separators=(', ', ': '), default=None, sort_keys=False, **kw)¶ Serialize
objas a JSON formatted stream tofp(a.write()-supporting file-like object).If
skipkeysis true thendictkeys that are not basic types (str,int,float,bool,None) will be skipped instead of raising aTypeError.If
ensure_asciiis false, then the strings written tofpcan contain non-ASCII characters if they appear in strings contained inobj. Otherwise, all such characters are escaped in JSON strings.If
check_circularis false, then the circular reference check for container types will be skipped and a circular reference will result in anOverflowError(or worse).If
allow_nanis false, then it will be aValueErrorto serialize out of rangefloatvalues (nan,inf,-inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN,Infinity,-Infinity).If
indentis a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.Noneis the most compact representation.If specified,
separatorsshould be an(item_separator, key_separator)tuple. The default is(', ', ': ')if indent isNoneand(',', ': ')otherwise. To get the most compact JSON representation, you should specify(',', ':')to eliminate whitespace.default(obj)is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False), then the output of dictionaries will be sorted by key.To use a custom
JSONEncodersubclass (e.g. one that overrides the.default()method to serialize additional types), specify it with theclskwarg; otherwiseJSONEncoderis used.
-
pytornado.fileio.native.settings.load(settings_filepath)¶ Read PyTornado settings from PyTornado settings file.
- Args:
settings: (object) data structure for execution settings
-
pytornado.fileio.native.settings.save(settings)¶ Write settings to native settings file
- Args:
settings: (object) data structure for execution settings
pytornado.fileio.native.state module¶
Functions for reading and writing of PyTornado flight state definition.
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.native.state.dump_pretty_json(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=<class 'pytornado.fileio.utils.NDArrayEncoder'>, indent=4, separators=(', ', ': '), default=None, sort_keys=False, **kw)¶ Serialize
objas a JSON formatted stream tofp(a.write()-supporting file-like object).If
skipkeysis true thendictkeys that are not basic types (str,int,float,bool,None) will be skipped instead of raising aTypeError.If
ensure_asciiis false, then the strings written tofpcan contain non-ASCII characters if they appear in strings contained inobj. Otherwise, all such characters are escaped in JSON strings.If
check_circularis false, then the circular reference check for container types will be skipped and a circular reference will result in anOverflowError(or worse).If
allow_nanis false, then it will be aValueErrorto serialize out of rangefloatvalues (nan,inf,-inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN,Infinity,-Infinity).If
indentis a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.Noneis the most compact representation.If specified,
separatorsshould be an(item_separator, key_separator)tuple. The default is(', ', ': ')if indent isNoneand(',', ': ')otherwise. To get the most compact JSON representation, you should specify(',', ':')to eliminate whitespace.default(obj)is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False), then the output of dictionaries will be sorted by key.To use a custom
JSONEncodersubclass (e.g. one that overrides the.default()method to serialize additional types), specify it with theclskwarg; otherwiseJSONEncoderis used.
-
pytornado.fileio.native.state.load(settings)¶ Read flight state from PyTornado state file.
Searches for file ‘state.*’ in the ‘state’ folder of the WKDIR.
- Args:
state: (object) data structure for operating conditions settings: (object) data structure for execution settings
-
pytornado.fileio.native.state.save(state, settings)¶ Write flight state to PyTornado state file.
- Args:
state: (object) data structure for operating conditions settings: (object) data structure for execution settings