Skip to content

Stable PyPI release needed: 2026.7.20 cannot display structures with current pymatgen and flask-caching #545

Description

@computron

The latest stable release (2026.7.20) no longer displays any Structure or Molecule in Jupyter for a fresh install. I would like a stable PyPI release that fixes both of the problems below, so that my pymatgen and atomate2 tutorials can go back to a plain pip install crystal-toolkit.

Repro in a fresh environment (a fresh pip install crystal-toolkit jupyter today gives crystal-toolkit 2026.7.20, pymatgen 2026.9.24 / pymatgen-core 2026.9.23, flask-caching 2.5.1, dash 3.4.0; tested on Python 3.12 with JupyterLab 4.6.4):

import crystal_toolkit
from pymatgen.core import Lattice, Structure
Structure(Lattice.cubic(3.9), ["Pb"], [[0, 0, 0]])  # last line of a notebook cell
  1. pymatgen >= 2026.9.23 removed StructureGraph.with_empty_graph / with_local_env_strategy and the MoleculeGraph equivalents ([Breaking] Remove deprecated function/class/methods whose deadlines are in 2025 pymatgen-core#103). This is fixed on main in Fix deprecated from pmg #542, but so far only in pre-releases (e.g. 2026.8.28rc4). The from_* replacements already exist in pymatgen 2024.10.22, the current minimum in the requirements, so Fix deprecated from pmg #542 does not need a new pymatgen floor.

    AttributeError: type object 'StructureGraph' has no attribute 'with_empty_graph'
    
  2. flask-caching >= 2.5.0 (released 2026-08-24) removed the lowercase cache-type aliases. This is [Bug]: Flask-Caching compatibility issue: need explicit class name #544 and is not fixed yet, including in 2026.8.28rc4.

    ImportStringError: import_string() failed for 'flask_caching.backends.simple'.
    

    The fix is more than the one line in [Bug]: Flask-Caching compatibility issue: need explicit class name #544. Every lowercase CACHE_TYPE needs its class name:

    • crystal_toolkit/core/plugin.py: "simple" -> "SimpleCache", and "null" -> "NullCache" (the DEBUG_MODE path breaks the same way)
    • crystal_toolkit/apps/main.py: "null" -> "NullCache" and "redis" -> "RedisCache"

    The class names also work on older flask-caching (Cache(config={"CACHE_TYPE": "SimpleCache"}) and "NullCache" initialize on 2.2.0 and 2.4.1), so no new minimum version is needed.

A release with only #542 still breaks every structure display because of (2).

For now the tutorials pin to the following, which works with pymatgen 2026.9.24 on Python 3.12 and 3.14:

pip install "crystal-toolkit==2026.8.28rc4" "flask-caching<2.5"

I tested this by executing the pymatgen tutorial notebooks (https://github.com/computron/pymatgen_tutorials, Parts 1, 4, and 5; all structure and molecule displays render) and the structure display cell in https://github.com/computron/atomate2_tutorials Part 1. Once there is a release, I will switch both back to an unpinned install.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions