From bfa6b7abc4b9af62f54fdb8da0437fdfb83b17d1 Mon Sep 17 00:00:00 2001 From: Marco Selig <mselig@ncg-02.MPA-Garching.MPG.DE> Date: Tue, 30 Apr 2013 15:18:59 +0200 Subject: [PATCH] minor corrections; documentation updated. --- nifty_core.py | 9 ++++++--- nifty_power.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nifty_core.py b/nifty_core.py index 9f282cd4b..3be8e1d8b 100644 --- a/nifty_core.py +++ b/nifty_core.py @@ -9612,7 +9612,7 @@ class projection_operator(operator): x : valid field band : int, *optional* Projection band whereon to project. (default: None) - bandsup: list of integers, *optional* + bandsup: {integer, list/array of integers}, *optional* List of projection bands whereon to project and which to sum up. The `band` keyword is prefered over `bandsup`. (default: None) @@ -9631,8 +9631,11 @@ class projection_operator(operator): return Px elif(bandsup is not None): - bandsup = [int(bb) for bb in bandsup if -1<bb<self.bands()] - if(bandsup==[]): + if(np.isscalar(bandsup)): + bandsup = np.arange(int(bandsup),dtype=np.int) + else: + bandsup = np.array(bandsup,dtype=np.int) + if(np.any(bandsup>self.bands()-1))or(np.any(bandsup<0)): raise ValueError(about._errors.cstring("ERROR: invalid input.")) Px = field(self.domain,val=None,target=x.target) for bb in bandsup: diff --git a/nifty_power.py b/nifty_power.py index 17a03a117..70be305dc 100644 --- a/nifty_power.py +++ b/nifty_power.py @@ -41,7 +41,7 @@ """ from __future__ import division -from scipy.interpolate import interp1d as ip ## +from scipy.interpolate import interp1d as ip ## conflicts with sphinx's autodoc #import numpy as np from nifty.nifty_core import * import smoothing as gs -- GitLab