Changelog

Unreleased

  • 💥 pymatviz computes with kemio instead of pymatgen, which is no longer a dependency (the pymatviz[pymatgen] extra is removed). pymatgen, ASE and phonopy objects are still accepted and converted on input. normalize_structures returns kemio.Structures (to_structure is kemio.interop.to_structure, which also reads structure file paths; new structure_dict, site_elements, site_symbols), compositions are kemio.Compositions (to_composition), RDFs come from Structure.neighbor_list, coordination numbers from kemio.coordination_numbers (strategy= a cutoff, "crystal_nn" or "voronoi"), chem_env_hierarchy environments from kemio.chemenv (about 500x faster than pymatgen’s ChemEnv, per input site instead of the refined conventional cell; the CrystalNN order-parameter method is gone), phonopy band structures, DOS and Phonopy objects convert through kemio.interop (exact frequencies and kept labels instead of a YAML round trip; phonon_dos(project=...) also takes phonopy and kemio projected DOS), space groups from kemio.symmetry_dataset, xrd_plot patterns from kemio.xrd_patterns (disordered structures included), and convex hull stability from kemio’s PhaseDiagram (lists of pymatgen entries now accepted). band_structure, dos and bands_and_dos take vasprun.xml paths (kemio.io.read_vasprun), and PhononDBDoc decodes to kemio Structure/PhononBands/PhononDos without pymatgen. get_spacegroup_number is removed (use normalize_spacegroups); periodic-only functions require periodicity along all three axes (ASE Atoms need pbc=True); mixed space group data raises TypeError; pyyaml moved to the make-assets extra. Magpie composition features (cluster_compositions default) come from kemio.composition_features, bit-identical to matminer and without matminer or pymatgen: matminer_featurize is now magpie_featurize (no preset/n_jobs; unknown feature_subset labels raise), and the deml, matminer, matscholar_el and megnet_el embeddings are removed (pass a callable or precomputed embeddings instead); a structure path that isn’t a file raises FileNotFoundError. Space group symbols and crystal systems come from kemio, so moyopy is no longer a dependency (hm_symbol_to_spg_num_map is removed; symbols accept kemio’s loose spellings and Hall symbols). Structure/DOS type aliases, the is_* structure predicates and monty decoding are kemio’s (kemio.interop). utils.testing.load_phonopy_nacl is now load_nacl_phonons (a kemio.Phonons). pymatviz no longer imports pymatgen, ASE or phonopy anywhere: pymatgen Trajectory objects and JSON are read by kemio.interop.to_trajectory (unwrapped positions, oxidation states, site properties and frame properties kept; plain ones now sync as binary, malformed per-frame forces raise), and tests/test_without_optional_deps.py builds every widget with them blocked. pymatviz.typing.CrystalSystem (use kemio.options.CrystalSystem), Rgb256ColorType, RgbColorType, RgbAColorType and ColorType (cluster_compositions(color_discrete_map=) takes CSS color strings), pymatviz.hierarchy.chem_env_nodes, the label/description/rel_path/from_label fields of pymatviz.enums.Files (members are (file_path, url)), project_vectors(method=None) (defaults to "pca"), collect_coord_envs_chemenv/collect_coord_envs_crystal_nn/get_cn_from_symbol/ChemEnvSettings, structures.MIN_ASE_CELL_VOLUME, get_site_species/get_site_elements/get_site_symbol, add_vacuum_if_needed, normalize_get_neighbors, user-defined NearNeighbors strategies, chem_env_hierarchy’s chem_env_settings (always ChemEnv now), coordination_vs_cutoff_line(strategy=) (now cutoff_range=), phonopy_to_pymatgen_bands, phonon_dos_dict, is_instance_of (use kemio.interop.has_class), coordination_nums_in_structure(group_by="specie") and CompositionWidget.pymatgen_kwargs are removed. Compared with the pymatgen versions on the same inputs: RDFs agree to max rel. error 4.8e-16, except that a periodic self-image exactly at a bin edge can land one bin lower; coordination numbers (cutoff, CrystalNN, VoronoiNN), element counts and Magpie features are bit-identical (except that deuterium and tritium symbols D/T no longer parse); XRD 2θ agrees within 4.3e-14°, with peak counts as in pymatgen ≥ 2026.10 (older pymatgen merges near-degenerate peaks differently, so peak lists can differ); ChemEnv counts are per input site, not per site of pymatgen’s refined conventional cell, so un-normalized counts differ for non-conventional cells.
  • 🐛 Input handling: spacegroup_sunburst merges spellings ("F m -3 m", "Fm-3m") and int/float numbers of one space group into one slice labeled with its canonical symbol, and bool space groups raise. Duplicate pd.Series structure labels raise. xrd_plot takes pattern dicts of pandas Series, histogram NumPy int bins, ptable_heatmap a single exclude_elements string (and fill_value with heat_mode="fraction"/"percent" raises), count_elements {element: amount} dicts. Unnamed Series label density scatter axes “Actual”/”Predicted” (was “None”). Raising now: NaN in rainclouds (ValueError), site-less structures in coordination_bar_plot, array args to df_to_arrays with a df. count_formulas treats only A-B element strings as chemical systems.
  • 🐛 Widgets: StructureWidget.structure, DosWidget.doses, BandStructureWidget.band_structs, XrdWidget.patterns, ConvexHullWidget.entries and RdfPlotWidget.structures convert objects assigned after construction too (DOS stack=True checks grids in either order; RdfPlotWidget takes lists and labeled dicts of structure objects). TrajectoryWidget keeps kemio Structure.info frame metadata (extxyz), adds a frame dict’s keys to ASE calculator results instead of replacing them, plots user step values on the x axis, sends ASE momenta as velocities, takes kemio io.Frames (also in create_widget) and {"frames": [...]} dicts holding structure objects, and sends kemio and pymatgen site-data vectors (e.g. velocities) as binary. Convex hull entries keep their entry_id, entry formulas parse with kemio.Composition (groupings like Ca(OH)2), and describe_widget describes phonon DOS.
  • 🐛 More input fixes: count_elements counts structures and names a bad item’s value; histogram rejects an inverted x_range, elements_hist(max_elements<1) raises, density_hexbin(marginal_bins=) takes NumPy ints; annotate_metrics defaults to .3g (123, not 1.23e+02); normalize_spacegroups raises for mixed structures and numbers; Files.file_path creates parent dirs and never leaves partial downloads. py_pkg_treemap(group_by="directory") groups installed packages by directory, honors max_children_for_split=0, and collect_source_modules_from_dir takes one project_name. coordination_vs_cutoff_line takes NumPy scalars, roc_curve/precision_recall_curve raise on shape mismatches, xrd_plot takes a pd.Series of patterns, cluster_compositions handles empty frames, sankey rejects source == target, float32 calculate_rdf cutoffs give the float64 bins.
  • 🐛 Widgets convert data assigned after construction (HeatmapMatrixWidget, BrillouinZoneWidget, FermiSurfaceWidget, RdfPlotWidget.patterns, ChemPotDiagramWidget, CompositionWidget, BandsAndDosWidget), and band/DOS/XRD dicts holding NumPy arrays become JSON (export and describe failed). periodic_table keeps a pandas Series’ element index (was mapped to H, He, …), plot JSON keys and CoordinationBarPlotWidget/RdfPlotWidget structure labels that stringify identically raise, link_selection ignores clicks in other series, to_img respects width/height styles with whitespace or uppercase, widget_grid({}) raises. Dict/list options (axes, color scales, ranges, …) also convert on reassignment, those with validators included (StructureWidget.isosurface_settings synced NumPy isovalues), structure widgets convert NumPy values in structure properties (e.g. ASE Atoms.info), constructors convert each data trait once (was twice: RdfPlotWidget with 20 x 512-site structures builds in 37 instead of 49 ms), BandsAndDosWidget checks stack=True DOS grids and matching band/DOS labels on reassignment, spacegroup_bar_plot takes generators, SankeyWidget tuple nodes/links. Non-numeric z in ScatterPlot3DWidget series raises; describe() of an empty XrdWidget reports no facts.
  • 🐛 stats={}/best_fit_line={}/identity_line={} turn the feature on with default kwargs (was off), confusion_matrix(metrics="MCC") takes one metric name and rejects negative counts, a structure mapping may have a "sites" label, ptable_heatmap_splits/ptable_hists raise on duplicate element keys, rdf_plot raises on unknown mode, qq_gaussian/error_decay_with_uncert take an int column label or pd.Index as y_std, py_pkg_treemap counts typing.TYPE_CHECKING imports as type-checking only.
  • 🐛 cluster_compositions(sort=) takes NumPy bools, count_elements names duplicate element keys, elements_hist rejects negative counts, structure inputs may be NumPy object arrays. 💥 histogram, rainclouds and coordination_vs_cutoff_line raise when labels collide as strings (1 and "1"), like rdf_plot.
  • 🐛 pmv.structure(volumetric_data=..., isosurface_settings=...) with pymatgen Chgcars, {prefix: volume} mappings or label-only dicts no longer crashes on construction. Every docstring example runs.
  • 🐛 Invalid widget values in batched updates (hold_trait_notifications(), constructors) roll back the whole batch: trajectory, hierarchy data and HeatmapMatrixWidget.values used to stay set and sync, as did values whose conversion failed with other errors (a missing vasprun.xml or structure file, a trajectory dict without frames), which now raise TraitError naming the original error type. Normalized data traits name the trait and expected type in errors again (bz_data, fermi_data, …). Float traits reject NaN/inf (was invalid JSON), Float/Int/Bool traits take NumPy scalars, zoom_root_id takes only strings or numbers (no bools). 💥 Invalid widget data raises traitlets.TraitError everywhere (was ValueError/TypeError for many traits).
  • 🐛 to_html pages load when a label contains <!--<script>, export_widgets rejects names with path separators or ./.. before rendering, to_json(filename) creates parent folders, link_selection links a repeated widget once (unlink() raised), and describe()/render_report cover box, binned scatter, Sankey and coordination plots.
  • 🐛 RdfPlotWidget and FermiSurfaceWidget enforce one data source on assignment too (swapping inside hold_trait_notifications() still works), so saved JSON always loads. StructureWidget.volumetric_data = None raises like in the constructor (use [] for no volumes). widget_grid requires a positive int n_cols and names non-MatterViz cells under PYMATVIZ_STATIC. HistogramWidget.bins and RdfPlotWidget.n_bins must be >= 1, RdfPlotWidget.cutoff > 0. export_widgets rejects names differing only in case. spacegroup_bar_plot count mappings take integral floats and reject bools.
  • 💥 Parity, uncertainty, classification and powerup functions pair two pandas Series (x/y, y_true/y_pred/y_std, targets/probs) by index label instead of position, keeping shared labels (in the first Series’ order) and raising ValueError on duplicate or disjoint indexes or misaligned Series mixed with plain arrays (pymatviz.utils.align_series). Arrays and lists still pair by position.
  • 🎉 histogram(sort_groups=sorted) reorders the distributions of a color column or dict keys with any callable (default: order of first appearance).
  • 💥 Widget index traits (TrajectoryWidget.current_step_idx, HistogramWidget.selected_series_idx, ScatterPlotWidget.selected_point, StructureWidget.selected_sites/highlighted_sites) reject out-of-range values set from Python with a TraitError naming the valid range; frontend updates are clamped, and replacing data with shorter data clamps or resets the dependent index. link_selection no longer pushes out-of-range indices (a scatter click past a trajectory’s frames leaves its step and warns).
  • 🎉 Every widget and structure input that takes a sequence also takes an iterator (e.g. a generator), consumed once, including nested values like tree children and XRD x/y. periodic_table(heatmap_values=...) accepts NaN, ±inf and pandas NA (e.g. a Series with missing data) and draws them as missing tiles, like tile_plots. pmv.composition keeps oxidation states of mappings and pymatgen Compositions/structures ({"Fe2+": 1, "O2-": 1}, pymatgen Species): Fe2+ and Fe3+ show as separate segments colored by Fe (needs a matterviz-anywidget release whose composition charts accept species keys); keys naming the same species are summed, malformed charged keys like Fe12+ raise.
  • 🏎️ count_elements ~2x faster on formula strings, count_formulas(group_by="chem_sys") 2.3x, widget JSON normalization 2.2x, py_pkg_treemap 1.6x.
  • 💥 One module per feature, no re-export packages: pymatviz.{ptable,coordination,rdf,phonons,classify,cluster} are single modules (pymatviz.coordination.helpers, pymatviz.rdf.helpers, pymatviz.cluster.composition.* etc. are gone), spacegroup_sunburst and the chem_env helpers live in pymatviz.hierarchy (pymatviz.sunburst and pymatviz.chem_env are removed), py_pkg_treemap in pymatviz.py_pkg (pymatviz.treemap is removed: pmv.treemap is the treemap widget), pymatviz.composition is pymatviz.compositions (it was hidden by pmv.composition, the composition widget), pymatviz.utils is one module (paths, element lookups, df_to_arrays) and the demo/test data of pymatviz.utils.testing moved to pymatviz.data (formula_spg_str to pymatviz.structures). Tests mirror the package: one tests/test_<module>.py per module.
  • 💥 Element data comes from kemio’s element table: pmv.utils.df_ptable is pd.DataFrame(kemio.element_table().as_dict()).set_index("symbol") (singular column names, e.g. mass, specific_heat_capacity), and pymatviz/elements.csv and pymatviz.colors are removed (Jmol colors come from element_table().jmol_color). TrajectoryWidget encodes binary trajectories from kemio.interop.trajectory_arrays: ASE velocities sync in Å/fs, stresses as 3x3, cells only for periodic frames, and ASE constraints, vector magmoms and 2D slabs now sync as binary too. Convex hull entry ids come from kemio’s PhaseDiagram.ids, XRD dicts from XrdPattern.as_dict().
  • 🐛 to_img(height=...) (and the 600 px default) no longer exports charts at their 300 px minimum height: the widget fills the export root. py_pkg_treemap of a single package puts its modules at the top level (one color each) and labels cells with compact line counts (label_text="label+value", value_format=".3~s", e.g. calphad 48.3k), so py_pkg_treemap("kemio", source_dir="src", file_extensions=(".rs",), max_module_depth=2) draws a Rust crate’s source map, styled as a source map: one mid-tone color per module with child cells as a translucent white overlay, white top-left labels with the line count on a dimmer line, rounded cells and 2 px gaps (MatterViz label_align="top-left", --treemap-label-color, --treemap-cell-radius).
  • 💥 Dropped in favor of upstream packages: si_fmt/si_fmt_int, html_tag and the enums.eV/angstrom_per_atom/cubic_angstrom labels, spg_num_to_from_symbol and spg_to_crystal_sys (use kemio.space_group_symbol/space_group_number/crystal_system), coordination_nums_in_structure (use kemio.coordination_numbers), the Ferrox two_theta/intensities XRD dict schema (pass x/y dicts or kemio XrdPatterns), the VESTA, alloy and pastel element palettes with ElemColorScheme (MatterViz ships them; coordination plots take element_colors={element: css_color} over Jmol, default bar colors are now Jmol), and density_scatter’s Python binning (bins, density: it colors by KDE and raises above 10k points, use density_hexbin for more). Phonon site projections are labeled 1-based (Na1, Cl2) like coordination plots.
  • 💥 One function per MatterViz component, named after it in snake_case: pmv.structure, pmv.trajectory, pmv.scatter_plot, pmv.bar_plot, pmv.box_plot, pmv.band_structure, pmv.dos, pmv.convex_hull, pmv.periodic_table, pmv.sunburst, etc. The *Widget classes are no longer exported from pmv (import them from pymatviz.widgets for type hints and isinstance), nor are WidgetGrid and WidgetLink. Renamed: spacegroup_bar → spacegroup_bar_plot, xrd_pattern → xrd_plot.
  • 💥 One function per feature, computed in the browser by default and in Python when an option or the data size needs it: rdf_plot(structures, mode="element_pairs" | "full", element_pairs=...) replaces full_rdf and element_pair_rdfs (bin_size and negative cutoffs are gone), coordination_bar_plot(structures, strategy=...) replaces coordination_hist (a MatterViz strategy name bonds in the browser, a cutoff, "crystal_nn" or "voronoi" computes in Python), and histogram replaces binned_histogram (density, non-int bins, bin_width, orientation or more than 1M values bin in Python).
  • 💥 chem_sys_hierarchy(data, kind="sunburst" | "treemap") replaces chem_sys_sunburst/chem_sys_treemap, chem_env_hierarchy replaces chem_env_sunburst/chem_env_treemap; pymatviz._hierarchy is the public pymatviz.hierarchy.
  • 💥 The Key enum and its 1900-line keys.yml (from Matbench Discovery) are removed: use plain column names like "spg_num".
  • 💥 pymatviz.widgets.mime and register_matterviz_widgets are folded into pmv.notebook_mode, which now also covers marimo; pymatviz.notebook.create_widget builds the widget for a displayable object.
  • 🎉 Widget traits are generated from MatterViz’s widget model schema (pymatviz/widgets/_schema_traits.py, regenerated by uv run tests/widgets/test_js_prop_parity.py), so every component prop is settable and typed without hand-written declarations.
  • 🎉 scatter_plot, bar_plot, box_plot and histogram take a DataFrame with x=/y= column names and color= to split it into one series per value; heatmap_matrix(df) plots a DataFrame matrix.
  • 🎉 widget.to_json() and pmv.from_json() save and restore widgets, binary arrays included.
  • 🎉 pmv.export_widgets({name: widget}, out_dir, fmt=...) renders up to 4 widgets concurrently in one headless browser.
  • 🎉 count_mode accepts plain strings like "occurrence" (typed as ElemCountModeName).
  • 💥 Leaner, more consistent API. The top-level pmv namespace now holds only plot functions, widgets, widget_grid, link_selection, configure_assets, notebook_mode, count_elements: PKG_NAME, PKG_DIR, ROOT, IS_IPYTHON, df_ptable, count_formulas, normalize_spacegroups and sankey_flow_data moved to their modules (pmv.utils, pmv.enums, pymatviz.compositions, pymatviz.structures, pymatviz.sankey). phonon_bands and phonon_bands_and_dos are removed: band_structure, dos and bands_and_dos take phonopy BandStructure/TotalDos directly, bands_and_dos checks that band and DOS labels match, and DOS widgets check stacked DOS share one grid. density_scatter_with_hist and density_hexbin_with_hist are removed: pass density_hexbin(..., marginal_bins=100) (plus bin_px=1.5 for the fine-grained look). sankey_from_2_df_cols(df, [source, target]) → sankey(df, source, target) (same for sankey_flow_data). Renamed: elements_hist(formulas, keep_top=) → elements_hist(values, max_elements=), spacegroup_sunburst(max_slices=, max_slices_mode=) → max_spacegroups=, overflow=, mode= → overflow= in chem_sys_* and chem_env_*, cluster_compositions(df_in=) → df= (with keyword-only composition_col), and roc_curve/precision_recall_curve take df keyword-only.
  • 💥 pymatviz.process_data is split up: count_elements/count_formulas live in the new pymatviz.compositions, structure detection and conversion (is_structure_like, is_ase_atoms, normalize_structures, normalize_periodic_structures) and space groups (get_spacegroup_number, normalize_spacegroups) in the new pymatviz.structures, df_to_arrays in pymatviz.utils, and sankey_flow_data in pymatviz.sankey. bin_df_cols (use pandas groupby with pd.cut) and normalize_phonon_bands are removed (the band widgets convert phonopy input themselves).
  • 💥 structure_3d, brillouin_zone_3d, seekpath_primitive, the pymatviz.structure and pymatviz.brillouin modules and the brillouin extra (seekpath) are removed: use pmv.structure(...) and pmv.brillouin_zone(...), which take pymatgen, ASE and phonopy structures directly. MatterViz standardizes the Brillouin zone’s cell itself, so any input cell gives the standard zone and Setyawan-Curtarolo k-path labels. Lay out several widgets with the new pmv.widget_grid({title: widget}, n_cols=3). get_site_species/get_site_elements/get_site_symbol moved to pymatviz.structures and the disordered demo structures to pymatviz.data. The unused pymatviz.enums.Task and SiteCoords enums are removed.
  • 💥 plotly and kaleido are no longer dependencies: every plot function returns a MatterViz anywidget (ScatterPlotWidget, new BinnedScatterPlotWidget, PeriodicTableWidget, BarPlotWidget, new BoxPlotWidget, new SankeyWidget, new CoordinationBarPlotWidget, HeatmapMatrixWidget, XrdWidget, RdfPlotWidget, BandStructureWidget/DosWidget/BandsAndDosWidget, BrillouinZoneWidget, StructureWidget, SunburstWidget, TreemapWidget) instead of a go.Figure; export with widget.to_html()/widget.to_img(). Removed: structure_2d, pmv.io (save_fig, save_and_compress_svg), pmv.templates (set_plotly_template, pmv_*_template), pmv.utils.plotting (annotate, PRETTY_LABELS, luminance, get_font_color, rgb_components, pick_max_contrast_color, get_fig_xy_range, …) and plotly-only options (fig_kwargs, hover_*, subplot_kwargs, *_kwargs trace/layout dicts, font/scale/border options). Extra widget options are **kwargs, with dict options such as x_axis/y_axis merged over each function’s defaults. Renamed: ptable_hists(log=) → log_y, spacegroup_bar(log=) → log_y, density_scatter(log_density=) → log, cluster_compositions(color_scheme=, color_scale=<type>) → log= + color_scale=<MatterViz color scale>, rainclouds(orientation="h"|"v") → "horizontal"|"vertical", ptable_scatter(mode="lines"|"lines+markers") → "line"|"line+markers", chem_env_* **widget_options → **kwargs; error_decay_with_uncert drops n_rand (the random baseline is now the exact closed form instead of a Monte Carlo shuffle); add_best_fit_line fits in display space on log axes (power law on log-log); coordination split modes are none/by_element/by_structure; color scales use d3 interpolator names (interpolateViridis). New MatterViz features need janosh/matterviz#520 (janosh/pymatviz#370).
  • 💥 sankey_flow_data returns SankeyWidget data {"nodes": [{id, label, metadata}], "links": [{source, target, value}]} instead of plotly’s labels/source_indices/target_indices/value lists, and keeps source and target as separate nodes, so a value in both columns no longer merges into one node with self-loops and summed counts.
  • 💥 Widgets raise TypeError for unknown kwargs (typos or plotly-only options like width/template) instead of silently dropping them.
  • 🏎️ ScatterPlotWidget/BinnedScatterPlotWidget series with at least 10k numeric points sync as binary plot-series arrays: a 1e6-point series builds in ~3 ms with 16 MB of buffers instead of ~360 ms and 41 MB of JSON. ptable_hists bins with NumPy and sends only per-bin counts (tile_plots {"counts"} series): 100 elements × 30k values build in 0.03 s with a 20 kB payload instead of 1 s and ~37 MB. import pymatviz no longer loads pymatgen.io.phonopy.
  • 🐛 HistogramWidget.series assignments now normalize sample arrays and reject invalid data with TraitError, including rollback of batched updates. HistogramWidget, BarPlotWidget and ScatterPlot3DWidget validate series once, in their trait validator, so constructors and assignments alike raise TraitError (not ValueError) for invalid series; ScatterPlot3DWidget series of at least 10k points sync as binary with z.
  • 🐛 Widget SVG export (to_img(fmt="svg")) no longer drops canvas-drawn scatter markers (marker_renderer="canvas", the default above 1000 points): they are embedded as a PNG <image> at the export dpi, matching matterviz’s own SVG export. PDF export only rasterizes WebGL widgets: SVG charts with 2D canvas layers (canvas scatter markers, 2D ternary hulls) now give vector PDFs with selectable text. Widgets with canvas content outside the SVG chart (e.g. a WebGL structure next to a plot) now raise instead of exporting a partial figure.
  • 💥 Widgets render the matterviz-anywidget 0.10.0 bundle (MATTERVIZ_ANYWIDGET_VERSION, loaded from jsDelivr and cached by the browser); synced traits mirror its JS contract exactly (tests/widgets/test_js_prop_parity.py). Renamed: BandStructureWidget(band_structure=) → band_structs=, DosWidget(dos=) → doses= (also BandsAndDosWidget; both take a {label: obj} dict to overlay several), log_scale, log and color_scale_range → one color_scale (d3 interpolator name or {scheme, type, value_range, palette_range} dict, e.g. {"type": "log", "value_range": [1, None]}) and show_color_bar → color_bar (dict of ColorBar props, {} shows the default bar, None hides it; new on HeatmapMatrixWidget and FermiSurfaceWidget, where it shows in color_property="property" mode) on HeatmapMatrixWidget/PeriodicTableWidget, TreemapWidget.export_buttons → export_formats (e.g. ["svg", "png"], [] hides the export pane), show_gizmo → gizmo (bool or GizmoOptions dict) on StructureWidget/TrajectoryWidget, HistogramWidget.selected_property → two-way selected_series_idx. TrajectoryWidget.display_mode is "auto" (default) / "structure+plot" / "structure" / "plot", with the plot kind in the new two-way plot_type ("time-series" / "distribution") and distribution_property, so "structure+scatter" → "structure+plot" and "structure+histogram" → display_mode="structure+plot", plot_type="distribution". Removed: band_type on BandStructureWidget/BandsAndDosWidget (detected from the data), controls on XrdWidget/RdfPlotWidget/ScatterPlotWidget/ScatterPlot3DWidget, ScatterPlotWidget.point_events, BarPlotWidget.point_tween.
  • 💥 Widget trait types are checked against the bundle’s widget-model-schema.json (each key’s JSON kinds and string enums, typed from the matterviz props it drives), and every string trait with a fixed set of values is a CaselessStrEnum. show_bonds takes "always"/"crystals"/"molecules"/"never" (show_bonds=True never drew bonds; it now raises TraitError). Now validated: color_scale names (the 38 d3 interpolators), camera_projection on BrillouinZoneWidget/FermiSurfaceWidget/ScatterPlot3DWidget, FermiSurfaceWidget.representation, DosWidget normalize/orientation/spin_mode, RdfPlotWidget.mode and BinnedScatterPlotWidget.marginals strings. Newly accepted: bonding_strategy/strategy="pair_cutoffs" and StructureWidget.display_mode="split".
  • 💥 StructureWidget.isosurface_settings is layers-only ({"layers": [{volume_id, color_volume_id?, isovalue, color, opacity, visible, show_negative, negative_color}], "wireframe", "halo"}), each layer picking its volume by volume_id; volumetric_data accepts pymatgen VolumetricData objects (ids = their data keys, e.g. "total") and nested-grid dicts (id defaults to label), or a {prefix: volume} mapping giving "prefix/id" ids so e.g. two Chgcars don’t collide; ids must be unique. Layers without a volume_id, or whose volume_id/color_volume_id matches no Python-side volume, raise TraitError (matterviz drops them silently); swap volumes and layers together in hold_trait_notifications(). Payloads are emitted as flat values + dims (shape errors are reported by the renderer). HistogramWidget.series requires sample arrays in values and uses color for fills; the legacy {x, y, line_style} input shape is removed.
  • 💥 Silent fallbacks now raise: unknown chem_env_settings strings, ChemEnv/CrystalNN setup failures and ImportErrors (chem_env_sunburst/chem_env_treemap, which used to return an empty figure); unknown color_by/group_by, missing packages and failed on-the-fly coverage runs (py_pkg_treemap); out-of-range site_idx (classify_local_env_with_order_params); marginal_x/marginal_y (density_*_with_hist).
  • 💥 annotate_metrics dict values may be metric names to compute ({"Mean abs. error": "MAE"}); other non-numbers raise. add_ecdf_line drops offset_size. Removed unused unit constants (eV_per_atom, giga_pascal, joule_per_mol, …), ExperimentalWarning, pmv.crystal_sys_order (use typing.get_args(kemio.options.CrystalSystem)), pmv.io.TqdmDownload and pmv.utils.patch_dict (use dct | updates).
  • 💥 StructureWidget, BrillouinZoneWidget and link_selection share one strict structure converter: dicts need a sites list, lists of structures and non-structures raise TypeError, BZ accepts PhonopyAtoms. TrajectoryWidget frame force/forces must be shape (n_sites, 3).
  • 🎉 Plot widgets gain controls_open (two-way), controls_toggle_props, controls_pane_props; ScatterPlotWidget gains show_legend, marker_renderer; ScatterPlot3DWidget gains show_legend; StructureWidget gains two-way active_volume_id, display_mode ("structure" | "slice"), slice_settings; TrajectoryWidget gains atom_type_mapping for LAMMPS dumps loaded via data_url; BandsAndDosWidget gains a shared fermi_level; TreemapWidget gains max_children (keep the N largest children per parent, bucket the rest).
  • 🐛 TrajectoryWidget per-frame forces (dict frames, Structure.properties, ASE calculators) show as force arrows and Fmax/Fnorm plots again under matterviz 0.8; pymatgen Trajectory objects and their as_dict() load (were a broken frame / KeyError); ASE calculator energy and forces are kept.
  • 🐛 TrajectoryWidget accepts pymatgen MSONAtoms frames.
  • 🐛 Widget SVG export (to_img(fmt="svg")) runs MatterViz’s own export_svg (behind each widget’s Export pane) instead of a pymatviz copy: files carry the rendered width/height/viewBox (CSS-sized charts opened at 300×150 and cropped in <img>), redraw HTML legends and color bars as SVG, drop interaction attributes and round coordinates to 0.01 px. Periodic tables and heatmap matrices export SVG too; canvas-only figures raise with MatterViz’s reason. Headless exports and to_html pages use a sans-serif system font instead of Times. Headless export no longer crashes on widgets with unset series/trajectory/volumetric_data.
  • 🎉 link_selection links PeriodicTableWidgets: selecting a structure highlights its elements; clicking tiles dims scatter points (by series point_ids) whose structure lacks all clicked elements. New two-way PeriodicTableWidget.active_elements (a list makes tile clicks toggle elements; None keeps click-to-pin) and ScatterPlotWidget.highlighted_ids.
  • 🏎️ count_formulas (chem_sys_sunburst/chem_sys_treemap) parses each distinct formula string once: 200k formulas in 0.16 s instead of 0.64 s.
  • 🚧 tests/widgets/test_browser_render.py renders a realistic instance of every widget class in headless Chromium and checks it paints and exports a sized sans-serif SVG (WebGL widgets: refuses with MatterViz’s reason).
  • 🎉 With PYMATVIZ_STATIC set, widgets display as PNGs also as a cell’s bare last expression (not only via .show()), and widget_grid layouts as an HTML grid of PNGs, so executed notebooks render on GitHub and the docs site without embedded widget state.
  • 🏎️ precision_recall_curve drops points that don’t change the curve (sklearn drop_intermediate) and sends per-point threshold/F1 metadata as binary columns: 200k samples build in 0.04 s instead of 0.44 s with 4.3 MB instead of 11 MB. Plot series accept per-point metadata as a pandas DataFrame (one row per point).
  • 🐛 cluster_compositions labels missing categorical values "nan" under pandas 2 and 3 alike.
  • 💥🏎️ SpacegroupBarPlotWidget.data syncs per-space-group counts ({"225": 12, ...}, at most 230 entries) instead of one entry per structure: 200k structures send 2.6 kB instead of 0.9 MB. Count mappings may mix numbers and symbols for one group. BoxPlotWidget/rainclouds send series with at least 10k samples as binary arrays, and their invalid series raise TraitError like the other plot widgets.
  • 🐛 spacegroup_bar count labels account for the previous crystal system’s width. CrystalNN chem-env counts no longer include partial rows from structures that failed midway.
  • 🐛🏎️ Headless export (to_img/render_report) broke from the second call on in plain scripts and clashed with Jupyter’s event loop. It now runs async Playwright on one background thread (no nest-asyncio) and reuses a warm page per bundle and DPI: ~30% faster for all widget types.
  • 🏎️ Notebooks load the MatterViz bundle from its CDN URL instead of syncing ~6 MB of JS into every widget (saved state of 3 widgets: 17.9 MB → 4 kB). The code-split build lets 2D widgets download 0.9–1.3 MB instead of 5.7 MB, never three.js; the browser must reach the CDN on a notebook’s first load, after which its cache lets later sessions render offline. MATTERVIZ_ANYWIDGET_DIR still syncs a local build as text. Needs matterviz-anywidget ≥ 0.10 (older versions raise).
  • 💥 Widgets sync their trait names as _synced_keys; a bundle that doesn’t read one shows a version-mismatch error instead of silently ignoring it. tests/widgets/test_js_prop_parity.py checks traits against the bundle’s widget-model-keys.json.
  • 💥🏎️ BandStructureWidget/DosWidget/BandsAndDosWidget drop pymatgen’s projections, pdos and eigendisplacements (never drawn, nor the structure, atom_dos and spd_dos they bring) from their traits, serializing a copy without them: a projected band structure syncs 2 MB instead of 105 MB and serializes in 0.36 s instead of 1.9 s.
  • 🏎️ import pymatviz takes 0.45 s instead of 1.4 s: scipy, sklearn, matplotlib and pymatgen’s phonon/electronic-structure/symmetry modules load on first use; pymatgen display hooks register by type name, importing nothing. Built-in R2/MAPE metrics are computed with numpy, bit-identical to sklearn except constant targets (R2 NaN/-inf instead of 1/0).
  • 🐛 Optional dict/list widget traits default to None instead of {}/[], so MatterViz’s own defaults apply: StructureWidget no longer crashes rendering (empty isosurface_settings) and ScatterPlot3DWidget with size_values no longer draws scene-filling spheres (empty size_scale).
  • 🐛 normalize_plot_json no longer collapses 1-element numpy arrays / pandas Series to scalars.
  • 💥 Requires the latest releases of all other dependencies (numpy 2.5, scikit-learn 1.9, scipy 1.18, pymatgen 2026.9.24, anywidget 0.11, moyopy 0.21, phonopy 4.8, …). pandas stays at >=2.3 since matminer still caps pandas<3.
  • 💥 structure_3d(standardize_struct=True) and pymatviz.structure.helpers.standardize_struct are removed: pass cell_type="conventional" (or "primitive"), a new StructureWidget trait. MatterViz standardizes the cell and carries site properties over, rotating forces, magmoms and ADP tensors into the standardized frame (pymatgen copied them unrotated). BrillouinZoneWidget draws the high-symmetry k-path again (default_k_path=True, or pass k_path).
  • 💥 notebook_mode registers pymatgen/ASE/phonopy types by name with IPython’s MIME-bundle formatter instead of patching _ipython_display_/_repr_mimebundle_ onto the classes, so importing pymatviz in a kernel imports none of them (0.27 s instead of 0.95 s). It raises outside IPython, and display errors show IPython’s traceback instead of a silent repr.
  • 💥 Fail fast instead of guessing: MATTERVIZ_ANYWIDGET_DIR without a built bundle raises FileNotFoundError (it silently used the CDN), histogram(density=True) raises for series without samples in range, convex-hull entries no longer silently drop e_above_hull, and exported HTML rejects non-JSON values instead of stringifying them (numpy scalars become numbers). to_html() links the remote CSS instead of downloading and inlining it; build_interactive_html takes css_content or css_url by keyword.
  • 🐛 Powerups (annotate_metrics, add_best_fit_line, add_ecdf_line, enhance_parity_plot) work on scatter widgets with binary series (>= 10k points, KeyError: 'x' before) and ECDF lines sync as binary. describe() counts spin-polarized pymatgen bands and XRD overlays. CoordinationBarPlotWidget sends structure entries MatterViz reads (no bars drew). confusion_matrix metrics align rows and columns by class, avoid int64 overflow in MCC; ROC and precision-recall curves accept 1 targets.
  • 🏎️ Space-group symbols resolve through a lookup table (105 symbols: 0.55 s → 8 ms, P4/m2_1/nc-style full symbols now accepted), coordination numbers use one neighbor search per structure (500 sites: 86 → 7 ms, also fixes duplicate-site indices; normalize_get_neighbors returns a per-structure function), element_pair_rdfs one search for all pairs (4x), count_elements sums exactly with math.fsum, and bin_df_cols stops copying the frame and printing by default (verbose=False).
  • 🗑️ Removed the mprester_ptable.ipynb and mp_bimodal_e_form.ipynb examples: they needed a Materials Project API key, couldn’t run in CI and duplicated readme plots.
  • 🚧 CI installs playwright so headless-export and trait-parity tests run against the pinned matterviz-anywidget release (MATTERVIZ_ANYWIDGET_DIR for a local build).
  • 💥 Removed: render_widget_headless (use to_img or render_widgets_headless) and py_pkg_treemap(cell_text_fn=True). phonon_dos(normalize=...) errors are TraitErrors, SpacegroupBarPlotWidget().data defaults to None and MatterVizWidget(version_override=...) is keyword-only.

