From 8ed5371087d230ca27599ffc77b6ccced119cd28 Mon Sep 17 00:00:00 2001 From: Florian Felten Date: Wed, 9 Jul 2025 14:43:19 +0200 Subject: [PATCH 1/2] Download repo if not locally there --- example_hard_model.ipynb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/example_hard_model.ipynb b/example_hard_model.ipynb index 4c4f3ad8..3b77a538 100644 --- a/example_hard_model.ipynb +++ b/example_hard_model.ipynb @@ -24,15 +24,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -e ." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "\n", "# Some imports we will need\n", "import os\n", "\n", @@ -44,7 +36,14 @@ "from engiopt import metrics\n", "from engiopt.diffusion_2d_cond.diffusion_2d_cond import beta_schedule\n", "from engiopt.diffusion_2d_cond.diffusion_2d_cond import DiffusionSampler\n", - "import wandb" + "import wandb\n", + "\n", + "if \"google.colab\" in str(get_ipython()):\n", + " if not os.path.exists(\"EngiOpt\"):\n", + " !git clone https://github.com/IDEALLab/EngiOpt.git\n", + " %cd EngiOpt\n", + "\n", + "%pip install -e .\n" ] }, { @@ -6432,7 +6431,7 @@ "source": [ "### Qualitative evaluation\n", "\n", - "Now we can also use metrics to get a quantitative idea of how good the generated designs are. Here we compute optimality gaps between the generated designs and optimized designs in terms of objective values (thermal compliance for heatconduction)" + "Now we can also use metrics to get a quantitative idea of how good the generated designs are. Here we compute optimality gaps between the generated designs and optimized designs in terms of objective values (thermal compliance for heatconduction). We have other metrics available, see the [metrics.py](https://github.com/IDEALLab/EngiOpt/blob/main/engiopt/metrics.py) file for more details." ] }, { From 825bcff9a52459c7a4cabbc4efb7bf6ca91a93e6 Mon Sep 17 00:00:00 2001 From: Florian Felten Date: Wed, 9 Jul 2025 14:46:02 +0200 Subject: [PATCH 2/2] Ruff --- example_hard_model.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example_hard_model.ipynb b/example_hard_model.ipynb index 3b77a538..0b2df2e0 100644 --- a/example_hard_model.ipynb +++ b/example_hard_model.ipynb @@ -24,7 +24,6 @@ "metadata": {}, "outputs": [], "source": [ - "\n", "# Some imports we will need\n", "import os\n", "\n", @@ -43,7 +42,7 @@ " !git clone https://github.com/IDEALLab/EngiOpt.git\n", " %cd EngiOpt\n", "\n", - "%pip install -e .\n" + "%pip install -e ." ] }, {