diff --git a/examples/copernicus_dataspace.ipynb b/examples/data-spaces/copernicus_dataspace.ipynb similarity index 100% rename from examples/copernicus_dataspace.ipynb rename to examples/data-spaces/copernicus_dataspace.ipynb diff --git a/examples/data_usage.ipynb b/examples/data_usage.ipynb index 2af65696..a119fd25 100644 --- a/examples/data_usage.ipynb +++ b/examples/data_usage.ipynb @@ -29,16 +29,33 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Connect to the Virtual Data Trustee" + "## Note\n", + "\n", + "1. It is important that the Geo Engine is running with\n", + "```toml\n", + "[quota]\n", + "mode = \"track\"\n", + "```\n", + "\n", + "2. You have to do some work beforehand to get the data from the log.\n", + "\n", + "This is a simple example to show how to access the log." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Connect to Geo Engine" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "ge.initialize(\"http://localhost:3030/api\", (\"admin@localhost\", \"adminadmin\")) # TODO: load from .env for demo TODO: set remote url" + "ge.initialize(\"http://localhost:3030/api\", (\"admin@localhost\", \"adminadmin\"))" ] }, { @@ -296,7 +313,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -312,6 +329,9 @@ ], "source": [ "df = ge.data_usage_summary(ge.UsageSummaryGranularity.MINUTES)\n", + "if df.empty:\n", + " print('No data usage found')\n", + " exit()\n", "df['timestamp'] = pd.to_datetime(df['timestamp']).dt.tz_localize(None)\n", "\n", "pivot_df = df.pivot(index='timestamp', columns='data', values='count').fillna(0)\n", @@ -324,13 +344,6 @@ "plt.legend(title='Data')\n", "plt.show()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/examples/plots.ipynb b/examples/plots.ipynb index 5b6a1383..d14eb5f1 100644 --- a/examples/plots.ipynb +++ b/examples/plots.ipynb @@ -10,11 +10,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", + "from IPython.display import display\n", "\n", "import geoengine as ge" ] diff --git a/test_all_notebooks.py b/test_all_notebooks.py index f667931c..73d93846 100755 --- a/test_all_notebooks.py +++ b/test_all_notebooks.py @@ -7,13 +7,6 @@ import shutil import sys -# TODO: fix the blacklisted notebooks -BLACKLIST = [ - 'copernicus_dataspace.ipynb', - 'data_usage.ipynb', - 'plots.ipynb', -] - def eprint(*args, **kwargs): '''Print to stderr.''' @@ -57,9 +50,6 @@ def main() -> int: if not file.endswith('.ipynb'): eprint(f"Skipping non-notebook file {file}") continue - if file in BLACKLIST: - eprint(f"Skipping blacklisted notebook {file}") - continue notebook_path = os.path.join(root, file) if not run_test_notebook(notebook_path): return -1