From 505cc6b6a99e596fc88fa1f671679c505fb845c7 Mon Sep 17 00:00:00 2001 From: perceptualrobots Date: Mon, 19 Aug 2024 20:13:51 +0100 Subject: [PATCH] chore: Update environment processing --- nbs/05_environments.ipynb | 4 ++++ nbs/16_environment_processing.ipynb | 36 ++++++++++++++++++----------- pct/environment_processing.py | 2 ++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/nbs/05_environments.ipynb b/nbs/05_environments.ipynb index 00df2f76..fb687449 100644 --- a/nbs/05_environments.ipynb +++ b/nbs/05_environments.ipynb @@ -2044,6 +2044,10 @@ "display_name": "python3", "language": "python", "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.9.13" } }, "nbformat": 4, diff --git a/nbs/16_environment_processing.ipynb b/nbs/16_environment_processing.ipynb index 73e1e6c0..7856075e 100644 --- a/nbs/16_environment_processing.ipynb +++ b/nbs/16_environment_processing.ipynb @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -252,7 +252,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -282,7 +282,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -390,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -491,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -539,6 +539,8 @@ " if environment_properties is None:\n", " environment_properties, en = PCTRunProperties.get_environment_properties(root=drive, env='ARC', property_dir=property_dir, property_file=file)\n", " environment_properties['dataset'] = 'test'\n", + " if 'index' in environment_properties:\n", + " environment_properties['index'] = 0\n", " print(environment_properties)\n", "\n", " enhanced_environment_properties = self.enhanced_environment_properties(environment_properties=environment_properties)\n", @@ -606,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -630,7 +632,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -642,7 +644,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -665,7 +667,15 @@ "name": "python3" }, "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", "version": "3.9.13" } }, diff --git a/pct/environment_processing.py b/pct/environment_processing.py index 86ecaa5f..d3b5c4a8 100644 --- a/pct/environment_processing.py +++ b/pct/environment_processing.py @@ -410,6 +410,8 @@ def results(self, filepath=None, experiment=None): if environment_properties is None: environment_properties, en = PCTRunProperties.get_environment_properties(root=drive, env='ARC', property_dir=property_dir, property_file=file) environment_properties['dataset'] = 'test' + if 'index' in environment_properties: + environment_properties['index'] = 0 print(environment_properties) enhanced_environment_properties = self.enhanced_environment_properties(environment_properties=environment_properties)