The reading and writing of the files is done by subclasses of the FileFormatProcessor class.
Abstract base class of all fileformat processors
All classes providing loading or storing of files should be subclasses of this base class.
Every subclass must support the filename, set and format arguments. The arguments must all be optional.
Parameters: |
|
---|---|
Attribute provided_formats: | |
list of strings of the formats provided by the processor |
Extra attributes to store with the data set. Some formats (moste notably the amuse native format) can store extra attributes with the set in file. The ‘write_set_to_file’ function will collect all keyword arguments that do not match to an option into the extra attributes dictionary.
Yields tuples, each tuple contains the name of the option, a description of the option and the default values
Loads the set from the file and returns the set.
Register this class, so that it can be found by name int the write_set_to_file() and read_set_from_file() functions.
Stores the set in the file. The set and the file are both properties of the processor.
Abstract base class of all fileformat processors that process their data by first reading the complete text string
Subclasses need to implement the store_string() and load_string() methods.
Return a particle set, read from the string
Return a string representation of the particle set