irradiapy.io.xyzwriter module

This module contains the XYZWriter class.

class irradiapy.io.xyzwriter.XYZWriter(file_path, mode='w', encoding=<factory>, int_format=<factory>, float_format=<factory>)[source]

Bases: object

Class for writing structured data to an XYZ file format.

Parameters:
  • file_path (Path) – Path to the file where data will be written.

  • mode (str) – File open mode.

  • encoding (str) – The file encoding.

  • int_format (str) – Format for integers.

  • float_format (str) – Format for floats.

close()[source]

Close the file associated with this writer.

Return type:

None

encoding: str
file: TextIO = None
file_path: Path
float_format: str
int_format: str
mode: str = 'w'
write(datas, extra_comment='')[source]

Writes the given data into the file.

Parameters:
  • datas (NDArray) – Data to write.

  • extra_comment (str) – Additional info to add at the end of the comment. Must follow xyz guidelines. For example: ‘Info=”Fe irradiated in Fe, Ion 1”’

Return type:

None