saveVoro()

Description

saveVoro() is a function used to save the neighbors of each molecule and their composition in a file. The function will also save the centers of mass for each frame of the simulation.

The function can use several file format to store the data. Extensive details on the formats available can be read in the related tutorial.

The function only generates a file and does not have any other output.

Argument, keywords and outputs

Input(s) / Argument(s)

Name Flag  Type Description
Representation   class Tessellation Instance of the class Tessellation including the representation on the system and its Voronoi tessellation.
File path  file_path= str (Opt.) Path and name of the file to generate. File extension should be .xml, .h5 or .csv. By default, the name is autogenerated as “date_hour.csv” (e.g. 20201201_012345.csv)
Format format= str (Opt.) File extension and format to use for the output file. Should be “.xml”, “.h5” or “.csv”. Default is ‘.csv’

Examples

Save a tessellation with auto name and format

The following example will save one instance of the Tessellation class, voronoi, in a file with automatically generated name (using date formatting: YYMMDD_HHMMSS) and automatically picked extension/format (default: .csv)

import mllpa

mllpa.saveVoro(voronoi)

Save a tessellation with a given name

The following example will save one instance of the Tessellation class, voronoi, in a file named saved_tessellation.xml.

mllpa.saveVoro(voronoi, file_path="saved_tessellation.xml")

Save a tessellation with auto name but given format

The following example will save one instance of the Tessellation class, voronoi, in a file with automatically generated name (using date formatting: YYMMDD_HHMMSS) but with the chosen format HDF5 (.h5).

mllpa.saveVoro(voronoi, format=".h5")

The following tutorial(s) detail further the use of the saveVoro() function: