From 041a1590ae75e00dd764ebccdbce2d9f015d100c Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Thu, 21 Jun 2018 13:46:03 +1000 Subject: [PATCH] Adds tab completion of Result objects in IPython Closes #111 --- tupak/core/result.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tupak/core/result.py b/tupak/core/result.py index f2b296a02..b9e7a6467 100644 --- a/tupak/core/result.py +++ b/tupak/core/result.py @@ -70,6 +70,14 @@ class Result(dict): val = self._standardise_a_string(dictionary[key]) setattr(self, key, val) + def __dir__(self): + """ Adds tab completion in ipython + + See: http://ipython.org/ipython-doc/dev/config/integrating.html + + """ + return self.keys() + def __getattr__(self, name): try: return self[name] -- GitLab