Commit c0b169f1 authored by Theo Steininger's avatar Theo Steininger

PowerSpace now uses 'default_distribution_strategy' as a default.

parent 1b46ab5f
Pipeline #15426 passed with stages
in 12 minutes and 34 seconds
......@@ -19,9 +19,11 @@
import ast
import numpy as np
from d2o import distributed_data_object
from d2o import distributed_data_object,\
STRATEGIES as DISTRIBUTION_STRATEGIES
from nifty.spaces.space import Space
from nifty.config import nifty_configuration as gc
class PowerSpace(Space):
......@@ -87,11 +89,18 @@ class PowerSpace(Space):
# ---Overwritten properties and methods---
def __init__(self, harmonic_partner, distribution_strategy='not',
def __init__(self, harmonic_partner, distribution_strategy=None,
logarithmic=None, nbin=None, binbounds=None):
super(PowerSpace, self).__init__()
self._ignore_for_hash += ['_pindex', '_kindex', '_rho']
if distribution_strategy is None:
distribution_strategy = gc['default_distribution_strategy']
elif distribution_strategy not in DISTRIBUTION_STRATEGIES['global']:
raise ValueError(
"distribution_strategy must be a global-type "
"strategy.")
if not (isinstance(harmonic_partner, Space) and
harmonic_partner.harmonic):
raise ValueError("harmonic_partner must be a harmonic space.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment