From fd97e9762c32e5caaa37379ede7efd0933658ecb Mon Sep 17 00:00:00 2001
From: ashivani <ashivani@aicrowd.com>
Date: Tue, 8 Oct 2019 22:02:19 +0530
Subject: [PATCH] Added warning-distanc_map cannot be saved

---
 flatland/envs/rail_env.py                      | 6 ++++--
 notebooks/simple_example1_env_from_tuple.ipynb | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index 2999554d..19c15f85 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -731,9 +731,11 @@ class RailEnv(Environment):
                     with open(filename, "wb") as file_out:
                         file_out.write(self.get_full_state_dist_msg())
                 else:
-                    raise Exception("Unable to save distance map")
+                    print("[WARNING] Unable to save the distance map for this environment, as none was found !")
+
             else:
-                raise Exception("Unable to save distance map")
+                print("[WARNING] Unable to save the distance map for this environment, as none was found !")
+
         else:
             with open(filename,"wb") as file_out:
                 file_out.write(self.get_full_state_msg())
diff --git a/notebooks/simple_example1_env_from_tuple.ipynb b/notebooks/simple_example1_env_from_tuple.ipynb
index 0fcfe263..2d135851 100644
--- a/notebooks/simple_example1_env_from_tuple.ipynb
+++ b/notebooks/simple_example1_env_from_tuple.ipynb
@@ -83,7 +83,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.8"
+   "version": "3.7.3"
   },
   "latex_envs": {
    "LaTeX_envs_menu_present": true,
-- 
GitLab