Skip to content

Commit

Permalink
update line colors to grey, do not show plotly in notebooks (#36)
Browse files Browse the repository at this point in the history
* update line colors to grey, do not show plotly in notebooks

* format file
  • Loading branch information
PythonFZ authored Dec 4, 2024
1 parent 7055b2f commit 8105345
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 27 deletions.
266 changes: 242 additions & 24 deletions docs/source/notebooks/combine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -60,9 +60,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Initialized empty Git repository in /private/var/folders/81/0x90c4yd0cz6tz104v9syf580000gn/T/tmpqt0ewb9_/.git/\n",
"\u001b[0m"
]
}
],
"source": [
"!git init\n",
"!dvc init --quiet"
Expand All @@ -77,9 +86,218 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-12-04 08:57:41,326 - INFO: Saving params.yaml\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 4/4 [00:00<00:00, 721.91it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running stage 'initialize_Smiles2Conformers':\n",
"> zntrack run mlipx.nodes.smiles.Smiles2Conformers --name initialize_Smiles2Conformers\n",
"Generating lock file 'dvc.lock'\n",
"Updating lock file 'dvc.lock'\n",
"\n",
"Running stage 'homonuclear-diatomics_HomonuclearDiatomics':\n",
"> zntrack run mlipx.nodes.diatomics.HomonuclearDiatomics --name homonuclear-diatomics_HomonuclearDiatomics\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"H-H bond (0.62 Å): 100%|██████████| 100/100 [00:00<00:00, 1730.64it/s]\n",
"C-C bond (1.52 Å): 100%|██████████| 100/100 [00:00<00:00, 2193.13it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Updating lock file 'dvc.lock'\n",
"\n",
"Running stage 'structure-optimization_StructureOptimization':\n",
"> zntrack run mlipx.nodes.structure_optimization.StructureOptimization --name structure-optimization_StructureOptimization\n",
" Step Time Energy fmax\n",
"LBFGS: 0 08:57:45 4.724808 4.228024\n",
"LBFGS: 1 08:57:45 3.694983 2.695507\n",
"LBFGS: 2 08:57:45 3.002409 1.492604\n",
"LBFGS: 3 08:57:45 2.821451 1.084243\n",
"LBFGS: 4 08:57:45 2.664413 1.026595\n",
"LBFGS: 5 08:57:45 2.491459 0.799510\n",
"LBFGS: 6 08:57:45 2.425135 0.284369\n",
"LBFGS: 7 08:57:45 2.421406 0.196046\n",
"LBFGS: 8 08:57:45 2.419364 0.177538\n",
"LBFGS: 9 08:57:45 2.415200 0.195117\n",
"LBFGS: 10 08:57:45 2.410975 0.242129\n",
"LBFGS: 11 08:57:45 2.406195 0.232087\n",
"LBFGS: 12 08:57:45 2.403611 0.114803\n",
"LBFGS: 13 08:57:45 2.402815 0.057201\n",
"LBFGS: 14 08:57:45 2.402620 0.064960\n",
"LBFGS: 15 08:57:45 2.401299 0.147884\n",
"LBFGS: 16 08:57:45 2.398543 0.279003\n",
"LBFGS: 17 08:57:45 2.378905 0.736798\n",
"LBFGS: 18 08:57:45 2.422713 0.995216\n",
"LBFGS: 19 08:57:45 2.389691 0.811611\n",
"LBFGS: 20 08:57:45 2.399295 0.767810\n",
"LBFGS: 21 08:57:45 2.421218 0.350004\n",
"LBFGS: 22 08:57:45 2.392677 0.721292\n",
"LBFGS: 23 08:57:45 2.362266 0.852960\n",
"LBFGS: 24 08:57:45 2.404921 0.574016\n",
"LBFGS: 25 08:57:45 2.466467 0.712450\n",
"LBFGS: 26 08:57:45 2.396067 0.563970\n",
"LBFGS: 27 08:57:45 2.373340 0.661065\n",
"LBFGS: 28 08:57:45 2.413167 0.279068\n",
"LBFGS: 29 08:57:45 2.480018 0.862628\n",
"LBFGS: 30 08:57:45 2.410237 0.274582\n",
"LBFGS: 31 08:57:45 2.394107 0.418984\n",
"LBFGS: 32 08:57:45 2.335191 0.600363\n",
"LBFGS: 33 08:57:45 2.393647 0.408179\n",
"LBFGS: 34 08:57:45 2.447513 0.560576\n",
"LBFGS: 35 08:57:45 2.391865 0.393705\n",
"LBFGS: 36 08:57:45 2.373368 0.492743\n",
"LBFGS: 37 08:57:45 2.435855 0.493584\n",
"LBFGS: 38 08:57:45 2.373998 0.454940\n",
"LBFGS: 39 08:57:45 2.360254 0.638154\n",
"LBFGS: 40 08:57:45 2.407103 0.315460\n",
"LBFGS: 41 08:57:45 2.365838 0.715909\n",
"LBFGS: 42 08:57:45 2.368027 1.033230\n",
"LBFGS: 43 08:57:45 2.399865 0.369117\n",
"LBFGS: 44 08:57:45 2.365658 0.981589\n",
"LBFGS: 45 08:57:45 2.363580 0.951514\n",
"LBFGS: 46 08:57:45 2.344455 0.266927\n",
"LBFGS: 47 08:57:45 2.320914 0.617892\n",
"LBFGS: 48 08:57:45 2.299608 0.886820\n",
"LBFGS: 49 08:57:45 2.294743 0.876087\n",
"LBFGS: 50 08:57:45 2.282608 0.753598\n",
"LBFGS: 51 08:57:45 2.273683 0.641003\n",
"LBFGS: 52 08:57:45 2.254499 0.394442\n",
"LBFGS: 53 08:57:45 2.243769 0.411168\n",
"LBFGS: 54 08:57:45 2.222896 0.379403\n",
"LBFGS: 55 08:57:45 2.202550 0.509002\n",
"LBFGS: 56 08:57:45 2.180746 0.453338\n",
"LBFGS: 57 08:57:45 2.160522 0.440702\n",
"LBFGS: 58 08:57:45 2.140143 0.477836\n",
"LBFGS: 59 08:57:45 2.126674 0.253944\n",
"LBFGS: 60 08:57:45 2.109673 0.346025\n",
"LBFGS: 61 08:57:45 2.088406 0.491314\n",
"LBFGS: 62 08:57:45 2.064287 0.622375\n",
"LBFGS: 63 08:57:45 2.072785 0.665291\n",
"LBFGS: 64 08:57:45 2.032567 0.270466\n",
"LBFGS: 65 08:57:45 2.027569 0.165839\n",
"LBFGS: 66 08:57:45 2.023181 0.242900\n",
"LBFGS: 67 08:57:45 2.019414 0.279579\n",
"LBFGS: 68 08:57:45 2.013816 0.201534\n",
"LBFGS: 69 08:57:45 2.009762 0.216292\n",
"LBFGS: 70 08:57:45 2.005202 0.245885\n",
"LBFGS: 71 08:57:45 1.999113 0.277390\n",
"LBFGS: 72 08:57:45 1.992085 0.345559\n",
"LBFGS: 73 08:57:45 1.977779 0.379235\n",
"LBFGS: 74 08:57:45 1.976412 0.845377\n",
"LBFGS: 75 08:57:45 1.962979 0.595975\n",
"LBFGS: 76 08:57:45 1.980746 0.597380\n",
"LBFGS: 77 08:57:45 1.928990 0.296365\n",
"LBFGS: 78 08:57:45 1.914401 0.341064\n",
"LBFGS: 79 08:57:45 1.901031 0.248728\n",
"LBFGS: 80 08:57:45 1.874226 0.331118\n",
"LBFGS: 81 08:57:45 1.866228 0.381243\n",
"LBFGS: 82 08:57:45 1.858389 0.312143\n",
"LBFGS: 83 08:57:45 1.849670 0.214870\n",
"LBFGS: 84 08:57:45 1.840588 0.212578\n",
"LBFGS: 85 08:57:45 1.831122 0.208976\n",
"LBFGS: 86 08:57:45 1.816450 0.284739\n",
"LBFGS: 87 08:57:45 1.808331 0.264167\n",
"LBFGS: 88 08:57:45 1.804893 0.140377\n",
"LBFGS: 89 08:57:45 1.803125 0.126006\n",
"LBFGS: 90 08:57:45 1.800239 0.157320\n",
"LBFGS: 91 08:57:45 1.794588 0.209665\n",
"LBFGS: 92 08:57:45 1.784398 0.267433\n",
"LBFGS: 93 08:57:45 1.766477 0.405933\n",
"LBFGS: 94 08:57:45 1.750226 0.504541\n",
"LBFGS: 95 08:57:45 1.731663 0.463239\n",
"LBFGS: 96 08:57:45 1.740648 0.581978\n",
"LBFGS: 97 08:57:45 1.714884 0.197589\n",
"LBFGS: 98 08:57:45 1.711533 0.212479\n",
"LBFGS: 99 08:57:45 1.705468 0.200734\n",
"LBFGS: 100 08:57:45 1.698790 0.215090\n",
"LBFGS: 101 08:57:45 1.694107 0.218013\n",
"LBFGS: 102 08:57:45 1.687245 0.261569\n",
"LBFGS: 103 08:57:45 1.679483 0.235316\n",
"LBFGS: 104 08:57:45 1.672388 0.212389\n",
"LBFGS: 105 08:57:45 1.667900 0.204184\n",
"LBFGS: 106 08:57:45 1.664014 0.206811\n",
"LBFGS: 107 08:57:45 1.659842 0.174513\n",
"LBFGS: 108 08:57:45 1.655629 0.134345\n",
"LBFGS: 109 08:57:45 1.653944 0.117043\n",
"LBFGS: 110 08:57:45 1.651874 0.137774\n",
"LBFGS: 111 08:57:45 1.650047 0.118101\n",
"LBFGS: 112 08:57:45 1.648620 0.097428\n",
"LBFGS: 113 08:57:45 1.647591 0.078790\n",
"LBFGS: 114 08:57:45 1.646531 0.073324\n",
"LBFGS: 115 08:57:45 1.645431 0.086058\n",
"LBFGS: 116 08:57:45 1.644287 0.077183\n",
"LBFGS: 117 08:57:45 1.643064 0.067262\n",
"LBFGS: 118 08:57:45 1.641630 0.077393\n",
"LBFGS: 119 08:57:45 1.639628 0.122925\n",
"LBFGS: 120 08:57:45 1.637171 0.153202\n",
"LBFGS: 121 08:57:45 1.633396 0.151970\n",
"LBFGS: 122 08:57:45 1.631406 0.123032\n",
"LBFGS: 123 08:57:45 1.629801 0.138668\n",
"LBFGS: 124 08:57:45 1.628508 0.076032\n",
"LBFGS: 125 08:57:45 1.626819 0.090770\n",
"LBFGS: 126 08:57:45 1.625614 0.097005\n",
"LBFGS: 127 08:57:45 1.624000 0.120846\n",
"LBFGS: 128 08:57:45 1.621755 0.153207\n",
"LBFGS: 129 08:57:45 1.617995 0.175126\n",
"LBFGS: 130 08:57:45 1.612236 0.167277\n",
"LBFGS: 131 08:57:45 1.607476 0.125770\n",
"LBFGS: 132 08:57:45 1.605520 0.112356\n",
"LBFGS: 133 08:57:45 1.604348 0.074151\n",
"LBFGS: 134 08:57:45 1.603837 0.047431\n",
"Updating lock file 'dvc.lock'\n",
"\n",
"Running stage 'molecular-dynamics_MolecularDynamics':\n",
"> zntrack run mlipx.nodes.molecular_dynamics.MolecularDynamics --name molecular-dynamics_MolecularDynamics\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"1001it [00:02, 338.00it/s] \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Updating lock file 'dvc.lock'\n",
"\n",
"To track the changes with git, run:\n",
"\n",
"\tgit add nodes/homonuclear-diatomics/HomonuclearDiatomics/.gitignore nodes/initialize/Smiles2Conformers/.gitignore nodes/structure-optimization/StructureOptimization/.gitignore nodes/molecular-dynamics/MolecularDynamics/.gitignore dvc.lock\n",
"\n",
"To enable auto staging, run:\n",
"\n",
"\tdvc config core.autostage true\n",
"Use `dvc push` to send your updates to remote storage.\n"
]
}
],
"source": [
"import mlipx\n",
"\n",
Expand Down Expand Up @@ -135,40 +353,40 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dict_keys(['energy', 'fmax', 'fnorm'])\n",
"dict_keys(['energy_vs_steps', 'fmax_vs_steps'])\n",
"dict_keys(['H-H bond', 'C-C bond'])\n"
]
}
],
"source": [
"struct_optim.figures[\"energy_vs_steps\"]"
"print(md.figures.keys())\n",
"print(struct_optim.figures.keys())\n",
"print(ev.figures.keys())"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"md.figures[\"energy\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(ev.figures.keys())\n",
"ev.figures[\"C-C bond\"]"
"temp_dir.cleanup()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"temp_dir.cleanup()"
]
"source": []
}
],
"metadata": {
Expand Down
9 changes: 6 additions & 3 deletions mlipx/nodes/pourbaix_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def create_pourbaix_plot(
x=[7, 7],
y=ylim,
mode="lines",
line={"color": "black", "dash": "dot"},
line={"color": "grey", "dash": "dot"},
name="Neutral Axis",
)
)
Expand All @@ -92,7 +92,7 @@ def create_pourbaix_plot(
x=xlim,
y=[0, 0],
mode="lines",
line={"color": "black", "dash": "dot"},
line={"color": "grey", "dash": "dot"},
name="V=0 Line",
)
)
Expand All @@ -110,7 +110,7 @@ def create_pourbaix_plot(
x=x,
y=y,
mode="lines",
line={"color": "black"},
line={"color": "grey"},
name=f"Domain {entry.name}",
)
)
Expand Down Expand Up @@ -140,6 +140,9 @@ def create_pourbaix_plot(
paper_bgcolor="rgba(0, 0, 0, 0)",
)

fig.update_xaxes(showgrid=False, zeroline=False)
fig.update_yaxes(showgrid=False, zeroline=False)

return fig


Expand Down

0 comments on commit 8105345

Please sign in to comment.