v0.18.0

7 June 2026

💥 Breaking Changes

🎉 New Features

🛠 Enhancements

🐛 Bug Fixes

v0.17.6

2 May 2026

🛠 Enhancements

🐛 Bug Fixes

💡 Refactoring

v0.17.5

4 March 2026

🛠 Enhancements

v0.17.4

11 February 2026

🛠 Enhancements

🐛 Bug Fixes

💡 Refactoring

🏷️ Type Hints

New Contributors

v0.17.3

7 November 2025

💥 Breaking Changes

🐛 Bug Fixes

🏷️ Type Hints

v0.17.2

14 August 2025

🛠 Enhancements

🐛 Bug Fixes

🏷️ Type Hints

v0.17.1

29 July 2025

🛠 Enhancements

🐛 Bug Fixes

v0.17.0

22 July 2025

🎉 New Features

💥 Breaking Changes

🛠 Enhancements

🐛 Bug Fixes

🧹 House-Keeping

New Contributors

v0.16.0

2 May 2025

  • Add py-pkg-treemap() #290
  • Add color_scale param to allow for linear, logarithmic, arcsinh scaling of property values in cluster_compositions #288
  • refactor cluster_compositions to take DataFrame as 1st arg, not composition list #287
  • Test example scripts with uv run in CI #286
  • New cluster module with functions for embedding, projecting and scattering compositions #285
  • spacegroup_sunburst and chem_sys_sunburst: add keywords max_slices and max_slices_mode: other | none #284
  • Multi-trace plotly powerups #283
  • brillouin_zone_3d now supports multiple structures/atoms in customizable grid layouts #282
  • Add max_cells: int | None keyword to chem_sys_treemap #281
  • structure_(2|3)d_plotly enable gradient-colored bonds #280
  • Auto font color for high contrast of element symbols in ptable_heatmap_splits #279
  • Update luminance calculation to use WCAG 2.0 standard coefficients #278
  • Fix structure_2d rotation keyword not applying to unit cell #276
  • spglib to moyo #275
  • fix bond drawing in structure_3d with better image atom handling #274
  • Use SI suffix number format in ptable colorbar tick labels #273
  • fix error in docstring #271
  • Remove matplotlib-based periodic table plotting functions #270
  • Ward metallic glasses train/val/test splits #269
  • Codecov #268
  • Support per-split colorbars and colorscales in ptable_heatmap_splits() #267
  • add enhance_parity_plot() powerup #266
  • add treemap.py with new chem_sys_treemap plot function #265
  • add chem_sys_sunburst() to pymatviz/sunburst.py to visualize chemical system distributions #264
  • test metallic glass feature engineering and model evaluation f0c5174
  • better colorbar tick formatting and spacing in density_scatter d1d51b4
  • RDF plotting hide legend for single structure dc8a1a2
  • fix confusion_matrix() mismatch of false-positive/negative counts and heatmap color ae5b629
  • contrast_ratio() in pymatviz/utils/plotting.py to calculate color contrast according to WCAG 2.0 b7c30cf
  • Add script to fetch and update papers citing pymatviz (#277) 6a2b831
  • add examples/mlip_phonons.py 608a12f
  • clean up examples/diatomics/calc_mlip_diatomic_curves.py and support multiple ML models d6fe3d9
  • add examples/compare_elastic_constants.py testing MACE vs MP PBE 2861298
  • Refactor ROC and PR curve no-skill line plotting 6d68cc1
  • readme.md add links to source and example code for each plot function 65ccb7c
  • add assets/scripts/key_enum_table.py to visualize Key enum attributes with Plotly 0598bb5
  • delete unused enums Model + ElemColorMode ee296bc
  • fix ptable_heatmap_splits() incorrectly handling hide_f_block keyword resulting in missing tiles for Rf 104 through Og 118 b9ccbf0
  • force LabelEnums to have labels, gives .label type str causing less mypy headache a6825ff

v0.15.1

28 January 2025

  • Remove hard-coded gridsize in density_hexbin #263
  • structure_2d and structure_3d now support ase.Atoms and sequences of them on top of pymatgen.Structure #262
  • add molecular dynamics attributes to Key enum 4b55a40
  • better Key.unit formatting: replace unicode sup/superscripts with <sup>/<sub>+ASCII eb12217
  • bump ruff to 0.9 and auto-fix 6989ba5
  • calculate MACE-MPA-0 diatomic curves 4dc5f1e

v0.15.0

21 December 2024

  • Multi-line ptable_scatter #260
  • Hetero-nuclear diatomics example with MACE #259
  • Add ptable_scatter #258
  • Remove cumulative.py and associated tests + assets #257
  • Support phonopy TotalDos and BandStructure in phonon_dos and phonon_bands plots #256
  • Add brillouin_zone_3d plot function #251
  • Add element color schemes alloys #255
  • delete pymatviz/classify/curves_matplotlib.py #254
  • plotly ROC and precision-recall curves #253
  • Add pymatviz.classify.confusion_matrix #252
  • Fix phonon_bands for band structures with different paths in k-space #250
  • keys.yml add more related to electronic, mechanical, thermal, and magnetic properties f377d95
  • classify/curves_plotly.py show threshold on hover, add_add_no_skill_line helper 77e765a
  • breaking: rename Key.cse to computed_structure_entry ab691bb
  • test_brillouin_zone_3d_trace_counts 44353aa

v0.14.0

21 November 2024

  • [Breaking] Split utils into sub-modules, move typing from utils to root (pmv.typing) #248
  • phonon_bands enable custom acoustic/optical bands #249
  • Split make_assets scripts by plot functions #247
  • ptable_heatmap_splits #246
  • Better ptable_hists defaults #244
  • Add ptable_hists #243
  • Enhance warning message for default return type change of ptable_heatmap #240
  • add @stylistic/eslint-plugin to fix eslint commit hook (closes https://github.com/janosh/pymatviz/issues/197) #197
  • add coordination_nums_in_structure in pymatviz/coordination/helpers.py bd54679
  • ptable_hists add x_axis_kwargs: dict[str, Any] | None = None to tweak x ticks and allow annotations renamed to be callable 6a6faad
  • sankey_from_2_df_cols add kwarg annotate_columns: bool | dict = True eed306a
  • new/renamed Key attributes n_structs, n_materials, n_molecules, n_samples, n_configs 786a666

v0.13.2

3 November 2024

  • Split coordination.py module into plotly.py and helpers.py #239
  • Fix ptable_heatmap_ratio following change of default count_elements fill_value to 0 #226
  • Speedup import and add regression check for import time #238
  • address coordination_hist TODO ‘get the right y_max when bar_mode=”stack”’ f73ba99
  • new Key enum attributes for DFT/experimental settings and paper/code metadata 8426bc2
  • dynamic element_pair_rdfs cutoff, defaults to 2x max_cell_len, allow negative values interpreted as scaling factor to max_cell_len (instead of absolute length in Angstrom) d6b1b01

v0.13.1

18 October 2024

  • fix ImportError: cannot import pymatgen.symmetry.analyzer.SymmetryUndeterminedError 298c49a

v0.13.0

17 October 2024

  • Fix /api docs by migrating to remark/rehype #237
  • Add coordination_vs_cutoff_line plot function #236
  • Reduce duplicate in dependency declare #231
  • Coordination number histograms #235
  • Add full_rdf #234
  • Experimental: add show_bonds: bool | NearNeighbors = False to structure_(2|3)d_plotly #233
  • drop correlation.py module #229
  • Custom site hover texts in pmv.structure_(2|3)d_plotly #228
  • Rainclouds #227
  • replace “sankey-crystal-sys-to-spg-symbol” with “sankey-spglib-vs-aflow-spacegroups” 3d818a1
  • more Key enum attributes for various errors and number of steps properties 701a445

v0.12.0

7 October 2024

  • use pytest-split in GitHub Action #224
  • Vertically/horizontally stacked XRD plots #223
  • add scaling_factor to pymatviz/ptable/plotly.py #210
  • Support plotting site vectors like forces/magmoms in structure_(2|3)d_plotly #220
  • Add add_annotation functionality for ptable plotters #200
  • Render spheres with hover tooltip on unit cell corners in pmv.structure_(2|3)d_plotly #219
  • structure_(2|3)d_plotly allow overriding subplot title’s y position and anchor #218
  • pin kaleido==0.2.1 #217
  • Add structure_3d #214
  • Clean up var names in unit tests, avoid MP API access in GitHub workflow #207
  • Add structure_2d to pymatviz/structure_viz.py #213
  • Fix xrd_pattern not allowing annotate_peaks=0 to disable peak annotation #212
  • Fix calculate_rdf not accounting for periodic boundaries #211
  • Support list/dict of structures in element_pair_rdfs #206
  • Add kwarg use_tooltips: bool = True to df_to_html (prev df_to_html_table) #205
  • Exclude tests from source distribution, and drop python2 tag for wheel #202
  • element_pair_rdfs plots radial distribution functions (RDFs) for element pairs in a structure #203
  • Add IS_IPYTHON global #198
  • ruff fixes #196
  • breaking: rename <xyz>_kwds -> <xyz>_kwargs for consistency 24261ca

v0.11.0

1 September 2024

  • Bump min supported Python to 3.10 #195
  • fix ptable_heatmap return type plt.axes->plt.Axes 1de350a

v0.10.1

18 August 2024

  • Self-import refactor #194
  • Fix svgo workflow for ptable scatter plots #187
  • density_scatter add kwarg facet_col: str | None = None #193
  • bin_df_cols leave input df unchanged #192
  • Re-export all submodules/subpackages from pymatviz.__init__.py #191
  • fix missing jinja2 dep at import time fb6c9df

v0.10.0

31 July 2024

  • density_scatter QoL tweaks #190
  • Breaking: drop plot_ prefix from multiple functions #189
  • Add protostructure terminology to enum #185
  • Update the function names for wren utils given breaking changes in Aviary #182
  • [Breaking] Refactor ptable heatmap plotter #157

v0.9.3

18 July 2024

  • Fix ptable scatter examples in homepage #180
  • Add pymatviz.io.df_to_svg #179
  • Better default ptable_heatmap tooltips #178
  • remove skip tag for tests #177
  • Moving enums may have broken end users pickle’s, reduce to str when pickling to be more backwards compatible going forward. #176
  • Better density_scatter #175
  • new ML model, metrics and computational details related enum keys b6cdca3

v0.9.2

7 July 2024

  • Fix ptable_heatmap for log=True #174
  • Fix missing keys Te + Nd in ELEM_COLORS_VESTA and support it in plot_structure_2d #173
  • Fix log_density in density_scatter #172

v0.9.1

4 July 2024

  • Split powerups module by backend: matplotlib/plotly/both #171
  • Fix count_elements for series of Composition #170
  • Fix and test ptable_heatmap text color logic #169
  • plot_xrd_pattern accept DiffractionPattern | Structure as input #168
  • Add plot_xrd_pattern() for creating interactive XRD patterns with plotly #167
  • Fix density_scatter metric annotation #166
  • Add toggle_log_linear_y_axis powerup #165
  • Fix bad NPY002 migration #163
  • refactor to explicit ax passing instead of relying on plt.gca() in example scripts 7912ec0
  • add_ecdf_line improve adapting trace_defaults from target_trace 4b451a3

v0.9.0

21 June 2024

  • Fix ruff NPY002 #162
  • density_scatter() #161
  • Add pymatviz.histogram.plot_histogram #159
  • Fix ptable_heatmap_ratio legend #158
  • ptable_scatters allow 3rd data dimension for colormap #155
  • Support passing sequence of structures to plot_structure_2d() to be plotted in grid #156
  • density_scatter() (#161) #160
  • when passed a series, plot_histogram now use series name as x-axis title e9697fc
  • import std lib StrEnum from enum if sys.version_info >= (3, 11) 510452a
  • add plot_structure_2d() keyword subplot_title: Callable[[Structure, str | int], str] | None = None 523101b

v0.8.3

30 May 2024

  • Fix PTableProjector.hide_f_block property #154
  • Handle missing value (NaN) and infinity for ptable data #152
  • [Enhancement/Breaking] Refactor ptable_hists #149
  • Add keyword log: bool = False to spacegroup_hist to log scale y-axis #148
  • MatPES EDA script #147
  • Fix ptable_heatmap_splits TypeErrors #146
  • Add mlff_phonons.ipynb example notebook #144
  • split examples/_generate_assets.py by pymatviz module whose plot functions are made assets for ef3f066
  • show ptable-heatmap-splits-3 in readme 1be63ea
  • fix docs build: ParseError: Unexpected character ‘“’ fbb2c8f

v0.8.2

11 May 2024

  • Add pymatviz/enums.py for SSOT on dataframe column and dict key names #143
  • Add keyword hide_f_block: bool = None (La and Ac series) to ptable plotters #140
  • Remove text background and fix z-order in structure_viz #139
  • Refactor ptable plotters and add ptable_heatmap with diagonally-split tiles #131
  • Migrate to flat eslint config file #137
  • Copy color options for element types from ptable_plots to ptable_hists #129
  • MACE-MP pair repulsion curves #127
  • Add validate_fig decorator utility #126
  • add_best_fit_line() power-up #125
  • plot_phonon_bands() add kwargs branch_mode: "union" | "intersection" = "union" and branches: Sequence[str] = () #124
  • breaking: rename fmt_spec keyword to fmt in si_fmt() for code base consistency 4d3091e
  • add decimal_threshold: float = 0.01 to si_fmt() 6ecf68a
  • fix docs build error and address bullet point 3 in #138 492cd53
  • update bibtex citation author list aa132d9

v0.8.1

11 February 2024

  • Breaking: rename custom plotly template pymatviz_(black-&gt;dark) #123
  • Add ptable_scatter #122
  • Minor format tweaks #120
  • Add pytest fixtures df_(float|mixed) to replace deleted pd._testing.make(Mixed)DataFrame() #121
  • add_ecdf_line() utility for plotting empirical cumulative distribution functions #117
  • Spacegroup hist plotly #116
  • Add plot_phonon_bands_and_dos() #115
  • Add show_values: bool = True to ptable_heatmap() and last_peak_anno: str to plot_phonon_dos() #114
  • Add plot_phonon_dos() for interactive plotly DOS plots #113
  • _generate_assets.py add code for assets/(phonon-bands-and-dos-dft|phonon-bands-dft|phonon-dos-dft).svg 93f72dc
  • ruff enable PD901+PLW2901 and fix violations 36f4771
  • breaking: absorb keywords sort and density_bins into hist_density_kwargs 64da6b2
  • breaking: rename elements_hist to hist_elemental_prevalence in pymatviz/histograms.py ebd067a
  • gray-shade negative frequencies in phonon bands and bands+DOS plots 882a6ca
  • breaking: remove residual_hist() from pymatviz/histograms.py 7780f68
  • mv dataset_exploration examples 8bfa4b8

v0.8.0

15 December 2023

  • Add plot_band_structure in new pymatviz/bandstructure.py module #112
  • Add hist_kwds arg to ptable_hists to customize histograms #111
  • Define custom pymatviz plotly templates #110
  • Support matplotlib Axes and Figure in add_identity_line #109
  • Tweaks #108
  • Add function ptable_hists #100
  • ptable_heatmap support 1s, 0s and negative values with log=True #107
  • ptable_heatmap add keywords cbar_range and cbar_kwargs #105
  • Add class TqdmDownload #104
  • Breaking: rename get_crystal_sys to crystal_sys_from_spg_num #103
  • Support semi-log + log-log plots in add_identity_line #102
  • plot_structure_2d add special site_labels: "symbol" | "species" #101
  • ptable_heatmap_ratio allow disabling not_in_numerator, not_in_denominator, not_in_numerator c4bc03d
  • fix add_identity_line for log-scaled matplotlib Axes: TypeError: ‘slope’ cannot be used with non-linear scales ead0ce9
  • add and test si_fmt_int in pymatviz/utils.py fc40cd7

v0.7.3

4 November 2023

  • Add styled_html_tag() in utils.py #99
  • Add si_fmt() for formatting large numbers in human-readable format #98

v0.7.2

30 October 2023

  • Fix and rename df_to_(svelte-&gt;html)_table #97
  • Add keyword default_styles: bool = True to df_to_pdf #96

v0.7.1

22 October 2023

  • Periodic table UX improvements #95
  • annotate_bars add keyword adjust_test_pos: bool = False #94
  • Add df_to_svelte_table #93
  • fix invalid count_mode ValueError err msg ae77997

v0.7.0

9 October 2023

  • Bump minimum Python version to 3.9 #92
  • Split pymatviz/io.py out from pymatviz/utils.py and add df_to_pdf() export function #91
  • Add KDE support to bin_df_cols utility function #90
  • Add patch_dict() utility #88
  • Breaking: rename ptable_heatmap and annotate_metrics float precision kwargs to fmt #87
  • Rename ptable_heatmap(_plotly) 1st arg: elem_values-&gt;values #86

v0.6.3

24 July 2023

  • Fix “Loading [MathJax]/extensions/MathMenu.js” in Plotly figures exported to PDF #83
  • Tiny doc update in ptable.py #82
  • Better type errors #80
  • ruff enable more rule sets #79
  • Disable save_fig() in CI #78
  • adhere to PEP 484 (no implicit optional) 8e50218
  • fix ruff TCH002,TCH003 d60276b
  • add ptable_heatmap kwarg label_map: dict[str, str] | False | None = None ef40171
  • migrate site to eslint-plugin-svelte 91d7909

v0.6.2

29 April 2023

  • Per-module doc pages #77
  • Refactor make_docs.py #76
  • DRY workflows #74
  • More flexible annotate_metrics util #73

v0.6.1

21 March 2023

  • Add kwarg axis: bool | str = "off" to plot_structure_2d() #72
  • Add ptable_heatmap cbar_precision kwarg #70
  • add changelog.md via auto-changelog 05da617
  • add half-baked /plots and /notebook pages ed171ec
  • add svelte-zoo PrevNext to notebooks pages 05368c0
  • add new option ‘occurrence’ for CountMode = element_composition|fractional_composition|reduced_composition bf1604a
  • refactor ptable_heatmap()’s tick_fmt() and add test for cbar_precision kwarg 3427e1f
  • plot_structure_2d() in site /api docs fcf75de

v0.6.0

21 February 2023

v0.5.3

20 February 2023

  • Pyproject #69
  • Add Ruff pre-commit hook #68
  • scatter_density() use x, y args as axis labels if strings 0f2386a
  • fix util save_and_compress_svg() and update plot_structure_2d() assets e0020aa
  • use redirect in layout.ts instead of ugly DOM href surgery to forward readme links to GH repo 7da3c0c
  • rename add_mae_r2_box() to annotate_mae_r2() c550332

v0.5.2

13 January 2023

  • pre-commit autoupdate #65
  • Deploy demo site to GitHub pages #64
  • Configure devcontainer for running notebooks in Codespace #63
  • Customizable parity stats #61
  • Support dataframes in true_pred_hist() #60
  • Support dataframes in relevance and uncertainty plots #59
  • Allow passing in dataframes and x, y as column names in parity plots #58
  • plot_structure_2d() doc str add “multiple structures in single figure example” #57
  • update examples/mp_bimodal_e_form.ipynb with MP r2SCAN beta release formation energies 396bdf4
  • add save_fig() to pymatviz/utils.py covered by test_save_fig() bcb8a06
  • add assets/make_api_docs.py 1b05792
  • Revert “Python 3.7 support (#55)” 4335001
  • remove google colab compat notices from example notebooks e7cc488
  • tweak docs CSS, add site footer 6319379
  • type test functions, update commit hooks incl. mypy, setup.cfg set implicit_optional=true which defaults to false in newer mypys 9303f7d
  • add docformatter pre-commit hook 25d700c
  • add citation.cff 531133c
  • residual_hist() remove args y_true, y_pred, now takes y_res directly 5c8ccbe

v0.5.1

8 October 2022

  • Python 3.7 support #55
  • move plot_defaults.py into pymatviz pkg #23973
  • add kwarg y_max_headroom=float to annotate_bars() d613d99

v0.5.0

21 September 2022

  • Support log-scaled heat maps in ptable_heatmap() #53
  • Improve tests for parity.py and relevance.py #51
  • Fix plot_structure_2d() show_bonds for disordered structures #50
  • Dataset exploration #49
  • Add examples/mp_bimodal_e_form.ipynb #47
  • Add unary ptable heatmap plot to examples/mprester_ptable.ipynb #46
  • fix: add .py to readme link #45
  • add test_ptable_heatmap_kwarg_combos #44
  • Fix windows CI #43
  • rm data/ex-ensemble-roost.csv, generate random regression data to plot example assets with numpy instead 11a47d3
  • breaking: rename {elements=>ptable}.py 1a87845
  • merge pymatviz/{quantile,ranking}.py into new pymatviz/uncertainty.py c4e0872
  • add examples/mprester_ptable.ipynb 04bf077
  • cleaner plt.Axes and go.Figure imports d21e6b4
  • add JupyterDash example to mprester_ptable.ipynb c4381d3
  • remove save_reference_img() from conftest.py 73fd600
  • rename cum_{res,err} to cumulative_{residual,error} 5d52181
  • add readme table with links to open notebooks in GH, Colab, Binder 13df583
  • add standardize_struct kwarg to plot_structure_2d() 21d1264
  • add pre-commit hook https://github.com/jendrikseipp/vulture 9dfb806

v0.4.4

9 July 2022

  • Add kwarg show_bonds to plot_structure_2d() #41
  • Add kwarg exclude_elements: Sequence[str] to ptable_heatmap() #40
  • fix broken readme image ![matbench-phonons-structures-2d] 17742d1
  • fix flaky CI error from matminer load_dataset() 0c0c043
  • fix plot_structure_2d() for pymatgen structures with oxidation states b61f4c0
  • plotly add_identity_line() use fig.full_figure_for_development() to get x/y-range 8ddf049
  • move codespell and pydocstyle commit hook args to setup.cfg 7338173
  • [pre-commit.ci] pre-commit autoupdate a0b5195

v0.4.3

2 June 2022

  • Fix GH not showing interactive Plotly figures in Jupyter #39
  • Add new plotly function sankey_from_2_df_cols() #37
  • note relation to ase.visualize.plot.plot_atoms() in plot_structure_2d() doc string f4c9fb7
  • corrections to element property data in pymatviz/elements.csv (thanks @robertwb) + origin link 444f9ba
  • fix add_identity_line() if plotly trace data contains NaNs c31ac55

v0.4.2

16 May 2022

  • Improve ptable_heatmap() colorscale kwarg #35
  • [pre-commit.ci] pre-commit autoupdate #34
  • Accept pmg structures as input for spacegroup_(hist|sunburst) #33
  • Fix spacegroup_hist() crystal system counts #32
  • Expand testing of keyword arguments #31
  • generate_assets.py refactor save_and_compress_svg() a47b811
  • add add_identity_line() in tests/test_utils.py faa6a52
  • readme remove ml-matrics to pymatviz migration cmd 0d123d4

v0.4.1

20 March 2022

  • Support space groups symbols as input to spacegroup_hist() #30
  • Support space groups symbols as input to spacegroup_sunburst() #28
  • Add some Juypter notebooks with usage examples #25
  • rm local structures data/structures/mp-*.yml, use matbench phonon structures instead 7ee4105
  • GH action bump setup-python to v3 9f21079
  • incl jupyter notebooks in ml-matrics to pymatviz migration cmd 619075f
  • readme clarify not being associated with pymatgen 64c95fb
  • fix plt.tight_layout() throwing AttributeError on density_hexbin plots (https://github.com/matplotlib/matplotlib/issues/22576) e5599a6
  • compress new SVG assets fe88271

v0.4.0

1 March 2022

  • Rename package to pymatviz (formerly ml-matrics) #23

v0.3.0

28 February 2022

  • Add plot_structure_2d() in new module ml_matrics/struct_vis.py #20
  • git mv data/{mp-n_elements<2,mp-elements}.csv (closes #19) #19
  • support atomic numbers in count_elements(), only element symbols before, add kwarg text_color in ptable_heatmap ada57cc
  • add kwargs {pre,suf}fix in add_mae_r2_box(), use pip cache in **publish.yml** 6f64c3b
  • better handling of atomic numbers in count_elements() when outside range [1, 118] e46b2c4
  • python-requires>=3.8 e0560af

v0.2.6

6 February 2022

  • add test for count_elements 4060d4e
  • use future import for py 3.10 type annotations ae5aa96
  • fix get_crystal_sys raise ValueError on non-positive space group numbers 9a535f7
  • add .github/workflows/publish.yml 7ce1c55
  • use actions/setup-{python,node} auto caching 613706c
  • drop py3.7 support, update pre-commit hooks 93c3eeb
  • gha test.yml add pytest-cov 16c92ab
  • readme remove asset compression note, rename scripts 41d5b6c

v0.2.5

26 November 2021

  • add ptable_heatmap() (closes #16) #16
  • delete metrics.py module + tests as they’re better placed in CompRhys/aviary#13 6870f2d
  • add new plotly fig spacegroup_sunburst 871c42a
  • some tweaks to ptable_heatmap, delete unused softmax + one_hot utils 3e931f2

v0.2.4

2 November 2021

  • ptable_heatmap add label precision kwarg, change text color to white on dark tiles, spacegroup_hist better label fontsizes, doc string improvements all around, pre-commit enforce all assets are SVGs d45511f

v0.2.3

18 October 2021

  • refactor ptable_heatmap to plot arbitrary data, not just elemental prevalence, add element properties to elements.csv 57ceb4d
  • ptable_heatmap add heat_labels kwarg for fraction, percent or None heat labels, make ptable_heatmap_ratio colors and legend customizable c3210bf

v0.2.2

14 October 2021

  • add typing_extensions as py37 dep and dynamically import Literal e69face
  • add codespell pre-commit hook + fix typos 58bfa75

v0.2.1

7 October 2021

  • readme move ptable_heatmap() and spacegroup_hist() plots to top ac000a4
  • spacegroup_hist() add crystal system counts 693307e
  • [pre-commit.ci] pre-commit autoupdate d6227dd

v0.2.0

4 October 2021

  • doc string improvements 6572d85
  • rename ptable_elemental_prevalence -> ptable_heatmap, ptable_elemental_ratio -> ptable_heatmap_ratio f4c915d
  • add pydocstyle pre-commit hook a379621
  • err_decay() accept and return axes object 60c0ceb
  • handle nan values in add_mae_r2_box be0acf1
  • fix on.paths in CI workflows f9e9ba2

v0.1.9

26 August 2021

v0.1.8

25 August 2021

  • [pre-commit.ci] pre-commit autoupdate #12
  • use numpy.typing.NDArray for type hints c99062c
  • add some more pre-commit-hooks dfb93e4

v0.1.7

3 July 2021

  • fully type annotate all functions and fix mypy errors b5729e3

v0.1.6

2 July 2021

  • fix ptable_elemental_prevalence cbar_max kwarg 9c92e7c

v0.1.5

12 May 2021

  • [pre-commit.ci] pre-commit autoupdate #11
  • ptable_elemental_prevalence change color map as black text on dark green (high prevalence) elements was unreadable 8bc17b5

v0.1.4

6 May 2021

  • add count as label below element symbols in ptable_elemental_prevalence 1a8d077
  • add format-ipy-cells pre-commit hook 7f83ce3
  • [pre-commit.ci] pre-commit autoupdate 70a5695

v0.1.3

10 April 2021

  • ptable_elemental_prevalence add cbar_max kwarg 829f762

v0.1.2

6 April 2021

  • release as PyPI package 1ab0d29
  • manually merge branch metrics. thx @CompRhys! 3ddb232
  • rename repo mlmatrics -> ml-matrics b65f50f
  • fix ptable_elemental_prevalence log scale colorbar 0913416
  • readme use referenced links for raw.githubusercontent images cbd1033
  • rename branch master -> main 50d73c6
  • fix setup.cfg to not pollute top level namespace in site-packages with generic data folder 10c8589

v0.1.1

6 April 2021

  • fix setup.cfg to not pollute top level namespace in site-packages with generic data folder 68a84b2
  • [pre-commit.ci] pre-commit autoupdate 49caa7f

v0.1.0

5 April 2021

  • concept names, publication plot params #2
  • clean up cumulative plots, add better data source for example plots, rename density_scatter to parity #1
  • add spacegroup_hist to histograms.py 41297ec
  • add clf_metrics.py ce4f864
  • initial commit 4a985c1
  • add correlation.py with marchenko_pastur plot 2e6665c
  • add more tests, especially for kwargs 600adbf
  • add residual_vs_actual(), residual_hist() in new histograms.py, add readme glossary ed8393c
  • release as PyPI package 511b5e3
  • manually merge branch metrics. thx @CompRhys! c3c284d
  • add bar values percent or count to hist_elemental_prevalence, more tests for elements.py + log_scale plots in readme 8d722f8
  • rename repo mlmatrics -> ml-matrics d5b741c
  • change ptable prevalence colors, log now uses base 10 494ac24
  • add true_pred_hist to histograms.py 0ea0ef6
  • add new plot ptable_elemental_ratio 6e91792
  • add err_decay to parity.py, display MAE + R^2 on all parity plots 3999b60
  • add type hints to parity.py ea94b0d
  • feature: add regression basic metrics for ensembles 141f4d9
  • fea: allow pre-computed elem_counts for ratio plot, allow cmap to be changed via kwarg 7ac598b
  • fix ptable_elemental_prevalence log scale colorbar c9d085e
  • add err_decay plots + plot function names to readme 9e994bb
  • err_decay use analytic rand_mean rather than estimating from sample be2b834
  • change ptable plots color bar to show log numbers when log_scale=True ed35532
  • add doc strings for density_scatter, residual_vs_actual, revert dependence on numpy.typing for now 006fdff
  • refactor using ax.set property batch setter 5a41284
  • add marchenko-pastur example with significant eigenvalue db7e725
  • readme add tip for how to depend on this package, regenerate requirements with pipreqs —force . cdae757
  • fix spacegroup_hist bars having wrong face colors 6a9ee75
  • add github action to compress SVGs on PR 2be7725
  • appease linter 39a3b15
  • speed up count_elements by removing for loop 1495701
  • add doc strings to relevance.py f372631
  • rename branch master -> main f56cf6e
  • fix requirements typo 9653a82
  • ptable_elemental_prevalence display original values above log-scale colorbar 665b05c
  • fix qq_gaussian miscal_area 8239949