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_structuresreturnskemio.Structures (to_structureiskemio.interop.to_structure, which also reads structure file paths; newstructure_dict,site_elements,site_symbols), compositions arekemio.Compositions (to_composition), RDFs come fromStructure.neighbor_list, coordination numbers fromkemio.coordination_numbers(strategy=a cutoff,"crystal_nn"or"voronoi"),chem_env_hierarchyenvironments fromkemio.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 andPhonopyobjects convert throughkemio.interop(exact frequencies and kept labels instead of a YAML round trip;phonon_dos(project=...)also takes phonopy and kemio projected DOS), space groups fromkemio.symmetry_dataset,xrd_plotpatterns fromkemio.xrd_patterns(disordered structures included), and convex hull stability from kemio’sPhaseDiagram(lists of pymatgen entries now accepted).band_structure,dosandbands_and_dostake vasprun.xml paths (kemio.io.read_vasprun), andPhononDBDocdecodes to kemioStructure/PhononBands/PhononDoswithout pymatgen.get_spacegroup_numberis removed (usenormalize_spacegroups); periodic-only functions require periodicity along all three axes (ASEAtomsneedpbc=True); mixed space group data raisesTypeError;pyyamlmoved to themake-assetsextra. Magpie composition features (cluster_compositionsdefault) come fromkemio.composition_features, bit-identical to matminer and without matminer or pymatgen:matminer_featurizeis nowmagpie_featurize(nopreset/n_jobs; unknownfeature_subsetlabels raise), and thedeml,matminer,matscholar_elandmegnet_elembeddings are removed (pass a callable or precomputed embeddings instead); a structure path that isn’t a file raisesFileNotFoundError. Space group symbols and crystal systems come from kemio, so moyopy is no longer a dependency (hm_symbol_to_spg_num_mapis removed; symbols accept kemio’s loose spellings and Hall symbols). Structure/DOS type aliases, theis_*structure predicates and monty decoding are kemio’s (kemio.interop).utils.testing.load_phonopy_naclis nowload_nacl_phonons(akemio.Phonons). pymatviz no longer imports pymatgen, ASE or phonopy anywhere: pymatgenTrajectoryobjects and JSON are read bykemio.interop.to_trajectory(unwrapped positions, oxidation states, site properties and frame properties kept; plain ones now sync as binary, malformed per-frame forces raise), andtests/test_without_optional_deps.pybuilds every widget with them blocked.pymatviz.typing.CrystalSystem(usekemio.options.CrystalSystem),Rgb256ColorType,RgbColorType,RgbAColorTypeandColorType(cluster_compositions(color_discrete_map=)takes CSS color strings),pymatviz.hierarchy.chem_env_nodes, thelabel/description/rel_path/from_labelfields ofpymatviz.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-definedNearNeighborsstrategies,chem_env_hierarchy’schem_env_settings(always ChemEnv now),coordination_vs_cutoff_line(strategy=)(nowcutoff_range=),phonopy_to_pymatgen_bands,phonon_dos_dict,is_instance_of(usekemio.interop.has_class),coordination_nums_in_structure(group_by="specie")andCompositionWidget.pymatgen_kwargsare 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 symbolsD/Tno 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_sunburstmerges 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. Duplicatepd.Seriesstructure labels raise.xrd_plottakes pattern dicts of pandas Series,histogramNumPy intbins,ptable_heatmapa singleexclude_elementsstring (andfill_valuewithheat_mode="fraction"/"percent"raises),count_elements{element: amount}dicts. Unnamed Series label density scatter axes “Actual”/”Predicted” (was “None”). Raising now: NaN inrainclouds(ValueError), site-less structures incoordination_bar_plot, array args todf_to_arrayswith a df.count_formulastreats onlyA-Belement strings as chemical systems. - 🐛 Widgets:
StructureWidget.structure,DosWidget.doses,BandStructureWidget.band_structs,XrdWidget.patterns,ConvexHullWidget.entriesandRdfPlotWidget.structuresconvert objects assigned after construction too (DOSstack=Truechecks grids in either order;RdfPlotWidgettakes lists and labeled dicts of structure objects).TrajectoryWidgetkeeps kemioStructure.infoframe metadata (extxyz), adds a frame dict’s keys to ASE calculator results instead of replacing them, plots userstepvalues on the x axis, sends ASE momenta as velocities, takes kemioio.Frames (also increate_widget) and{"frames": [...]}dicts holding structure objects, and sends kemio and pymatgen site-data vectors (e.g. velocities) as binary. Convex hull entries keep theirentry_id, entry formulas parse withkemio.Composition(groupings likeCa(OH)2), anddescribe_widgetdescribes phonon DOS. - 🐛 More input fixes:
count_elementscounts structures and names a bad item’s value;histogramrejects an invertedx_range,elements_hist(max_elements<1)raises,density_hexbin(marginal_bins=)takes NumPy ints;annotate_metricsdefaults to.3g(123, not1.23e+02);normalize_spacegroupsraises for mixed structures and numbers;Files.file_pathcreates parent dirs and never leaves partial downloads.py_pkg_treemap(group_by="directory")groups installed packages by directory, honorsmax_children_for_split=0, andcollect_source_modules_from_dirtakes oneproject_name.coordination_vs_cutoff_linetakes NumPy scalars,roc_curve/precision_recall_curveraise on shape mismatches,xrd_plottakes apd.Seriesof patterns,cluster_compositionshandles empty frames,sankeyrejectssource == target, float32calculate_rdfcutoffs 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 anddescribefailed).periodic_tablekeeps a pandas Series’ element index (was mapped to H, He, …), plot JSON keys andCoordinationBarPlotWidget/RdfPlotWidgetstructure labels that stringify identically raise,link_selectionignores clicks in other series,to_imgrespectswidth/heightstyles with whitespace or uppercase,widget_grid({})raises. Dict/list options (axes, color scales, ranges, …) also convert on reassignment, those with validators included (StructureWidget.isosurface_settingssynced NumPy isovalues), structure widgets convert NumPy values in structure properties (e.g. ASEAtoms.info), constructors convert each data trait once (was twice:RdfPlotWidgetwith 20 x 512-site structures builds in 37 instead of 49 ms),BandsAndDosWidgetchecksstack=TrueDOS grids and matching band/DOS labels on reassignment,spacegroup_bar_plottakes generators,SankeyWidgettuple nodes/links. Non-numericzinScatterPlot3DWidgetseries raises;describe()of an emptyXrdWidgetreports 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_histsraise on duplicate element keys,rdf_plotraises on unknownmode,qq_gaussian/error_decay_with_uncerttake an int column label orpd.Indexasy_std,py_pkg_treemapcountstyping.TYPE_CHECKINGimports as type-checking only. - 🐛
cluster_compositions(sort=)takes NumPy bools,count_elementsnames duplicate element keys,elements_histrejects negative counts, structure inputs may be NumPy object arrays. 💥histogram,raincloudsandcoordination_vs_cutoff_lineraise when labels collide as strings (1and"1"), likerdf_plot. - 🐛
pmv.structure(volumetric_data=..., isosurface_settings=...)with pymatgenChgcars,{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, hierarchydataandHeatmapMatrixWidget.valuesused to stay set and sync, as did values whose conversion failed with other errors (a missing vasprun.xml or structure file, a trajectory dict withoutframes), which now raiseTraitErrornaming 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_idtakes only strings or numbers (no bools). 💥 Invalid widget data raisestraitlets.TraitErroreverywhere (wasValueError/TypeErrorfor many traits). - 🐛
to_htmlpages load when a label contains<!--<script>,export_widgetsrejects names with path separators or./..before rendering,to_json(filename)creates parent folders,link_selectionlinks a repeated widget once (unlink()raised), anddescribe()/render_reportcover box, binned scatter, Sankey and coordination plots. - 🐛
RdfPlotWidgetandFermiSurfaceWidgetenforce one data source on assignment too (swapping insidehold_trait_notifications()still works), so saved JSON always loads.StructureWidget.volumetric_data = Noneraises like in the constructor (use[]for no volumes).widget_gridrequires a positive intn_colsand names non-MatterViz cells underPYMATVIZ_STATIC.HistogramWidget.binsandRdfPlotWidget.n_binsmust be >= 1,RdfPlotWidget.cutoff> 0.export_widgetsrejects names differing only in case.spacegroup_bar_plotcount 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
ValueErroron 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 acolorcolumn 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 aTraitErrornaming the valid range; frontend updates are clamped, and replacing data with shorter data clamps or resets the dependent index.link_selectionno 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
childrenand XRDx/y.periodic_table(heatmap_values=...)accepts NaN, ±inf and pandas NA (e.g. a Series with missing data) and draws them as missing tiles, liketile_plots.pmv.compositionkeeps oxidation states of mappings and pymatgen Compositions/structures ({"Fe2+": 1, "O2-": 1}, pymatgenSpecies): 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 likeFe12+raise. - 🏎️
count_elements~2x faster on formula strings,count_formulas(group_by="chem_sys")2.3x, widget JSON normalization 2.2x,py_pkg_treemap1.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_sunburstand the chem_env helpers live inpymatviz.hierarchy(pymatviz.sunburstandpymatviz.chem_envare removed),py_pkg_treemapinpymatviz.py_pkg(pymatviz.treemapis removed:pmv.treemapis the treemap widget),pymatviz.compositionispymatviz.compositions(it was hidden bypmv.composition, the composition widget),pymatviz.utilsis one module (paths, element lookups,df_to_arrays) and the demo/test data ofpymatviz.utils.testingmoved topymatviz.data(formula_spg_strtopymatviz.structures). Tests mirror the package: onetests/test_<module>.pyper module. - 💥 Element data comes from kemio’s element table:
pmv.utils.df_ptableispd.DataFrame(kemio.element_table().as_dict()).set_index("symbol")(singular column names, e.g.mass,specific_heat_capacity), andpymatviz/elements.csvandpymatviz.colorsare removed (Jmol colors come fromelement_table().jmol_color).TrajectoryWidgetencodes binary trajectories fromkemio.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’sPhaseDiagram.ids, XRD dicts fromXrdPattern.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_treemapof 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), sopy_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 (MatterVizlabel_align="top-left",--treemap-label-color,--treemap-cell-radius). - 💥 Dropped in favor of upstream packages:
si_fmt/si_fmt_int,html_tagand theenums.eV/angstrom_per_atom/cubic_angstromlabels,spg_num_to_from_symbolandspg_to_crystal_sys(usekemio.space_group_symbol/space_group_number/crystal_system),coordination_nums_in_structure(usekemio.coordination_numbers), the Ferroxtwo_theta/intensitiesXRD dict schema (passx/ydicts or kemioXrdPatterns), the VESTA, alloy and pastel element palettes withElemColorScheme(MatterViz ships them; coordination plots takeelement_colors={element: css_color}over Jmol, default bar colors are now Jmol), anddensity_scatter’s Python binning (bins,density: it colors by KDE and raises above 10k points, usedensity_hexbinfor 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*Widgetclasses are no longer exported frompmv(import them frompymatviz.widgetsfor type hints andisinstance), nor areWidgetGridandWidgetLink. 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=...)replacesfull_rdfandelement_pair_rdfs(bin_sizeand negative cutoffs are gone),coordination_bar_plot(structures, strategy=...)replacescoordination_hist(a MatterViz strategy name bonds in the browser, a cutoff,"crystal_nn"or"voronoi"computes in Python), andhistogramreplacesbinned_histogram(density, non-intbins,bin_width,orientationor more than 1M values bin in Python). - 💥
chem_sys_hierarchy(data, kind="sunburst" | "treemap")replaceschem_sys_sunburst/chem_sys_treemap,chem_env_hierarchyreplaceschem_env_sunburst/chem_env_treemap;pymatviz._hierarchyis the publicpymatviz.hierarchy. - 💥 The
Keyenum and its 1900-linekeys.yml(from Matbench Discovery) are removed: use plain column names like"spg_num". - 💥
pymatviz.widgets.mimeandregister_matterviz_widgetsare folded intopmv.notebook_mode, which now also covers marimo;pymatviz.notebook.create_widgetbuilds the widget for a displayable object. - 🎉 Widget traits are generated from MatterViz’s widget model schema (
pymatviz/widgets/_schema_traits.py, regenerated byuv 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_plotandhistogramtake a DataFrame withx=/y=column names andcolor=to split it into one series per value;heatmap_matrix(df)plots a DataFrame matrix. - 🎉
widget.to_json()andpmv.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_modeaccepts plain strings like"occurrence"(typed asElemCountModeName). - 💥 Leaner, more consistent API. The top-level
pmvnamespace 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_spacegroupsandsankey_flow_datamoved to their modules (pmv.utils,pmv.enums,pymatviz.compositions,pymatviz.structures,pymatviz.sankey).phonon_bandsandphonon_bands_and_dosare removed:band_structure,dosandbands_and_dostake phonopyBandStructure/TotalDosdirectly,bands_and_doschecks that band and DOS labels match, and DOS widgets check stacked DOS share one grid.density_scatter_with_histanddensity_hexbin_with_histare removed: passdensity_hexbin(..., marginal_bins=100)(plusbin_px=1.5for the fine-grained look).sankey_from_2_df_cols(df, [source, target])→sankey(df, source, target)(same forsankey_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=inchem_sys_*andchem_env_*,cluster_compositions(df_in=)→df=(with keyword-onlycomposition_col), androc_curve/precision_recall_curvetakedfkeyword-only. - 💥
pymatviz.process_datais split up:count_elements/count_formulaslive in the newpymatviz.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 newpymatviz.structures,df_to_arraysinpymatviz.utils, andsankey_flow_datainpymatviz.sankey.bin_df_cols(use pandasgroupbywithpd.cut) andnormalize_phonon_bandsare removed (the band widgets convert phonopy input themselves). - 💥
structure_3d,brillouin_zone_3d,seekpath_primitive, thepymatviz.structureandpymatviz.brillouinmodules and thebrillouinextra (seekpath) are removed: usepmv.structure(...)andpmv.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 newpmv.widget_grid({title: widget}, n_cols=3).get_site_species/get_site_elements/get_site_symbolmoved topymatviz.structuresand the disordered demo structures topymatviz.data. The unusedpymatviz.enums.TaskandSiteCoordsenums are removed. - 💥 plotly and kaleido are no longer dependencies: every plot function returns a MatterViz anywidget (
ScatterPlotWidget, newBinnedScatterPlotWidget,PeriodicTableWidget,BarPlotWidget, newBoxPlotWidget, newSankeyWidget, newCoordinationBarPlotWidget,HeatmapMatrixWidget,XrdWidget,RdfPlotWidget,BandStructureWidget/DosWidget/BandsAndDosWidget,BrillouinZoneWidget,StructureWidget,SunburstWidget,TreemapWidget) instead of ago.Figure; export withwidget.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,*_kwargstrace/layout dicts, font/scale/border options). Extra widget options are**kwargs, with dict options such asx_axis/y_axismerged 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_uncertdropsn_rand(the random baseline is now the exact closed form instead of a Monte Carlo shuffle);add_best_fit_linefits in display space on log axes (power law on log-log); coordination split modes arenone/by_element/by_structure; color scales use d3 interpolator names (interpolateViridis). New MatterViz features need janosh/matterviz#520 (janosh/pymatviz#370). - 💥
sankey_flow_datareturns SankeyWidget data{"nodes": [{id, label, metadata}], "links": [{source, target, value}]}instead of plotly’slabels/source_indices/target_indices/valuelists, 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
TypeErrorfor unknown kwargs (typos or plotly-only options likewidth/template) instead of silently dropping them. - 🏎️
ScatterPlotWidget/BinnedScatterPlotWidgetseries with at least 10k numeric points sync as binaryplot-seriesarrays: a 1e6-point series builds in ~3 ms with 16 MB of buffers instead of ~360 ms and 41 MB of JSON.ptable_histsbins 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 pymatvizno longer loadspymatgen.io.phonopy. - 🐛
HistogramWidget.seriesassignments now normalize sample arrays and reject invalid data withTraitError, including rollback of batched updates.HistogramWidget,BarPlotWidgetandScatterPlot3DWidgetvalidateseriesonce, in their trait validator, so constructors and assignments alike raiseTraitError(notValueError) for invalid series;ScatterPlot3DWidgetseries of at least 10k points sync as binary withz. - 🐛 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 exportdpi, 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=(alsoBandsAndDosWidget; both take a{label: obj}dict to overlay several),log_scale,logandcolor_scale_range→ onecolor_scale(d3 interpolator name or{scheme, type, value_range, palette_range}dict, e.g.{"type": "log", "value_range": [1, None]}) andshow_color_bar→color_bar(dict ofColorBarprops,{}shows the default bar,Nonehides it; new onHeatmapMatrixWidgetandFermiSurfaceWidget, where it shows incolor_property="property"mode) onHeatmapMatrixWidget/PeriodicTableWidget,TreemapWidget.export_buttons→export_formats(e.g.["svg", "png"],[]hides the export pane),show_gizmo→gizmo(boolorGizmoOptionsdict) onStructureWidget/TrajectoryWidget,HistogramWidget.selected_property→ two-wayselected_series_idx.TrajectoryWidget.display_modeis"auto"(default) /"structure+plot"/"structure"/"plot", with the plot kind in the new two-wayplot_type("time-series"/"distribution") anddistribution_property, so"structure+scatter"→"structure+plot"and"structure+histogram"→display_mode="structure+plot", plot_type="distribution". Removed:band_typeonBandStructureWidget/BandsAndDosWidget(detected from the data),controlsonXrdWidget/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 aCaselessStrEnum.show_bondstakes"always"/"crystals"/"molecules"/"never"(show_bonds=Truenever drew bonds; it now raisesTraitError). Now validated:color_scalenames (the 38 d3 interpolators),camera_projectiononBrillouinZoneWidget/FermiSurfaceWidget/ScatterPlot3DWidget,FermiSurfaceWidget.representation,DosWidgetnormalize/orientation/spin_mode,RdfPlotWidget.modeandBinnedScatterPlotWidget.marginalsstrings. Newly accepted:bonding_strategy/strategy="pair_cutoffs"andStructureWidget.display_mode="split". - 💥
StructureWidget.isosurface_settingsis layers-only ({"layers": [{volume_id, color_volume_id?, isovalue, color, opacity, visible, show_negative, negative_color}], "wireframe", "halo"}), each layer picking its volume byvolume_id;volumetric_dataaccepts pymatgenVolumetricDataobjects (ids = theirdatakeys, e.g."total") and nested-griddicts (iddefaults tolabel), or a{prefix: volume}mapping giving"prefix/id"ids so e.g. two Chgcars don’t collide; ids must be unique. Layers without avolume_id, or whosevolume_id/color_volume_idmatches no Python-side volume, raiseTraitError(matterviz drops them silently); swap volumes and layers together inhold_trait_notifications(). Payloads are emitted as flatvalues+dims(shape errors are reported by the renderer).HistogramWidget.seriesrequires sample arrays invaluesand usescolorfor fills; the legacy{x, y, line_style}input shape is removed. - 💥 Silent fallbacks now raise: unknown
chem_env_settingsstrings, ChemEnv/CrystalNN setup failures andImportErrors (chem_env_sunburst/chem_env_treemap, which used to return an empty figure); unknowncolor_by/group_by, missing packages and failed on-the-fly coverage runs (py_pkg_treemap); out-of-rangesite_idx(classify_local_env_with_order_params);marginal_x/marginal_y(density_*_with_hist). - 💥
annotate_metricsdict values may be metric names to compute ({"Mean abs. error": "MAE"}); other non-numbers raise.add_ecdf_linedropsoffset_size. Removed unused unit constants (eV_per_atom,giga_pascal,joule_per_mol, …),ExperimentalWarning,pmv.crystal_sys_order(usetyping.get_args(kemio.options.CrystalSystem)),pmv.io.TqdmDownloadandpmv.utils.patch_dict(usedct | updates). - 💥
StructureWidget,BrillouinZoneWidgetandlink_selectionshare one strict structure converter: dicts need asiteslist, lists of structures and non-structures raiseTypeError, BZ accepts PhonopyAtoms.TrajectoryWidgetframeforce/forcesmust be shape (n_sites, 3). - 🎉 Plot widgets gain
controls_open(two-way),controls_toggle_props,controls_pane_props;ScatterPlotWidgetgainsshow_legend,marker_renderer;ScatterPlot3DWidgetgainsshow_legend;StructureWidgetgains two-wayactive_volume_id,display_mode("structure" | "slice"),slice_settings;TrajectoryWidgetgainsatom_type_mappingfor LAMMPS dumps loaded viadata_url;BandsAndDosWidgetgains a sharedfermi_level;TreemapWidgetgainsmax_children(keep the N largest children per parent, bucket the rest). - 🐛
TrajectoryWidgetper-frame forces (dict frames,Structure.properties, ASE calculators) show as force arrows and Fmax/Fnorm plots again under matterviz 0.8; pymatgenTrajectoryobjects and theiras_dict()load (were a broken frame /KeyError); ASE calculator energy and forces are kept. - 🐛
TrajectoryWidgetaccepts pymatgenMSONAtomsframes. - 🐛 Widget SVG export (
to_img(fmt="svg")) runs MatterViz’s ownexport_svg(behind each widget’s Export pane) instead of a pymatviz copy: files carry the renderedwidth/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 andto_htmlpages use a sans-serif system font instead of Times. Headless export no longer crashes on widgets with unsetseries/trajectory/volumetric_data. - 🎉
link_selectionlinksPeriodicTableWidgets: selecting a structure highlights its elements; clicking tiles dims scatter points (by seriespoint_ids) whose structure lacks all clicked elements. New two-wayPeriodicTableWidget.active_elements(a list makes tile clicks toggle elements;Nonekeeps click-to-pin) andScatterPlotWidget.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.pyrenders 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_STATICset, widgets display as PNGs also as a cell’s bare last expression (not only via.show()), andwidget_gridlayouts as an HTML grid of PNGs, so executed notebooks render on GitHub and the docs site without embedded widget state. - 🏎️
precision_recall_curvedrops points that don’t change the curve (sklearndrop_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-pointmetadataas a pandas DataFrame (one row per point). - 🐛
cluster_compositionslabels missing categorical values"nan"under pandas 2 and 3 alike. - 💥🏎️
SpacegroupBarPlotWidget.datasyncs 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/raincloudssend series with at least 10k samples as binary arrays, and their invalid series raiseTraitErrorlike the other plot widgets. - 🐛
spacegroup_barcount 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 (nonest-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_DIRstill 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.pychecks traits against the bundle’swidget-model-keys.json. - 💥🏎️
BandStructureWidget/DosWidget/BandsAndDosWidgetdrop pymatgen’sprojections,pdosandeigendisplacements(never drawn, nor thestructure,atom_dosandspd_dosthey 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 pymatviztakes 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-inR2/MAPEmetrics 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
Noneinstead of{}/[], so MatterViz’s own defaults apply:StructureWidgetno longer crashes rendering (emptyisosurface_settings) andScatterPlot3DWidgetwithsize_valuesno longer draws scene-filling spheres (emptysize_scale). - 🐛
normalize_plot_jsonno 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)andpymatviz.structure.helpers.standardize_structare removed: passcell_type="conventional"(or"primitive"), a newStructureWidgettrait. MatterViz standardizes the cell and carries site properties over, rotating forces, magmoms and ADP tensors into the standardized frame (pymatgen copied them unrotated).BrillouinZoneWidgetdraws the high-symmetry k-path again (default_k_path=True, or passk_path). - 💥
notebook_moderegisters 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 silentrepr. - 💥 Fail fast instead of guessing:
MATTERVIZ_ANYWIDGET_DIRwithout a built bundle raisesFileNotFoundError(it silently used the CDN),histogram(density=True)raises for series without samples in range, convex-hull entries no longer silently drope_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_htmltakescss_contentorcss_urlby 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.CoordinationBarPlotWidgetsends structure entries MatterViz reads (no bars drew).confusion_matrixmetrics 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_neighborsreturns a per-structure function),element_pair_rdfsone search for all pairs (4x),count_elementssums exactly withmath.fsum, andbin_df_colsstops copying the frame and printing by default (verbose=False). - 🗑️ Removed the
mprester_ptable.ipynbandmp_bimodal_e_form.ipynbexamples: 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-anywidgetrelease (MATTERVIZ_ANYWIDGET_DIRfor a local build). - 💥 Removed:
render_widget_headless(useto_imgorrender_widgets_headless) andpy_pkg_treemap(cell_text_fn=True).phonon_dos(normalize=...)errors areTraitErrors,SpacegroupBarPlotWidget().datadefaults toNoneandMatterVizWidget(version_override=...)is keyword-only.
v0.18.0
7 June 2026
💥 Breaking Changes
- Drop redundant
_plotlysuffix from plot functions lacking matplotlib counterparts by @janosh in https://github.com/janosh/pymatviz/pull/350 - Fix 30+ bugs from whole-repo cold review, delete dead code, dedupe logic by @janosh in https://github.com/janosh/pymatviz/pull/352
🎉 New Features
- Migrate widget bundle to matterviz-anywidget npm package; add export/describe APIs by @janosh in https://github.com/janosh/pymatviz/pull/351
🛠 Enhancements
- Improve widget and plot data input handling by @janosh in https://github.com/janosh/pymatviz/pull/348
🐛 Bug Fixes
- Tighten data validation and simplify tests by @janosh in https://github.com/janosh/pymatviz/pull/349
v0.17.6
2 May 2026
🛠 Enhancements
- Add headless widget image export and improve widget APIs by @janosh in https://github.com/janosh/pymatviz/pull/343
- Add multi-vector-per-atom rendering by @janosh in https://github.com/janosh/pymatviz/pull/344
- Add adaptive depth pruning and language-agnostic source_dir mode to
py_pkg_treemapby @janosh in https://github.com/janosh/pymatviz/pull/346 - Add
PYMATVIZ_STATICenv var for static PNG rendering inshow()by @janosh in https://github.com/janosh/pymatviz/commit/285c20c
🐛 Bug Fixes
- Fix
save_figr+bug by @janosh in https://github.com/janosh/pymatviz/commit/3e24d65
💡 Refactoring
- Replace Deno and ESLint with vite-plus tooling by @janosh in https://github.com/janosh/pymatviz/pull/345
- Remove dead
df_to_pdfanddf_to_svgby @janosh in https://github.com/janosh/pymatviz/commit/3e24d65
v0.17.5
4 March 2026
🛠 Enhancements
- Add element and site projected phonon DOS support by @janosh in https://github.com/janosh/pymatviz/pull/339
- Add widget state export helpers and harden projected DOS tests by @janosh in https://github.com/janosh/pymatviz/pull/340
- Add periodic table, 3D scatter, heatmap, RDF, spacegroup, and chem pot widgets by @janosh in https://github.com/janosh/pymatviz/pull/342
v0.17.4
11 February 2026
🛠 Enhancements
- Add 8 new MatterViz widgets for band structures, DOS, convex hulls, and more by @janosh in https://github.com/janosh/pymatviz/pull/336
- Add
show_image_vectorsoption tostructure_2dandstructure_3dby @lan496 in https://github.com/janosh/pymatviz/pull/338
🐛 Bug Fixes
- Dynamically link to function source line number from
readme.mdby @DanielYang59 in https://github.com/janosh/pymatviz/pull/333 - Fix minor colorbar tick issues in ptable_heatmap when log=True by @chhyyi in https://github.com/janosh/pymatviz/pull/334
- fix: handle pymatgen Magmom objects in show_site_vectors by @lan496 in https://github.com/janosh/pymatviz/pull/337
💡 Refactoring
- Separate data preprocessing from plotters by @janosh in https://github.com/janosh/pymatviz/pull/332
🏷️ Type Hints
- Fix all
tyv0.9.0 errors by @janosh in https://github.com/janosh/pymatviz/pull/331
New Contributors
- @chhyyi made their first contribution in https://github.com/janosh/pymatviz/pull/334
- @lan496 made their first contribution in https://github.com/janosh/pymatviz/pull/337
v0.17.3
7 November 2025
💥 Breaking Changes
- Remove
density_scatteraliasdensity_scatter_plotlyby @janosh in https://github.com/janosh/pymatviz/pull/323
🐛 Bug Fixes
- Fix widget arg names by @janosh in https://github.com/janosh/pymatviz/pull/322
- Handle disordered structures in
coordination_vs_cutoff_lineby @janosh in https://github.com/janosh/pymatviz/pull/326
🏷️ Type Hints
- Remove unused type ignores by @janosh in https://github.com/janosh/pymatviz/pull/328
v0.17.2
14 August 2025
🛠 Enhancements
py_pkg_treemap()add heatmap mode to color by module stats such as coverage by @janosh in https://github.com/janosh/pymatviz/pull/317
🐛 Bug Fixes
- Upgrade
uv_build>=0.8.10to fix wheel permissions issue by @janosh in https://github.com/janosh/pymatviz/pull/320
🏷️ Type Hints
- Replace
mypywithtyinpre-commitby @DanielYang59 in https://github.com/janosh/pymatviz/pull/314
v0.17.1
29 July 2025
🛠 Enhancements
- Bump
mattervizby @janosh in https://github.com/janosh/pymatviz/pull/315
🐛 Bug Fixes
- Fix
FileNotFoundErrorpyproject.tomlin 0.17.0 by @janosh in https://github.com/janosh/pymatviz/pull/313
v0.17.0
22 July 2025
🎉 New Features
- MatterViz widgets by @janosh in https://github.com/janosh/pymatviz/pull/311
- Sunburst of coordination numbers and environments by @janosh in https://github.com/janosh/pymatviz/pull/295
💥 Breaking Changes
- Add
cell_size_fn: Callable[[ModuleStats], float]keyword topy_pkg_treemapby @janosh in https://github.com/janosh/pymatviz/pull/293 - Support disordered site rendering in
structure_(2|3)d_plotly()by @janosh in https://github.com/janosh/pymatviz/pull/301 - Remove
residual_vs_actual()by @janosh in https://github.com/janosh/pymatviz/pull/302 chem_env_treemapby @janosh in https://github.com/janosh/pymatviz/pull/303- Drop
matplotlibdependency, refactor few remainingmatplotlibfunctions toplotlyby @janosh in https://github.com/janosh/pymatviz/pull/305
🛠 Enhancements
cluster_compositionsaddannotate_pointskeyword by @janosh in https://github.com/janosh/pymatviz/pull/291- Add element color legend to plotly 2d and 3d structure visualizations by @janosh in https://github.com/janosh/pymatviz/pull/298
- Auto-render pymatgen/ASE objects when returned from notebook cells by @janosh in https://github.com/janosh/pymatviz/pull/299
structure_(2|3)d_plotlyaddcell_boundary_tol: float | dict[str, float]by @janosh in https://github.com/janosh/pymatviz/pull/300
🐛 Bug Fixes
- Fix plotly validators by @bmaranville in https://github.com/janosh/pymatviz/pull/310
🧹 House-Keeping
- Rename
structure_(2|3)d_plotlytostructure_(2|3)dby @janosh in https://github.com/janosh/pymatviz/pull/304 - Update
pytest-splitdurations by @janosh in https://github.com/janosh/pymatviz/pull/306
New Contributors
- @bmaranville made their first contribution in https://github.com/janosh/pymatviz/pull/310
v0.16.0
2 May 2025
- Add
py-pkg-treemap()#290 - Add
color_scaleparam to allow for linear, logarithmic, arcsinh scaling of property values incluster_compositions#288 - refactor cluster_compositions to take DataFrame as 1st arg, not composition list
#287 - Test example scripts with
uv runin CI#286 - New
clustermodule 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
plotlypowerups#283 brillouin_zone_3dnow supports multiple structures/atoms in customizable grid layouts#282- Add
max_cells: int | Nonekeyword tochem_sys_treemap#281 structure_(2|3)d_plotlyenable gradient-colored bonds#280- Auto font color for high contrast of element symbols in
ptable_heatmap_splits#279 - Update
luminancecalculation to use WCAG 2.0 standard coefficients#278 - Fix
structure_2drotationkeyword not applying to unit cell#276 spglibtomoyo#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()inpymatviz/utils/plotting.pyto calculate color contrast according to WCAG 2.0b7c30cf- 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.mdadd links to source and example code for each plot function65ccb7c- 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
gridsizeindensity_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.pyand associated tests + assets#257 - Support
phonopyTotalDosandBandStructureinphonon_dosandphonon_bandsplots#256 - Add
brillouin_zone_3dplot function#251 - Add element color schemes
alloys#255 - delete pymatviz/classify/curves_matplotlib.py
#254 plotlyROC and precision-recall curves#253- Add
pymatviz.classify.confusion_matrix#252 - Fix
phonon_bandsfor 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
utilsinto sub-modules, movetypingfromutilsto root (pmv.typing)#248 phonon_bandsenable custom acoustic/optical bands#249- Split
make_assetsscripts by plot functions#247 ptable_heatmap_splits#246- Better
ptable_histsdefaults#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.pymodule intoplotly.pyandhelpers.py#239 - Fix
ptable_heatmap_ratiofollowing change of defaultcount_elementsfill_valueto 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
/apidocs by migrating toremark/rehype#237 - Add
coordination_vs_cutoff_lineplot function#236 - Reduce duplicate in dependency declare
#231 - Coordination number histograms
#235 - Add
full_rdf#234 - Experimental: add
show_bonds: bool | NearNeighbors = Falsetostructure_(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-splitin 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_annotationfunctionality 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_plotlyallow 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_2dtopymatviz/structure_viz.py#213 - Fix
xrd_patternnot allowingannotate_peaks=0to disable peak annotation#212 - Fix
calculate_rdfnot accounting for periodic boundaries#211 - Support
list/dictof structures inelement_pair_rdfs#206 - Add kwarg
use_tooltips: bool = Truetodf_to_html(prevdf_to_html_table)#205 - Exclude
testsfrom source distribution, and drop python2 tag for wheel#202 element_pair_rdfsplots radial distribution functions (RDFs) for element pairs in a structure#203- Add
IS_IPYTHONglobal#198 - ruff fixes
#196 - breaking: rename <xyz>_kwds -> <xyz>_kwargs for consistency
24261ca
v0.11.0
1 September 2024
v0.10.1
18 August 2024
- Self-import refactor
#194 - Fix
svgoworkflow for ptable scatter plots#187 density_scatteradd kwargfacet_col: str | None = None#193bin_df_colsleave 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_scatterQoL 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_heatmaptooltips#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_heatmapforlog=True#174 - Fix missing keys
Te+NdinELEM_COLORS_VESTAand support it inplot_structure_2d#173 - Fix
log_densityindensity_scatter#172
v0.9.1
4 July 2024
- Split
powerupsmodule bybackend:matplotlib/plotly/both#171 - Fix
count_elementsfor series ofComposition#170 - Fix and test
ptable_heatmaptext color logic#169 plot_xrd_patternacceptDiffractionPattern | Structureas input#168- Add
plot_xrd_pattern()for creating interactive XRD patterns with plotly#167 - Fix
density_scattermetric annotation#166 - Add
toggle_log_linear_y_axispowerup#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
ruffNPY002#162 density_scatter()#161- Add
pymatviz.histogram.plot_histogram#159 - Fix
ptable_heatmap_ratiolegend#158 ptable_scattersallow 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_blockproperty#154 - Handle missing value (NaN) and infinity for ptable data
#152 - [Enhancement/Breaking] Refactor
ptable_hists#149 - Add keyword
log: bool = Falsetospacegroup_histto log scale y-axis#148 - MatPES EDA script
#147 - Fix
ptable_heatmap_splitsTypeErrors#146 - Add
mlff_phonons.ipynbexample 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.pyfor SSOT on dataframe column and dict key names#143 - Add keyword
hide_f_block: bool = None(La and Ac series) toptableplotters#140 - Remove text background and fix z-order in
structure_viz#139 - Refactor
ptableplotters and addptable_heatmapwith diagonally-split tiles#131 - Migrate to flat
eslintconfig file#137 - Copy color options for element types from
ptable_plotstoptable_hists#129 - MACE-MP pair repulsion curves
#127 - Add
validate_figdecorator utility#126 add_best_fit_line()power-up#125plot_phonon_bands()add kwargsbranch_mode: "union" | "intersection" = "union"andbranches: 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->dark)#123 - Add ptable_scatter
#122 - Minor format tweaks
#120 - Add
pytestfixturesdf_(float|mixed)to replace deletedpd._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 = Truetoptable_heatmap()andlast_peak_anno: strtoplot_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_structurein newpymatviz/bandstructure.pymodule#112 - Add
hist_kwdsarg toptable_histsto customize histograms#111 - Define custom
pymatvizplotly templates#110 - Support matplotlib
AxesandFigureinadd_identity_line#109 - Tweaks
#108 - Add function
ptable_hists#100 ptable_heatmapsupport 1s, 0s and negative values withlog=True#107ptable_heatmapadd keywordscbar_rangeandcbar_kwargs#105- Add class
TqdmDownload#104 - Breaking: rename
get_crystal_systocrystal_sys_from_spg_num#103 - Support semi-log + log-log plots in
add_identity_line#102 plot_structure_2dadd specialsite_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()inutils.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->html)_table#97 - Add keyword
default_styles: bool = Truetodf_to_pdf#96
v0.7.1
22 October 2023
- Periodic table UX improvements
#95 annotate_barsadd keywordadjust_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.pyout frompymatviz/utils.pyand adddf_to_pdf()export function#91 - Add KDE support to
bin_df_colsutility function#90 - Add
patch_dict()utility#88 - Breaking: rename
ptable_heatmapandannotate_metricsfloat precision kwargs tofmt#87 - Rename
ptable_heatmap(_plotly)1st arg:elem_values->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 ruffenable 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_metricsutil#73
v0.6.1
21 March 2023
- Add kwarg
axis: bool | str = "off"toplot_structure_2d()#72 - Add
ptable_heatmapcbar_precisionkwarg#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
- Pyproject
#69
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
devcontainerfor 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.pyandrelevance.py#51 - Fix
plot_structure_2d()show_bondsfor 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}.py1a87845 - merge
pymatviz/{quantile,ranking}.pyinto new pymatviz/uncertainty.pyc4e0872 - add examples/mprester_ptable.ipynb
04bf077 - cleaner plt.Axes and go.Figure imports
d21e6b4 - add JupyterDash example to
mprester_ptable.ipynbc4381d3 - remove save_reference_img() from conftest.py
73fd600 - rename
cum_{res,err}tocumulative_{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_bondstoplot_structure_2d()#41 - Add kwarg
exclude_elements: Sequence[str]toptable_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()colorscalekwarg#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 moduleml_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}fixinadd_mae_r2_box(), usepipcache 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 caching613706c - 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
- remove ml_matrics.utils.add_identity, use plt.axline instead https://git.io/JERaj
d30a29f
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