Index: ../trunk-jpl/src/m/classes/qmu.py =================================================================== --- ../trunk-jpl/src/m/classes/qmu.py (revision 25459) +++ ../trunk-jpl/src/m/classes/qmu.py (revision 25460) @@ -1,6 +1,4 @@ import numpy as np - -from checkfield import checkfield from collections import OrderedDict from dakota_method import * from fielddisplay import fielddisplay @@ -20,7 +18,7 @@ def __init__(self): # {{{ self.isdakota = 0 - self.output = 0 + self.output = 0 self.variables = OrderedStruct() self.correlation_matrix = [] self.responses = OrderedStruct() @@ -31,6 +29,7 @@ self.variabledescriptors = [] self.variablepartitions = [] self.variablepartitions_npart = [] + self.variablepartitions_nt = [] self.responsedescriptors = [] self.responsepartitions = [] self.responsepartitions_npart = [] @@ -127,12 +126,15 @@ return s # }}} + def extrude(self, md): # {{{ return self #}}} + def setdefaultparameters(self): # {{{ return self #}}} + def checkconsistency(self, md, solution, analyses): # {{{ #Early return if not md.qmu.isdakota: @@ -165,10 +167,10 @@ if hasattr(variable, 'checkconsistency'): variable.checkconsistency(md, solution, analyses) - # Go through variables and check that we have normal uncertains first, - # then uniform uncertains and finally histogram_bin_uncertain. Indeed, - # Dakota will order them this waym, and when we send partitions for - # scaled variables, they better show up in the order Dakota is feeding + # Go through variables and check that we have normal uncertains first, + # then uniform uncertains and finally histogram_bin_uncertain. Indeed, + # Dakota will order them this waym, and when we send partitions for + # scaled variables, they better show up in the order Dakota is feeding # them to us in InputUpdateFromDakotax! fv = fieldnames(self.variables) classlist = [] @@ -193,6 +195,7 @@ return md # }}} + def marshall(self, prefix, md, fid): # {{{ WriteData(fid, prefix, 'object', self, 'fieldname', 'isdakota', 'format', 'Boolean') WriteData(fid, prefix, 'object', self, 'fieldname', 'output', 'format', 'Boolean') Index: ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py =================================================================== --- ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py (revision 25459) +++ ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py (revision 25460) @@ -157,12 +157,18 @@ DimDict, ncvar = CreateVar(NCData, Var, field, NCgroup, DimDict) if ncvar is not None: FillVar(ncvar, Var) - # this is a multi layered group thta should not be an "else" + # this is an issm class elif isclass(type(md.__dict__[group].__dict__[field])): classtype = getmodule(type(md.__dict__[group])).__name__ NCgroup.__setattr__('classtype', classtype) Subgroup = NCgroup.createGroup(str(field)) - classtype = getmodule(type(md.__dict__[group].__dict__[field])).__name__ + classname = type(md.__dict__[group].__dict__[field]).__name__ + modulename = getmodule(type(md.__dict__[group].__dict__[field])).__name__ + if classname == modulename: + #when module and class name have the same name + classtype = classname + else: + classtype = modulename + '.' + classname Subgroup.__setattr__('classtype', classtype) subfields = dict.keys(md.__dict__[group].__dict__[field].__dict__) for subfield in subfields: Index: ../trunk-jpl/src/m/io/loadvars.py =================================================================== --- ../trunk-jpl/src/m/io/loadvars.py (revision 25459) +++ ../trunk-jpl/src/m/io/loadvars.py (revision 25460) @@ -16,10 +16,10 @@ def loadvars(*args, **kwargs): """LOADVARS - function to load variables from a file - This function loads one or more variables from a file. The names of the - variables must be supplied. If more than one variable is specified, it may - be done with a list of names or a dictionary of name as keys. The output - type will correspond to the input type. All the variables in the file may + This function loads one or more variables from a file. The names of the + variables must be supplied. If more than one variable is specified, it may + be done with a list of names or a dictionary of name as keys. The output + type will correspond to the input type. All the variables in the file may be loaded by specifying only the file name. Usage: @@ -303,9 +303,15 @@ if len(NCData.groups[group].groups) > 0: for subgroup in NCData.groups[group].groups: classe = str(group) + '.' + str(subgroup) - class_dict[classe] = [str(getattr(NCData.groups[group].groups[subgroup], 'classtype')), ] + submodule = str(getattr(NCData.groups[group].groups[subgroup], 'classtype')).split('.')[-1] + class_dict[classe] = [submodule, ] if class_dict[classe][0] not in ['dict', 'list', 'cell']: - class_dict[classe].append(__import__(class_dict[classe][0])) + try: + class_dict[classe].append(__import__(class_dict[classe][0])) + except ModuleNotFoundError: + #submodule probably has a different name + modulename = str(getattr(NCData.groups[group].groups[subgroup], 'classtype')).split('.')[0] + class_dict[classe].append(__import__(modulename)) class_tree[classe] = [group, subgroup] else: classe = str(group)