From 3c2e9e20bd504f4e34eb29799fe001b611d7ed71 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 23 Jun 2023 14:07:12 -0700 Subject: [PATCH] drop jupyter-dash (now included in regular dash) and update CTK relax viewer --- .pre-commit-config.yaml | 4 +- examples/crystaltoolkit_relax_viewer.ipynb | 170 +++++++++------------ pyproject.toml | 4 +- 3 files changed, 76 insertions(+), 102 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a3aaaae..71ca4cd0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_install_hook_types: [pre-commit, commit-msg] repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.274 + rev: v0.0.275 hooks: - id: ruff args: [--fix] @@ -27,7 +27,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.5 hooks: - id: codespell stages: [commit, commit-msg] diff --git a/examples/crystaltoolkit_relax_viewer.ipynb b/examples/crystaltoolkit_relax_viewer.ipynb index 08010c21..bfe9280d 100644 --- a/examples/crystaltoolkit_relax_viewer.ipynb +++ b/examples/crystaltoolkit_relax_viewer.ipynb @@ -93,18 +93,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "('Pmmn', 59)\n" + "original: ('Pmmn', 59)\n", + "perturbed: ('P1', 1)\n" ] - }, - { - "data": { - "text/plain": [ - "('P1', 1)" - ] - }, - "execution_count": null, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -134,89 +125,73 @@ "CHGNet will run on cpu\n", " Step Time Energy fmax\n", "*Force-consistent energies used in optimization.\n", - "FIRE: 0 16:14:42 -50.368877* 32.5095\n", - "FIRE: 1 16:14:42 -54.143169* 5.8680\n", - "FIRE: 2 16:14:42 -54.461754* 5.6230\n", - "FIRE: 3 16:14:42 -54.960907* 5.8534\n", - "FIRE: 4 16:14:42 -55.480988* 5.6906\n", - "FIRE: 5 16:14:42 -55.956520* 5.1693\n", - "FIRE: 6 16:14:42 -56.459927* 4.8143\n", - "FIRE: 7 16:14:42 -56.851875* 3.3015\n", - "FIRE: 8 16:14:42 -57.091263* 4.1499\n", - "FIRE: 9 16:14:42 -57.331764* 3.1478\n", - "FIRE: 10 16:14:42 -57.515900* 4.0483\n", - "FIRE: 11 16:14:42 -57.575695* 3.7472\n", - "FIRE: 12 16:14:42 -57.666180* 3.2176\n", - "FIRE: 13 16:14:42 -57.757183* 2.6150\n", - "FIRE: 14 16:14:42 -57.842495* 2.6404\n", - "FIRE: 15 16:14:42 -57.929653* 2.8689\n", - "FIRE: 16 16:14:42 -58.019592* 2.3735\n", - "FIRE: 17 16:14:42 -58.102535* 1.5942\n", - "FIRE: 18 16:14:42 -58.176746* 1.5989\n", - "FIRE: 19 16:14:42 -58.243935* 2.1723\n", - "FIRE: 20 16:14:42 -58.310703* 1.9688\n", - "FIRE: 21 16:14:43 -58.363392* 1.4786\n", - "FIRE: 22 16:14:43 -58.389481* 1.7102\n", - "FIRE: 23 16:14:43 -58.418602* 1.8503\n", - "FIRE: 24 16:14:43 -58.471935* 1.1974\n", - "FIRE: 25 16:14:43 -58.517002* 1.7578\n", - "FIRE: 26 16:14:43 -58.553810* 1.8129\n", - "FIRE: 27 16:14:43 -58.613503* 1.6485\n", - "FIRE: 28 16:14:43 -58.704597* 1.0232\n", - "FIRE: 29 16:14:43 -58.729168* 2.2496\n", - "FIRE: 30 16:14:43 -58.753529* 1.2002\n", - "FIRE: 31 16:14:43 -58.771957* 0.7578\n", - "FIRE: 32 16:14:43 -58.777966* 1.5446\n", - "FIRE: 33 16:14:43 -58.780994* 1.3726\n", - "FIRE: 34 16:14:43 -58.786022* 1.0541\n", - "FIRE: 35 16:14:43 -58.791451* 0.6607\n", - "FIRE: 36 16:14:43 -58.795883* 0.6259\n", - "FIRE: 37 16:14:43 -58.798832* 0.5877\n", - "FIRE: 38 16:14:43 -58.801147* 0.6803\n", - "FIRE: 39 16:14:43 -58.804146* 0.8653\n", - "FIRE: 40 16:14:44 -58.809155* 0.8536\n", - "FIRE: 41 16:14:44 -58.816200* 0.6149\n", - "FIRE: 42 16:14:44 -58.823708* 0.4149\n", - "FIRE: 43 16:14:44 -58.829689* 0.3795\n", - "FIRE: 44 16:14:44 -58.835079* 0.6436\n", - "FIRE: 45 16:14:44 -58.842659* 0.5568\n", - "FIRE: 46 16:14:44 -58.851486* 0.3081\n", - "FIRE: 47 16:14:44 -58.857994* 0.5840\n", - "FIRE: 48 16:14:44 -58.865871* 0.6220\n", - "FIRE: 49 16:14:44 -58.875755* 0.2659\n", - "FIRE: 50 16:14:44 -58.883583* 0.5791\n", - "FIRE: 51 16:14:44 -58.895329* 0.2525\n", - "FIRE: 52 16:14:44 -58.904892* 0.6525\n", - "FIRE: 53 16:14:44 -58.918137* 0.2268\n", - "FIRE: 54 16:14:44 -58.928265* 0.4081\n", - "FIRE: 55 16:14:44 -58.935215* 0.8279\n", - "FIRE: 56 16:14:44 -58.938522* 0.2784\n", - "FIRE: 57 16:14:44 -58.939091* 0.4389\n", - "FIRE: 58 16:14:44 -58.939426* 0.3746\n", - "FIRE: 59 16:14:45 -58.939934* 0.2563\n", - "FIRE: 60 16:14:45 -58.940437* 0.1812\n", - "FIRE: 61 16:14:45 -58.940823* 0.1921\n", - "FIRE: 62 16:14:45 -58.941128* 0.1983\n", - "FIRE: 63 16:14:45 -58.941517* 0.2484\n", - "FIRE: 64 16:14:45 -58.942074* 0.2446\n", - "FIRE: 65 16:14:45 -58.942848* 0.1787\n", - "FIRE: 66 16:14:45 -58.943714* 0.1757\n", - "FIRE: 67 16:14:45 -58.944485* 0.1723\n", - "FIRE: 68 16:14:45 -58.945293* 0.2152\n", - "FIRE: 69 16:14:45 -58.946426* 0.1687\n", - "FIRE: 70 16:14:45 -58.947723* 0.1692\n", - "FIRE: 71 16:14:45 -58.948978* 0.1853\n", - "FIRE: 72 16:14:45 -58.950665* 0.1663\n", - "FIRE: 73 16:14:45 -58.952576* 0.1604\n", - "FIRE: 74 16:14:46 -58.954712* 0.1559\n", - "FIRE: 75 16:14:46 -58.957211* 0.1533\n", - "FIRE: 76 16:14:46 -58.959904* 0.1449\n", - "FIRE: 77 16:14:46 -58.962624* 0.2165\n", - "FIRE: 78 16:14:46 -58.965687* 0.1903\n", - "FIRE: 79 16:14:46 -58.968777* 0.1781\n", - "FIRE: 80 16:14:46 -58.971272* 0.3301\n", - "FIRE: 81 16:14:46 -58.970631* 0.8330\n", - "FIRE: 82 16:14:46 -58.973919* 0.0508\n" + "FIRE: 0 14:01:10 -51.912251* 27.2278\n", + "FIRE: 1 14:01:10 -54.259518* 12.3964\n", + "FIRE: 2 14:01:10 -54.778671* 8.5672\n", + "FIRE: 3 14:01:11 -55.339821* 5.5388\n", + "FIRE: 4 14:01:11 -55.653206* 7.1592\n", + "FIRE: 5 14:01:11 -56.225849* 6.6752\n", + "FIRE: 6 14:01:11 -56.975388* 4.2375\n", + "FIRE: 7 14:01:11 -57.431259* 4.4837\n", + "FIRE: 8 14:01:11 -57.696171* 5.3055\n", + "FIRE: 9 14:01:11 -57.933193* 3.3038\n", + "FIRE: 10 14:01:11 -57.887894* 6.1535\n", + "FIRE: 11 14:01:11 -57.981998* 4.7339\n", + "FIRE: 12 14:01:12 -58.107471* 3.2390\n", + "FIRE: 13 14:01:12 -58.196518* 2.3609\n", + "FIRE: 14 14:01:12 -58.237015* 2.6211\n", + "FIRE: 15 14:01:12 -58.271477* 3.3198\n", + "FIRE: 16 14:01:12 -58.323418* 3.1086\n", + "FIRE: 17 14:01:12 -58.385509* 2.3118\n", + "FIRE: 18 14:01:12 -58.443253* 1.6311\n", + "FIRE: 19 14:01:12 -58.478363* 2.3351\n", + "FIRE: 20 14:01:12 -58.506485* 2.9915\n", + "FIRE: 21 14:01:13 -58.553890* 2.3584\n", + "FIRE: 22 14:01:13 -58.591610* 1.3229\n", + "FIRE: 23 14:01:13 -58.600597* 2.5641\n", + "FIRE: 24 14:01:13 -58.612297* 2.2842\n", + "FIRE: 25 14:01:13 -58.631424* 1.7666\n", + "FIRE: 26 14:01:13 -58.651585* 1.1141\n", + "FIRE: 27 14:01:14 -58.667530* 1.0229\n", + "FIRE: 28 14:01:14 -58.678112* 1.0305\n", + "FIRE: 29 14:01:14 -58.686382* 1.3254\n", + "FIRE: 30 14:01:14 -58.695862* 1.3551\n", + "FIRE: 31 14:01:14 -58.708542* 1.1167\n", + "FIRE: 32 14:01:14 -58.721897* 0.8152\n", + "FIRE: 33 14:01:14 -58.732655* 0.9976\n", + "FIRE: 34 14:01:14 -58.743347* 1.2707\n", + "FIRE: 35 14:01:14 -58.759544* 1.0066\n", + "FIRE: 36 14:01:15 -58.777481* 0.5213\n", + "FIRE: 37 14:01:15 -58.788338* 1.0805\n", + "FIRE: 38 14:01:15 -58.805302* 1.2441\n", + "FIRE: 39 14:01:15 -58.834023* 0.4629\n", + "FIRE: 40 14:01:15 -58.856319* 1.0140\n", + "FIRE: 41 14:01:15 -58.881325* 0.5240\n", + "FIRE: 42 14:01:15 -58.898716* 1.1566\n", + "FIRE: 43 14:01:15 -58.921391* 0.4211\n", + "FIRE: 44 14:01:15 -58.932678* 0.5672\n", + "FIRE: 45 14:01:15 -58.941673* 0.8468\n", + "FIRE: 46 14:01:16 -58.946671* 0.4729\n", + "FIRE: 47 14:01:16 -58.948338* 0.5703\n", + "FIRE: 48 14:01:16 -58.948872* 0.4885\n", + "FIRE: 49 14:01:16 -58.949738* 0.3384\n", + "FIRE: 50 14:01:16 -58.950603* 0.2155\n", + "FIRE: 51 14:01:16 -58.951290* 0.2596\n", + "FIRE: 52 14:01:16 -58.951885* 0.2818\n", + "FIRE: 53 14:01:16 -58.952572* 0.2948\n", + "FIRE: 54 14:01:17 -58.953487* 0.2832\n", + "FIRE: 55 14:01:17 -58.954651* 0.1820\n", + "FIRE: 56 14:01:17 -58.955776* 0.1377\n", + "FIRE: 57 14:01:17 -58.956646* 0.1858\n", + "FIRE: 58 14:01:17 -58.957542* 0.2483\n", + "FIRE: 59 14:01:17 -58.958771* 0.1507\n", + "FIRE: 60 14:01:17 -58.959930* 0.1098\n", + "FIRE: 61 14:01:17 -58.960972* 0.2491\n", + "FIRE: 62 14:01:17 -58.962578* 0.1265\n", + "FIRE: 63 14:01:17 -58.964127* 0.1622\n", + "FIRE: 64 14:01:18 -58.965885* 0.1447\n", + "FIRE: 65 14:01:18 -58.967422* 0.2064\n", + "FIRE: 66 14:01:18 -58.968880* 0.0730\n" ] } ], @@ -315,12 +290,11 @@ "import crystal_toolkit.components as ctc\n", "import plotly.graph_objects as go\n", "from crystal_toolkit.settings import SETTINGS\n", - "from dash import dcc, html\n", + "from dash import Dash, dcc, html\n", "from dash.dependencies import Input, Output\n", - "from jupyter_dash import JupyterDash\n", "from pymatgen.core import Structure\n", "\n", - "app = JupyterDash(prevent_initial_callbacks=True, assets_folder=SETTINGS.ASSETS_PATH)\n", + "app = Dash(prevent_initial_callbacks=True, assets_folder=SETTINGS.ASSETS_PATH)\n", "\n", "step_size = max(1, len(trajectory) // 20) # ensure slider has max 20 steps\n", "slider = dcc.Slider(\n", @@ -437,7 +411,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/pyproject.toml b/pyproject.toml index 60d9d2e0..0f777632 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ [project.optional-dependencies] test = ["pytest", "pytest-cov"] # needed to run interactive example notebooks -crystal-toolkit = ["crystal-toolkit", "jupyter-dash"] +crystal-toolkit = ["crystal-toolkit"] [project.urls] Source = "https://github.com/CederGroupHub/chgnet" @@ -55,6 +55,7 @@ select = [ "E", # pycodestyle error "EXE", # flake8-executable "F", # pyflakes + "FA", # flake8-future-annotations "FLY", # flynt "I", # isort "ICN", # flake8-import-conventions @@ -84,7 +85,6 @@ ignore = [ "D100", # Missing docstring in public module "D104", # Missing docstring in public package "D205", # 1 blank line required between summary line and description - "PLC1901", # compare-to-empty-string "PLR", # pylint refactor "PLW2901", # Outer for loop variable overwritten by inner assignment target "PT006", # pytest-parametrize-names-wrong-type