From b4477a955a22bdd8e259e0b40b4a0a968fb85024 Mon Sep 17 00:00:00 2001 From: Marco Selig <mselig@ncg-02.MPA-Garching.MPG.DE> Date: Mon, 4 Mar 2013 13:23:54 +0100 Subject: [PATCH] field.__len__ fixed: improved compatibility with numpy.ndarray. --- nifty_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifty_core.py b/nifty_core.py index 1610a8c50..4cf168a53 100644 --- a/nifty_core.py +++ b/nifty_core.py @@ -6192,7 +6192,7 @@ class field(object): ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ def __len__(self): - return int(self.dim(split=False)) + return int(self.dim(split=True)[0]) def __getitem__(self,key): return self.val[key] -- GitLab