castepxbin is a collection of Python readers for various binary output files generated by CASTEP, a first-principles quantum mechanics code. It enables parsing of data like projected density of states (.pdos_bin), checkpoint files (.castep_bin), optical matrix elements (.ome_bin, .ome_cst), and wave functions (.check). The current version is 0.3.1, with releases occurring irregularly, primarily driven by new feature additions and compatibility fixes.
pip install castepxbinVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate a `PdosBinReader` to read a CASTEP `.pdos_bin` file and access common data such as eigenvalues and projected density of states (PDOS) weights. Remember to replace 'path_to_your_castep.pdos_bin' with the actual path to your CASTEP output file. Similar patterns apply to `CastepBinReader`, `OmeBinReader`, and `CheckReader` for their respective file types.
Upgrade to `castepxbin>=0.3.1` to ensure full compatibility with modern NumPy versions (`pip install --upgrade castepxbin`).
Ensure you are using the correct reader class for the CASTEP binary file you are trying to parse (e.g., `PdosBinReader` for `.pdos_bin`, `CastepBinReader` for `.castep_bin`). Refer to the documentation for supported file types for each reader.
Always verify that the file path provided to the reader constructor is correct and that the file exists at that location. Use `os.path.exists()` for debugging if encountering `FileNotFoundError`.