{ "cells": [ { "cell_type": "markdown", "id": "79d625cf", "metadata": {}, "source": [ "# Downloadable examples\n", "\n", "This Jupyter Notebook show how to easily retrieve advanced examples online.\n", "\n", "1. Datasets\n", "2. Samples" ] }, { "cell_type": "code", "execution_count": null, "id": "9408eb25", "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings(\"ignore\", message=\".*IProgress not found.*\")" ] }, { "cell_type": "markdown", "id": "f7989482", "metadata": {}, "source": [ "## Section 1: Datasets" ] }, { "cell_type": "markdown", "id": "a7a130c3", "metadata": {}, "source": [ "Retrieving advanded datasets examples is as easy as:" ] }, { "cell_type": "code", "execution_count": null, "id": "6394b569", "metadata": {}, "outputs": [], "source": [ "from plaid.examples import AVAILABLE_EXAMPLES\n", "\n", "print(AVAILABLE_EXAMPLES)" ] }, { "cell_type": "code", "execution_count": null, "id": "e7ca3186", "metadata": { "lines_to_next_cell": 2 }, "outputs": [], "source": [ "from plaid.examples import datasets\n", "import time\n", "\n", "start = time.perf_counter()\n", "print(datasets.tensile2d)\n", "end = time.perf_counter()\n", "print(f\"First dataset retrieval duration: {end - start:.6f} seconds\")" ] }, { "cell_type": "code", "execution_count": null, "id": "8010c2eb", "metadata": { "lines_to_next_cell": 2 }, "outputs": [], "source": [ "start = time.perf_counter()\n", "print(datasets.tensile2d)\n", "end = time.perf_counter()\n", "print(f\"Second dataset retrieval duration: {end - start:.6f} seconds\")" ] }, { "cell_type": "markdown", "id": "b69663be", "metadata": {}, "source": [ "## Section 2: Samples" ] }, { "cell_type": "code", "execution_count": null, "id": "319234be", "metadata": {}, "outputs": [], "source": [ "from plaid.examples import samples\n", "\n", "start = time.perf_counter()\n", "print(samples.vki_ls59)\n", "\n", "end = time.perf_counter()\n", "print(f\"First sample retrieval duration: {end - start:.6f} seconds\")" ] }, { "cell_type": "code", "execution_count": null, "id": "9d7d8d22", "metadata": {}, "outputs": [], "source": [ "from plaid.examples import samples\n", "\n", "start = time.perf_counter()\n", "print(samples.tensile2d)\n", "\n", "end = time.perf_counter()\n", "print(f\"The tensile2d dataset being already loaded: sample retrieval duration: {end - start:.6f} seconds\")" ] } ], "metadata": { "jupytext": { "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "plaid-dev", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }