irradiapy.io package
Submodules
irradiapy.io.bzip2lammpsreader module
This module contains the BZIP2LAMMPSReader class.
- class irradiapy.io.bzip2lammpsreader.BZIP2LAMMPSReader(file_path, encoding='utf-8')[source]
Bases:
objectA class to read data from a bzip2-compressed LAMMPS dump file.
Note
Assumed orthogonal simulation box.
Note
If you only need to decompress a file, use irradiapy.io.io_utils.decompress_file_bz2 instead.
- file_path
The path to the bzip2-compressed LAMMPS dump file.
- Type:
Path
-
file_path:
Path
irradiapy.io.bzip2lammpswriter module
This module contains the BZIP2LAMMPSWriter class.
- class irradiapy.io.bzip2lammpswriter.BZIP2LAMMPSWriter(file_path, mode='wt', excluded_items=<factory>, encoding=<factory>, int_format=<factory>, float_format=<factory>, compresslevel=9)[source]
Bases:
objectA class to write data like a LAMMPS dump file, but compressed with bzip2.
Note
If you only need to compress a file, use irradiapy.io.io_utils.compress_file_bz2 instead.
- file_path
The path to the bzip2-compressed LAMMPS dump file.
- Type:
Path
- excluded_items
Atom fields to exclude from output.
-
file_path:
Path
irradiapy.io.lammpslogreader module
Class to read LAMMPS log files.
- class irradiapy.io.lammpslogreader.LAMMPSLogReader(path_log)[source]
Bases:
objectClass to read LAMMPS log files.
- Parameters:
path_log (Path) – The path to the LAMMPS log file.
- Yields:
Generator[dict[str, Any], None, None] – A dictionary containing the thermo data.
Note
This generator yields a dictionary with a single key for the thermo data, this ensures compatibility if this reader is extended to read more data in the future.
-
path_log:
Path
irradiapy.io.lammpsreader module
This module contains the LAMMPSReader class.
irradiapy.io.lammpsreadermpi module
This module contains the LAMMPSReaderMPI class.
- class irradiapy.io.lammpsreadermpi.LAMMPSReaderMPI(file_path, encoding='utf-8', comm=<factory>)[source]
Bases:
MPIExceptionHandlerMixinA class to read data from a LAMMPS dump file in parallel using MPI.
Note
Assumed orthogonal simulation box.
- file_path
The path to the LAMMPS dump file.
- Type:
Path
- comm
The MPI communicator.
- Type:
MPI.Comm, optional (default=mpi4py.MPI.COMM_WORLD)
-
comm:
Comm
-
file_path:
Path
irradiapy.io.lammpswriter module
This module contains the LAMMPSWriter class.
- class irradiapy.io.lammpswriter.LAMMPSWriter(file_path, mode='w', excluded_items=<factory>, encoding=<factory>, int_format=<factory>, float_format=<factory>)[source]
Bases:
objectA class to write data like a LAMMPS dump file.
- file_path
The path to the LAMMPS dump file.
- Type:
Path
- excluded_items
Atom fields to exclude from output.
-
file_path:
Path
irradiapy.io.lammpswritermpi module
This module contains the LAMMPSWriterMPI class.
- class irradiapy.io.lammpswritermpi.LAMMPSWriterMPI(file_path, mode='w', excluded_items=<factory>, encoding=<factory>, int_format=<factory>, float_format=<factory>, comm=<factory>)[source]
Bases:
MPIExceptionHandlerMixinA class to write data like a LAMMPS dump file in parallel using MPI.
- file_path
The path to the LAMMPS dump file.
- Type:
Path
- excluded_items
Atom fields to exclude from output.
- comm
The MPI communicator.
- Type:
MPI.Comm, optional (default=mpi4py.MPI.COMM_WORLD)
-
comm:
Comm
-
file_path:
Path
irradiapy.io.xyzreader module
This module contains the XYZReader class.
- class irradiapy.io.xyzreader.XYZReader(file_path, encoding='utf-8')[source]
Bases:
objectA class to read data from an extended XYZ file.
- file_path
The path to the XYZ file.
- Type:
Path
- dtype
The data type of the properties in the file. By default, it is set to None and will be determined from the file.
- Type:
npt.DTypeLike
-
dtype:
Union[type[Any],dtype[Any],_SupportsDType[dtype[Any]],tuple[Any,Any],list[Any],_DTypeDict,str,None] = None
-
file_path:
Path
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:
objectClass for writing structured data to an XYZ file format.
- Parameters:
file_path (Path) – Path to the file where data will be written.
mode (str, optional (default="w")) – File open mode.
encoding (str, optional (default=irradiapy.config.ENCODING)) – The file encoding.
int_format (str, optional (default=irradiapy.config.INT_FORMAT)) – Format for integers.
float_format (str, optional (default=irradiapy.config.FLOAT_FORMAT)) – Format for floats.
-
file_path:
Path
Module contents
This subpackage provides classes for reading and writing various file formats.