{"id":9900,"library":"lobsterpy","title":"Lobsterpy","description":"Lobsterpy is a Python package designed for automatic bonding analysis derived from LOBSTER calculations, which themselves process VASP output. It helps researchers analyze chemical bonding in materials efficiently. The current version is 0.6.0, and the project is under active development with irregular but consistent releases.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/Jaxton/lobsterpy","tags":["materials science","VASP","LOBSTER","bonding analysis","DFT"],"install":[{"cmd":"pip install lobsterpy","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for parsing VASP and LOBSTER calculation outputs.","package":"pymatgen","optional":false}],"imports":[{"note":"The main analysis class was moved to the `cohp.analyze` submodule in recent versions (>=0.5.0).","wrong":"from lobsterpy.analysis import LobsterpyAnalysis","symbol":"LobsterpyAnalysis","correct":"from lobsterpy.cohp.analyze import LobsterpyAnalysis"},{"note":"The data container class was moved to the `cohp.data` submodule in recent versions (>=0.5.0).","wrong":"from lobsterpy.data import LobsterpyData","symbol":"LobsterpyData","correct":"from lobsterpy.cohp.data import LobsterpyData"}],"quickstart":{"code":"from pathlib import Path\nfrom lobsterpy.cohp.analyze import LobsterpyAnalysis\n\n# NOTE: Replace with the actual path to your LOBSTER/VASP calculation directory.\n# This directory should contain files like COHPCAR.lobster, vasprun.xml, POSCAR etc.\n# For a runnable example, you would need to set up such a directory locally.\npath_to_lobster_calc = Path('/path/to/your/lobster_calculation_output')\n\n# Create an instance of LobsterpyAnalysis\ntry:\n    analyzer = LobsterpyAnalysis(\n        path_to_lobster_calc=path_to_lobster_calc,\n        gaussian_smearing_width=0.05,\n        spin_type='none' # or 'up', 'down' for spin-polarized calculations\n    )\n\n    # Access bonding analysis results\n    bond_data = analyzer.bond_analysis\n    print(\"Bond Analysis:\\n\", bond_data)\n\n    # You can also get population data\n    population_data = analyzer.get_population_data()\n    print(\"Population Data:\\n\", population_data)\n\nexcept FileNotFoundError as e:\n    print(f\"Error: Calculation path not found or missing files. {e}\")\n    print(\"Please ensure 'path_to_lobster_calc' points to a valid LOBSTER/VASP calculation directory.\")\nexcept Exception as e:\n    print(f\"An error occurred during analysis: {e}\")","lang":"python","description":"This example demonstrates how to initialize `LobsterpyAnalysis` with a LOBSTER/VASP calculation directory and extract basic bonding and population data. Ensure the `path_to_lobster_calc` variable points to a directory containing all necessary LOBSTER and VASP output files."},"warnings":[{"fix":"Update your imports from `from lobsterpy.analysis import ...` to `from lobsterpy.cohp.analyze import ...` and `from lobsterpy.data import ...` to `from lobsterpy.cohp.data import ...`. Review the changelog for specific method signature changes.","message":"Major refactoring in versions >=0.5.0 moved key classes and changed method signatures. `LobsterpyAnalysis` and `LobsterpyData` are now in `lobsterpy.cohp.analyze` and `lobsterpy.cohp.data` respectively.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Verify that `path_to_lobster_calc` is a valid path and contains all required output files from a successful LOBSTER calculation (e.g., COHPCAR.lobster, ICOHPCAR.lobster, DOSCAR.lobster, vasprun.xml, POSCAR, KPOINTS, POTCAR, INCAR).","message":"The `LobsterpyAnalysis` constructor requires a complete LOBSTER/VASP calculation directory. Missing essential files (e.g., `COHPCAR.lobster`, `vasprun.xml`, `POSCAR`) will lead to `FileNotFoundError` or parsing errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Instead of calling methods like `analyzer.plot_cohps()`, import plotting functions from `from lobsterpy.plotting import plotting` (or similar) and pass the analysis data to them.","message":"Direct plotting functions within `LobsterpyAnalysis` have been largely deprecated or moved. For plotting, use the dedicated `lobsterpy.plotting` module introduced in version 0.6.0.","severity":"deprecated","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Change your import statement from `from lobsterpy.analysis import LobsterpyAnalysis` to `from lobsterpy.cohp.analyze import LobsterpyAnalysis`.","cause":"The `analysis` submodule was moved or renamed in recent versions.","error":"ModuleNotFoundError: No module named 'lobsterpy.analysis'"},{"fix":"Ensure the `path_to_lobster_calc` variable points to a valid directory containing all expected LOBSTER and VASP output files. Check for typos in the path and file names.","cause":"The specified calculation directory either does not exist, or essential LOBSTER/VASP output files are missing within it.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'path/to/your/lobster/calculation/COHPCAR.lobster'"},{"fix":"Update your constructor call from `LobsterpyAnalysis(path=...)` to `LobsterpyAnalysis(path_to_lobster_calc=...)`.","cause":"The `LobsterpyAnalysis` constructor parameter for the calculation path changed from `path` to `path_to_lobster_calc` in version 0.5.0.","error":"TypeError: __init__ got an unexpected keyword argument 'path'"}]}