emod_api.serialization.dtkFileTools module

Support for three formats of serialized population files: 1. “Original version”: single payload chunk with simulation and all nodes, uncompressed or snappy or LZ4 2. “First chunked version”: multiple payload chunks, one for simulation and one each for nodes 3. “Second chunked version”: multiple payload chunks, simulation and node objects are “root” objects in each chunk 4. “Metadata update”: compressed: true|false + engine: NONE|LZ4|SNAPPY replaced with compression: NONE|LZ4|SNAPPY

emod_api.serialization.dtkFileTools.uncompress(data, engine)[source]
emod_api.serialization.dtkFileTools.compress(data, engine)[source]
class emod_api.serialization.dtkFileTools.DtkHeader(dictionary={'author': 'unknown', 'bytecount': 0, 'chunkcount': 0, 'chunksizes': [], 'compressed': True, 'date': 'Wed Jun 29 19:21:03 2022', 'engine': 'LZ4', 'tool': 'dtkFileTools.py', 'version': 1})[source]

Bases: emod_api.serialization.dtkFileSupport.SerialObject

class emod_api.serialization.dtkFileTools.DtkFile(header)[source]

Bases: object

class Contents(parent)[source]

Bases: object

append(item)[source]
class Objects(parent)[source]

Bases: object

append(item)[source]
property header
property compressed
property compression
property byte_count
property chunk_count
property chunk_sizes
property author
property date
property tool
property version
property chunks
property nodes
class emod_api.serialization.dtkFileTools.DtkFileV1(header=None, filename='', handle=None)[source]

Bases: emod_api.serialization.dtkFileTools.DtkFile

property simulation
class emod_api.serialization.dtkFileTools.DtkFileV2(header=None, filename='', handle=None)[source]

Bases: emod_api.serialization.dtkFileTools.DtkFile

class NodesV2(parent)[source]

Bases: object

property simulation
class emod_api.serialization.dtkFileTools.DtkFileV3(header=None, filename='', handle=None)[source]

Bases: emod_api.serialization.dtkFileTools.DtkFile

class NodesV3(parent)[source]

Bases: object

property simulation
class emod_api.serialization.dtkFileTools.DtkFileV4(header=None, filename='', handle=None)[source]

Bases: emod_api.serialization.dtkFileTools.DtkFileV3

emod_api.serialization.dtkFileTools.read(filename)[source]
emod_api.serialization.dtkFileTools.write(dtk_file, filename)[source]