Commit ad5ddd5c authored by theos's avatar theos
Browse files

Mode Field._parse_distribution_strategy more robust.

parent 1bc3f502
......@@ -6,7 +6,6 @@ from d2o import distributed_data_object,\
from nifty.config import about,\
nifty_configuration as gc,\
dependency_injector as gdi
from nifty.field_types import FieldType
......@@ -17,10 +16,6 @@ import nifty.nifty_utilities as utilities
from nifty.random import Random
COMM = getattr(gdi[gc['mpi_module']], gc['default_comm'])
class Field(object):
# ---Initialization methods---
......@@ -121,9 +116,10 @@ class Field(object):
about.warnings.cprint("WARNING: Datamodel set to default!")
distribution_strategy = gc['default_distribution_strategy']
elif distribution_strategy not in DISTRIBUTION_STRATEGIES['all']:
elif distribution_strategy not in DISTRIBUTION_STRATEGIES['global']:
raise ValueError(about._errors.cstring(
"ERROR: Invalid distribution_strategy!"))
"ERROR: distribution_strategy must be a global-type "
return distribution_strategy
# ---Factory methods---
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