{"id":10274,"library":"sumo","title":"Sumo","description":"Sumo provides heavy-weight plotting tools specifically designed for analyzing ab initio solid-state calculations. It focuses on generating high-quality visualizations for electronic band structures, density of states (DOS), and phonon properties, often integrating seamlessly with `pymatgen` objects. The current version is 2.4.0.post1, and the library maintains an active release cadence, frequently addressing compatibility with its core dependencies like `pymatgen` and `phonopy`.","status":"active","version":"2.4.0.post1","language":"python","source_language":"en","source_url":"https://github.com/SMTG-Bham/sumo","tags":["materials science","DFT","solid-state physics","plotting","band structure","density of states","phonons","crystallography"],"install":[{"cmd":"pip install sumo","lang":"bash","label":"Install Sumo"}],"dependencies":[{"reason":"Core dependency for parsing DFT outputs and providing data structures for plotting (e.g., BandStructure, Dos objects).","package":"pymatgen"},{"reason":"Required for phonon calculations and plotting phonon band structures/DOS.","package":"phonopy"},{"reason":"The underlying plotting library used by Sumo.","package":"matplotlib"},{"reason":"Numerical computing foundation.","package":"numpy"}],"imports":[{"wrong":"from sumo.plotting import plot_band","symbol":"plot_band","correct":"from sumo.plotting import plot_band"}],"quickstart":{"code":"import os\nfrom pymatgen.electronic_structure.band_structure import BandStructure, Kpoint\nfrom pymatgen.electronic_structure.dos import Dos, CompleteDos\nfrom sumo.plotting import plot_band, plot_dos\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# --- Create dummy data for demonstration --- #\n# In a real scenario, these would come from parsing DFT output (e.g., Vasprun.from_xml)\n\n# Dummy BandStructure object\nkpoints = [Kpoint([0,0,0], 0, '$\\Gamma$'), Kpoint([0.5,0,0], 0.5, 'X')]\neig_val = {('spin_up', 0): np.array([[-1.0, -0.5], [0.5, 1.0]]), \n           ('spin_down', 0): np.array([[-1.1, -0.6], [0.4, 0.9]])}\nefermi = 0.0\nbs = BandStructure(kpoints, eig_val, efermi, structure=None, labels_dict={'G': [0,0,0], 'X': [0.5,0,0]})\n\n# Dummy Dos object\nenergies = np.linspace(-2.0, 2.0, 200)\ntotal_densities = np.exp(-(energies - 0.5)**2 / 0.5) + np.exp(-(energies + 0.5)**2 / 0.5)\ntdos = Dos(efermi, energies, total_densities)\ncdos = CompleteDos(None, tdos.energies, {'total': tdos.densities})\n\nprint(\"Plotting dummy band structure...\")\nfig_bs, ax_bs = plot_band(bs, dpi=150)\n# To save: fig_bs.savefig(\"band_structure.png\")\nplt.close(fig_bs) # Close figure to avoid display issues in non-interactive environments\nprint(\"Dummy band structure plot generated and closed.\")\n\nprint(\"Plotting dummy density of states...\")\nfig_dos, ax_dos = plot_dos(cdos, dpi=150)\n# To save: fig_dos.savefig(\"dos.png\")\nplt.close(fig_dos)\nprint(\"Dummy DOS plot generated and closed.\")","lang":"python","description":"This quickstart demonstrates how to use `sumo.plotting` functions for a band structure and density of states. In a real application, the `BandStructure` and `Dos` objects would typically be loaded from DFT calculation outputs using `pymatgen` parsers (e.g., `pymatgen.io.vasp.Vasprun`). Sumo then takes these `pymatgen` objects to generate publication-quality plots. Note that `matplotlib.pyplot.close()` is used to prevent figures from blocking execution in environments without an active GUI."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or later (`python -m pip install --upgrade python` or use `pyenv`/`conda`).","message":"Sumo v2.4.0 and later requires Python 3.10 or newer. Older Python versions are no longer supported.","severity":"breaking","affected_versions":">=2.4.0"},{"fix":"Ensure you are using a `sumo` version compatible with your `pymatgen` and `phonopy` versions. Check `sumo`'s `setup.py` or release notes for dependency requirements. Upgrade `sumo` and its dependencies regularly.","message":"Compatibility issues frequently arise with specific versions of `pymatgen` and `phonopy` due to their own API changes. Sumo updates often patch these, but staying up-to-date is crucial.","severity":"breaking","affected_versions":"All versions, especially with major `pymatgen`/`phonopy` updates."},{"fix":"Upgrade `sumo` to version 2.4.0 or newer to use an updated `phonopy` API (`pip install --upgrade sumo`).","message":"The `phonopy.PhonopyAtoms.get_number_of_atoms()` method was deprecated and removed in recent `phonopy` versions, leading to errors in older `sumo` versions.","severity":"deprecated","affected_versions":"<2.4.0 with `phonopy` >=2.7.0"},{"fix":"Treat `2.4.0.post1` as functionally identical to `2.4.0` in terms of code behavior. There's no need to downgrade or worry about functional differences unless specifically mentioned in release notes.","message":"Post-release suffixes like `.post1` (e.g., v2.4.0.post1) typically indicate packaging or metadata fixes, not new features or critical bug fixes to the core functionality.","severity":"gotcha","affected_versions":"All post-releases"}],"env_vars":null,"search_vec":"'2.4.0':48 'ab':13 'activ':55 'address':59 'analyz':12 'band':29,77 'cadenc':57 'calcul':18 'compat':60 'core':63 'crystallographi':83 'current':45 'densiti':31,79 'depend':64 'design':10 'dft':71 'dos':34 'electron':28 'focus':20 'frequent':58 'generat':22 'heavi':5 'heavy-weight':4 'high':24 'high-qual':23 'initio':14 'integr':39 'librari':52 'like':65 'maintain':53 'materi':69 'object':43 'often':38 'phonon':36,82 'phonopi':68 'physic':75 'plot':7,76 'post1':49 'properti':37 'provid':3 'pymatgen':42,66 'qualiti':25 'releas':56 'scienc':70 'seamless':40 'solid':16,73 'solid-st':15,72 'specif':9 'state':17,33,74,81 'structur':30,78 'sumo':1,2 'tool':8 'version':46 'visual':26 'weight':6","created_at":"2026-04-17T01:23:17.146282+00:00","updated_at":"2026-04-17T01:23:17.146282+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'plot_band' from 'sumo.plotting' (/tmp/tmpu3tgjoeo/venv/lib/python3.12/site-packages/sumo/plotting/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.4.0.post1","cli_name":"sumo","cli_version":"sh: 1: sumo: not found","type":"library","homepage":"https://smtg-ucl.github.io/sumo/","github":"https://github.com/SMTG-Bham/sumo","docs":"https://smtg-bham.github.io/sumo/","changelog":null,"pypi":"https://pypi.org/project/sumo/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}