How to use gds_validate_double method in autotest

Best Python code snippet using autotest_python

gWDSMatrix.py

Source:gWDSMatrix.py Github

copy

Full Screen

...303 fval_ = float(input_data)304 except (TypeError, ValueError) as exp:305 raise_parse_error(node, 'Requires double or float value: %s' % exp)306 return fval_307 def gds_validate_double(self, input_data, node=None, input_name=''):308 try:309 value = float(input_data)310 except (TypeError, ValueError):311 raise_parse_error(node, 'Requires double or float value')312 return value313 def gds_format_double_list(self, input_data, input_name=''):314 if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):315 input_data = [str(s) for s in input_data]316 return '%s' % ' '.join(input_data)317 def gds_validate_double_list(318 self, input_data, node=None, input_name=''):319 values = input_data.split()320 for value in values:321 try:322 float(value)323 except (TypeError, ValueError):324 raise_parse_error(325 node, 'Requires sequence of double or float values')326 return values327 def gds_format_boolean(self, input_data, input_name=''):328 return ('%s' % input_data).lower()329 def gds_parse_boolean(self, input_data, node=None, input_name=''):330 input_data = input_data.strip()331 if input_data in ('true', '1'):332 bval = True333 elif input_data in ('false', '0'):334 bval = False335 else:336 raise_parse_error(node, 'Requires boolean value')337 return bval338 def gds_validate_boolean(self, input_data, node=None, input_name=''):339 if input_data not in (True, 1, False, 0, ):340 raise_parse_error(341 node,342 'Requires boolean value '343 '(one of True, 1, False, 0)')344 return input_data345 def gds_format_boolean_list(self, input_data, input_name=''):346 if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):347 input_data = [str(s) for s in input_data]348 return '%s' % ' '.join(input_data)349 def gds_validate_boolean_list(350 self, input_data, node=None, input_name=''):351 values = input_data.split()352 for value in values:353 value = self.gds_parse_boolean(value, node, input_name)354 if value not in (True, 1, False, 0, ):355 raise_parse_error(356 node,357 'Requires sequence of boolean values '358 '(one of True, 1, False, 0)')359 return values360 def gds_validate_datetime(self, input_data, node=None, input_name=''):361 return input_data362 def gds_format_datetime(self, input_data, input_name=''):363 if input_data.microsecond == 0:364 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (365 input_data.year,366 input_data.month,367 input_data.day,368 input_data.hour,369 input_data.minute,370 input_data.second,371 )372 else:373 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (374 input_data.year,375 input_data.month,376 input_data.day,377 input_data.hour,378 input_data.minute,379 input_data.second,380 ('%f' % (float(input_data.microsecond) / 1000000))[2:],381 )382 if input_data.tzinfo is not None:383 tzoff = input_data.tzinfo.utcoffset(input_data)384 if tzoff is not None:385 total_seconds = tzoff.seconds + (86400 * tzoff.days)386 if total_seconds == 0:387 _svalue += 'Z'388 else:389 if total_seconds < 0:390 _svalue += '-'391 total_seconds *= -1392 else:393 _svalue += '+'394 hours = total_seconds // 3600395 minutes = (total_seconds - (hours * 3600)) // 60396 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)397 return _svalue398 @classmethod399 def gds_parse_datetime(cls, input_data):400 tz = None401 if input_data[-1] == 'Z':402 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')403 input_data = input_data[:-1]404 else:405 results = GeneratedsSuper.tzoff_pattern.search(input_data)406 if results is not None:407 tzoff_parts = results.group(2).split(':')408 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])409 if results.group(1) == '-':410 tzoff *= -1411 tz = GeneratedsSuper._FixedOffsetTZ(412 tzoff, results.group(0))413 input_data = input_data[:-6]414 time_parts = input_data.split('.')415 if len(time_parts) > 1:416 micro_seconds = int(float('0.' + time_parts[1]) * 1000000)417 input_data = '%s.%s' % (418 time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )419 dt = datetime_.datetime.strptime(420 input_data, '%Y-%m-%dT%H:%M:%S.%f')421 else:422 dt = datetime_.datetime.strptime(423 input_data, '%Y-%m-%dT%H:%M:%S')424 dt = dt.replace(tzinfo=tz)425 return dt426 def gds_validate_date(self, input_data, node=None, input_name=''):427 return input_data428 def gds_format_date(self, input_data, input_name=''):429 _svalue = '%04d-%02d-%02d' % (430 input_data.year,431 input_data.month,432 input_data.day,433 )434 try:435 if input_data.tzinfo is not None:436 tzoff = input_data.tzinfo.utcoffset(input_data)437 if tzoff is not None:438 total_seconds = tzoff.seconds + (86400 * tzoff.days)439 if total_seconds == 0:440 _svalue += 'Z'441 else:442 if total_seconds < 0:443 _svalue += '-'444 total_seconds *= -1445 else:446 _svalue += '+'447 hours = total_seconds // 3600448 minutes = (total_seconds - (hours * 3600)) // 60449 _svalue += '{0:02d}:{1:02d}'.format(450 hours, minutes)451 except AttributeError:452 pass453 return _svalue454 @classmethod455 def gds_parse_date(cls, input_data):456 tz = None457 if input_data[-1] == 'Z':458 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')459 input_data = input_data[:-1]460 else:461 results = GeneratedsSuper.tzoff_pattern.search(input_data)462 if results is not None:463 tzoff_parts = results.group(2).split(':')464 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])465 if results.group(1) == '-':466 tzoff *= -1467 tz = GeneratedsSuper._FixedOffsetTZ(468 tzoff, results.group(0))469 input_data = input_data[:-6]470 dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')471 dt = dt.replace(tzinfo=tz)472 return dt.date()473 def gds_validate_time(self, input_data, node=None, input_name=''):474 return input_data475 def gds_format_time(self, input_data, input_name=''):476 if input_data.microsecond == 0:477 _svalue = '%02d:%02d:%02d' % (478 input_data.hour,479 input_data.minute,480 input_data.second,481 )482 else:483 _svalue = '%02d:%02d:%02d.%s' % (484 input_data.hour,485 input_data.minute,486 input_data.second,487 ('%f' % (float(input_data.microsecond) / 1000000))[2:],488 )489 if input_data.tzinfo is not None:490 tzoff = input_data.tzinfo.utcoffset(input_data)491 if tzoff is not None:492 total_seconds = tzoff.seconds + (86400 * tzoff.days)493 if total_seconds == 0:494 _svalue += 'Z'495 else:496 if total_seconds < 0:497 _svalue += '-'498 total_seconds *= -1499 else:500 _svalue += '+'501 hours = total_seconds // 3600502 minutes = (total_seconds - (hours * 3600)) // 60503 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)504 return _svalue505 def gds_validate_simple_patterns(self, patterns, target):506 # pat is a list of lists of strings/patterns.507 # The target value must match at least one of the patterns508 # in order for the test to succeed.509 found1 = True510 target = str(target)511 for patterns1 in patterns:512 found2 = False513 for patterns2 in patterns1:514 mo = re_.search(patterns2, target)515 if mo is not None and len(mo.group(0)) == len(target):516 found2 = True517 break518 if not found2:519 found1 = False520 break521 return found1522 @classmethod523 def gds_parse_time(cls, input_data):524 tz = None525 if input_data[-1] == 'Z':526 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')527 input_data = input_data[:-1]528 else:529 results = GeneratedsSuper.tzoff_pattern.search(input_data)530 if results is not None:531 tzoff_parts = results.group(2).split(':')532 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])533 if results.group(1) == '-':534 tzoff *= -1535 tz = GeneratedsSuper._FixedOffsetTZ(536 tzoff, results.group(0))537 input_data = input_data[:-6]538 if len(input_data.split('.')) > 1:539 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')540 else:541 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')542 dt = dt.replace(tzinfo=tz)543 return dt.time()544 def gds_check_cardinality_(545 self, value, input_name,546 min_occurs=0, max_occurs=1, required=None):547 if value is None:548 length = 0549 elif isinstance(value, list):550 length = len(value)551 else:552 length = 1553 if required is not None :554 if required and length < 1:555 self.gds_collector_.add_message(556 "Required value {}{} is missing".format(557 input_name, self.gds_get_node_lineno_()))558 if length < min_occurs:559 self.gds_collector_.add_message(560 "Number of values for {}{} is below "561 "the minimum allowed, "562 "expected at least {}, found {}".format(563 input_name, self.gds_get_node_lineno_(),564 min_occurs, length))565 elif length > max_occurs:566 self.gds_collector_.add_message(567 "Number of values for {}{} is above "568 "the maximum allowed, "569 "expected at most {}, found {}".format(570 input_name, self.gds_get_node_lineno_(),571 max_occurs, length))572 def gds_validate_builtin_ST_(573 self, validator, value, input_name,574 min_occurs=None, max_occurs=None, required=None):575 if value is not None:576 try:577 validator(value, input_name=input_name)578 except GDSParseError as parse_error:579 self.gds_collector_.add_message(str(parse_error))580 def gds_validate_defined_ST_(581 self, validator, value, input_name,582 min_occurs=None, max_occurs=None, required=None):583 if value is not None:584 try:585 validator(value)586 except GDSParseError as parse_error:587 self.gds_collector_.add_message(str(parse_error))588 def gds_str_lower(self, instring):589 return instring.lower()590 def get_path_(self, node):591 path_list = []592 self.get_path_list_(node, path_list)593 path_list.reverse()594 path = '/'.join(path_list)595 return path596 Tag_strip_pattern_ = re_.compile(r'\{.*\}')597 def get_path_list_(self, node, path_list):598 if node is None:599 return600 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)601 if tag:602 path_list.append(tag)603 self.get_path_list_(node.getparent(), path_list)604 def get_class_obj_(self, node, default_class=None):605 class_obj1 = default_class606 if 'xsi' in node.nsmap:607 classname = node.get('{%s}type' % node.nsmap['xsi'])608 if classname is not None:609 names = classname.split(':')610 if len(names) == 2:611 classname = names[1]612 class_obj2 = globals().get(classname)613 if class_obj2 is not None:614 class_obj1 = class_obj2615 return class_obj1616 def gds_build_any(self, node, type_name=None):617 # provide default value in case option --disable-xml is used.618 content = ""619 content = etree_.tostring(node, encoding="unicode")620 return content621 @classmethod622 def gds_reverse_node_mapping(cls, mapping):623 return dict(((v, k) for k, v in mapping.items()))624 @staticmethod625 def gds_encode(instring):626 if sys.version_info.major == 2:627 if ExternalEncoding:628 encoding = ExternalEncoding629 else:630 encoding = 'utf-8'631 return instring.encode(encoding)632 else:633 return instring634 @staticmethod635 def convert_unicode(instring):636 if isinstance(instring, str):637 result = quote_xml(instring)638 elif sys.version_info.major == 2 and isinstance(instring, unicode):639 result = quote_xml(instring).encode('utf8')640 else:641 result = GeneratedsSuper.gds_encode(str(instring))642 return result643 def __eq__(self, other):644 def excl_select_objs_(obj):645 return (obj[0] != 'parent_object_' and646 obj[0] != 'gds_collector_')647 if type(self) != type(other):648 return False649 return all(x == y for x, y in zip_longest(650 filter(excl_select_objs_, self.__dict__.items()),651 filter(excl_select_objs_, other.__dict__.items())))652 def __ne__(self, other):653 return not self.__eq__(other)654 # Django ETL transform hooks.655 def gds_djo_etl_transform(self):656 pass657 def gds_djo_etl_transform_db_obj(self, dbobj):658 pass659 # SQLAlchemy ETL transform hooks.660 def gds_sqa_etl_transform(self):661 return 0, None662 def gds_sqa_etl_transform_db_obj(self, dbobj):663 pass664 def gds_get_node_lineno_(self):665 if (hasattr(self, "gds_elementtree_node_") and666 self.gds_elementtree_node_ is not None):667 return ' near line {}'.format(668 self.gds_elementtree_node_.sourceline)669 else:670 return ""671 672 673 def getSubclassFromModule_(module, class_):674 '''Get the subclass of a class from a specific module.'''675 name = class_.__name__ + 'Sub'676 if hasattr(module, name):677 return getattr(module, name)678 else:679 return None680#681# If you have installed IPython you can uncomment and use the following.682# IPython is available from http://ipython.scipy.org/.683#684## from IPython.Shell import IPShellEmbed685## args = ''686## ipshell = IPShellEmbed(args,687## banner = 'Dropping into IPython',688## exit_msg = 'Leaving Interpreter, back to program.')689# Then use the following line where and when you want to drop into the690# IPython shell:691# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')692#693# Globals694#695ExternalEncoding = ''696# Set this to false in order to deactivate during export, the use of697# name space prefixes captured from the input document.698UseCapturedNS_ = True699CapturedNsmap_ = {}700Tag_pattern_ = re_.compile(r'({.*})?(.*)')701String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")702Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')703CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)704# Change this to redirect the generated superclass module to use a705# specific subclass module.706CurrentSubclassModule_ = None707#708# Support/utility functions.709#710def showIndent(outfile, level, pretty_print=True):711 if pretty_print:712 for idx in range(level):713 outfile.write(' ')714def quote_xml(inStr):715 "Escape markup chars, but do not modify CDATA sections."716 if not inStr:717 return ''718 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)719 s2 = ''720 pos = 0721 matchobjects = CDATA_pattern_.finditer(s1)722 for mo in matchobjects:723 s3 = s1[pos:mo.start()]724 s2 += quote_xml_aux(s3)725 s2 += s1[mo.start():mo.end()]726 pos = mo.end()727 s3 = s1[pos:]728 s2 += quote_xml_aux(s3)729 return s2730def quote_xml_aux(inStr):731 s1 = inStr.replace('&', '&amp;')732 s1 = s1.replace('<', '&lt;')733 s1 = s1.replace('>', '&gt;')734 return s1735def quote_attrib(inStr):736 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)737 s1 = s1.replace('&', '&amp;')738 s1 = s1.replace('<', '&lt;')739 s1 = s1.replace('>', '&gt;')740 s1 = s1.replace('\n', '&#10;')741 if '"' in s1:742 if "'" in s1:743 s1 = '"%s"' % s1.replace('"', "&quot;")744 else:745 s1 = "'%s'" % s1746 else:747 s1 = '"%s"' % s1748 return s1749def quote_python(inStr):750 s1 = inStr751 if s1.find("'") == -1:752 if s1.find('\n') == -1:753 return "'%s'" % s1754 else:755 return "'''%s'''" % s1756 else:757 if s1.find('"') != -1:758 s1 = s1.replace('"', '\\"')759 if s1.find('\n') == -1:760 return '"%s"' % s1761 else:762 return '"""%s"""' % s1763def get_all_text_(node):764 if node.text is not None:765 text = node.text766 else:767 text = ''768 for child in node:769 if child.tail is not None:770 text += child.tail771 return text772def find_attr_value_(attr_name, node):773 attrs = node.attrib774 attr_parts = attr_name.split(':')775 value = None776 if len(attr_parts) == 1:777 value = attrs.get(attr_name)778 elif len(attr_parts) == 2:779 prefix, name = attr_parts780 if prefix == 'xml':781 namespace = 'http://www.w3.org/XML/1998/namespace'782 else:783 namespace = node.nsmap.get(prefix)784 if namespace is not None:785 value = attrs.get('{%s}%s' % (namespace, name, ))786 return value787def encode_str_2_3(instr):788 return instr789class GDSParseError(Exception):790 pass791def raise_parse_error(node, msg):792 if node is not None:793 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )794 raise GDSParseError(msg)795class MixedContainer:796 # Constants for category:797 CategoryNone = 0798 CategoryText = 1799 CategorySimple = 2800 CategoryComplex = 3801 # Constants for content_type:802 TypeNone = 0803 TypeText = 1804 TypeString = 2805 TypeInteger = 3806 TypeFloat = 4807 TypeDecimal = 5808 TypeDouble = 6809 TypeBoolean = 7810 TypeBase64 = 8811 def __init__(self, category, content_type, name, value):812 self.category = category813 self.content_type = content_type814 self.name = name815 self.value = value816 def getCategory(self):817 return self.category818 def getContenttype(self, content_type):819 return self.content_type820 def getValue(self):821 return self.value822 def getName(self):823 return self.name824 def export(self, outfile, level, name, namespace,825 pretty_print=True):826 if self.category == MixedContainer.CategoryText:827 # Prevent exporting empty content as empty lines.828 if self.value.strip():829 outfile.write(self.value)830 elif self.category == MixedContainer.CategorySimple:831 self.exportSimple(outfile, level, name)832 else: # category == MixedContainer.CategoryComplex833 self.value.export(834 outfile, level, namespace, name_=name,835 pretty_print=pretty_print)836 def exportSimple(self, outfile, level, name):837 if self.content_type == MixedContainer.TypeString:838 outfile.write('<%s>%s</%s>' % (839 self.name, self.value, self.name))840 elif self.content_type == MixedContainer.TypeInteger or \841 self.content_type == MixedContainer.TypeBoolean:842 outfile.write('<%s>%d</%s>' % (843 self.name, self.value, self.name))844 elif self.content_type == MixedContainer.TypeFloat or \845 self.content_type == MixedContainer.TypeDecimal:846 outfile.write('<%s>%f</%s>' % (847 self.name, self.value, self.name))848 elif self.content_type == MixedContainer.TypeDouble:849 outfile.write('<%s>%g</%s>' % (850 self.name, self.value, self.name))851 elif self.content_type == MixedContainer.TypeBase64:852 outfile.write('<%s>%s</%s>' % (853 self.name,854 base64.b64encode(self.value),855 self.name))856 def to_etree(self, element, mapping_=None, reverse_mapping_=None, nsmap_=None):857 if self.category == MixedContainer.CategoryText:858 # Prevent exporting empty content as empty lines.859 if self.value.strip():860 if len(element) > 0:861 if element[-1].tail is None:862 element[-1].tail = self.value863 else:864 element[-1].tail += self.value865 else:866 if element.text is None:867 element.text = self.value868 else:869 element.text += self.value870 elif self.category == MixedContainer.CategorySimple:871 subelement = etree_.SubElement(872 element, '%s' % self.name)873 subelement.text = self.to_etree_simple()874 else: # category == MixedContainer.CategoryComplex875 self.value.to_etree(element)876 def to_etree_simple(self, mapping_=None, reverse_mapping_=None, nsmap_=None):877 if self.content_type == MixedContainer.TypeString:878 text = self.value879 elif (self.content_type == MixedContainer.TypeInteger or880 self.content_type == MixedContainer.TypeBoolean):881 text = '%d' % self.value882 elif (self.content_type == MixedContainer.TypeFloat or883 self.content_type == MixedContainer.TypeDecimal):884 text = '%f' % self.value885 elif self.content_type == MixedContainer.TypeDouble:886 text = '%g' % self.value887 elif self.content_type == MixedContainer.TypeBase64:888 text = '%s' % base64.b64encode(self.value)889 return text890 def exportLiteral(self, outfile, level, name):891 if self.category == MixedContainer.CategoryText:892 showIndent(outfile, level)893 outfile.write(894 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (895 self.category, self.content_type,896 self.name, self.value))897 elif self.category == MixedContainer.CategorySimple:898 showIndent(outfile, level)899 outfile.write(900 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (901 self.category, self.content_type,902 self.name, self.value))903 else: # category == MixedContainer.CategoryComplex904 showIndent(outfile, level)905 outfile.write(906 'model_.MixedContainer(%d, %d, "%s",\n' % (907 self.category, self.content_type, self.name,))908 self.value.exportLiteral(outfile, level + 1)909 showIndent(outfile, level)910 outfile.write(')\n')911class MemberSpec_(object):912 def __init__(self, name='', data_type='', container=0,913 optional=0, child_attrs=None, choice=None):914 self.name = name915 self.data_type = data_type916 self.container = container917 self.child_attrs = child_attrs918 self.choice = choice919 self.optional = optional920 def set_name(self, name): self.name = name921 def get_name(self): return self.name922 def set_data_type(self, data_type): self.data_type = data_type923 def get_data_type_chain(self): return self.data_type924 def get_data_type(self):925 if isinstance(self.data_type, list):926 if len(self.data_type) > 0:927 return self.data_type[-1]928 else:929 return 'xs:string'930 else:931 return self.data_type932 def set_container(self, container): self.container = container933 def get_container(self): return self.container934 def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs935 def get_child_attrs(self): return self.child_attrs936 def set_choice(self, choice): self.choice = choice937 def get_choice(self): return self.choice938 def set_optional(self, optional): self.optional = optional939 def get_optional(self): return self.optional940def _cast(typ, value):941 if typ is None or value is None:942 return value943 return typ(value)944#945# Data representation classes.946#947class WDSMatrix(GeneratedsSuper):948 __hash__ = GeneratedsSuper.__hash__949 subclass = None950 superclass = None951 def __init__(self, Name=None, NumberOfStates=None, NumberOfAdditionalAxes=None, ProvidesNonZeroCoords=None, AdditionalAxesUpperLimits=None, AdditionalAxesLowerLimits=None, StateLabels=None, NonZeroElements=None, MData=None, Betas=None, FunctionalInputs=None, RedundantFunctionalInputs=None, gds_collector_=None, **kwargs_):952 self.gds_collector_ = gds_collector_953 self.gds_elementtree_node_ = None954 self.original_tagname_ = None955 self.parent_object_ = kwargs_.get('parent_object_')956 self.ns_prefix_ = None957 self.Name = _cast(None, Name)958 self.Name_nsprefix_ = None959 self.NumberOfStates = NumberOfStates960 self.NumberOfStates_nsprefix_ = None961 self.NumberOfAdditionalAxes = NumberOfAdditionalAxes962 self.NumberOfAdditionalAxes_nsprefix_ = None963 self.ProvidesNonZeroCoords = ProvidesNonZeroCoords964 self.ProvidesNonZeroCoords_nsprefix_ = None965 self.AdditionalAxesUpperLimits = AdditionalAxesUpperLimits966 self.AdditionalAxesUpperLimits_nsprefix_ = None967 self.AdditionalAxesLowerLimits = AdditionalAxesLowerLimits968 self.AdditionalAxesLowerLimits_nsprefix_ = None969 self.StateLabels = StateLabels970 self.StateLabels_nsprefix_ = None971 self.NonZeroElements = NonZeroElements972 self.NonZeroElements_nsprefix_ = None973 if MData is None:974 self.MData = []975 else:976 self.MData = MData977 self.MData_nsprefix_ = None978 self.Betas = Betas979 self.Betas_nsprefix_ = None980 self.FunctionalInputs = FunctionalInputs981 self.FunctionalInputs_nsprefix_ = None982 self.RedundantFunctionalInputs = RedundantFunctionalInputs983 self.RedundantFunctionalInputs_nsprefix_ = None984 def factory(*args_, **kwargs_):985 if CurrentSubclassModule_ is not None:986 subclass = getSubclassFromModule_(987 CurrentSubclassModule_, WDSMatrix)988 if subclass is not None:989 return subclass(*args_, **kwargs_)990 if WDSMatrix.subclass:991 return WDSMatrix.subclass(*args_, **kwargs_)992 else:993 return WDSMatrix(*args_, **kwargs_)994 factory = staticmethod(factory)995 def get_ns_prefix_(self):996 return self.ns_prefix_997 def set_ns_prefix_(self, ns_prefix):998 self.ns_prefix_ = ns_prefix999 def get_NumberOfStates(self):1000 return self.NumberOfStates1001 def set_NumberOfStates(self, NumberOfStates):1002 self.NumberOfStates = NumberOfStates1003 def get_NumberOfAdditionalAxes(self):1004 return self.NumberOfAdditionalAxes1005 def set_NumberOfAdditionalAxes(self, NumberOfAdditionalAxes):1006 self.NumberOfAdditionalAxes = NumberOfAdditionalAxes1007 def get_ProvidesNonZeroCoords(self):1008 return self.ProvidesNonZeroCoords1009 def set_ProvidesNonZeroCoords(self, ProvidesNonZeroCoords):1010 self.ProvidesNonZeroCoords = ProvidesNonZeroCoords1011 def get_AdditionalAxesUpperLimits(self):1012 return self.AdditionalAxesUpperLimits1013 def set_AdditionalAxesUpperLimits(self, AdditionalAxesUpperLimits):1014 self.AdditionalAxesUpperLimits = AdditionalAxesUpperLimits1015 def get_AdditionalAxesLowerLimits(self):1016 return self.AdditionalAxesLowerLimits1017 def set_AdditionalAxesLowerLimits(self, AdditionalAxesLowerLimits):1018 self.AdditionalAxesLowerLimits = AdditionalAxesLowerLimits1019 def get_StateLabels(self):1020 return self.StateLabels1021 def set_StateLabels(self, StateLabels):1022 self.StateLabels = StateLabels1023 def get_NonZeroElements(self):1024 return self.NonZeroElements1025 def set_NonZeroElements(self, NonZeroElements):1026 self.NonZeroElements = NonZeroElements1027 def get_MData(self):1028 return self.MData1029 def set_MData(self, MData):1030 self.MData = MData1031 def add_MData(self, value):1032 self.MData.append(value)1033 def insert_MData_at(self, index, value):1034 self.MData.insert(index, value)1035 def replace_MData_at(self, index, value):1036 self.MData[index] = value1037 def get_Betas(self):1038 return self.Betas1039 def set_Betas(self, Betas):1040 self.Betas = Betas1041 def get_FunctionalInputs(self):1042 return self.FunctionalInputs1043 def set_FunctionalInputs(self, FunctionalInputs):1044 self.FunctionalInputs = FunctionalInputs1045 def get_RedundantFunctionalInputs(self):1046 return self.RedundantFunctionalInputs1047 def set_RedundantFunctionalInputs(self, RedundantFunctionalInputs):1048 self.RedundantFunctionalInputs = RedundantFunctionalInputs1049 def get_Name(self):1050 return self.Name1051 def set_Name(self, Name):1052 self.Name = Name1053 def _hasContent(self):1054 if (1055 self.NumberOfStates is not None or1056 self.NumberOfAdditionalAxes is not None or1057 self.ProvidesNonZeroCoords is not None or1058 self.AdditionalAxesUpperLimits is not None or1059 self.AdditionalAxesLowerLimits is not None or1060 self.StateLabels is not None or1061 self.NonZeroElements is not None or1062 self.MData or1063 self.Betas is not None or1064 self.FunctionalInputs is not None or1065 self.RedundantFunctionalInputs is not None1066 ):1067 return True1068 else:1069 return False1070 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='WDSMatrix', pretty_print=True):1071 imported_ns_def_ = GenerateDSNamespaceDefs_.get('WDSMatrix')1072 if imported_ns_def_ is not None:1073 namespacedef_ = imported_ns_def_1074 if pretty_print:1075 eol_ = '\n'1076 else:1077 eol_ = ''1078 if self.original_tagname_ is not None and name_ == 'WDSMatrix':1079 name_ = self.original_tagname_1080 if UseCapturedNS_ and self.ns_prefix_:1081 namespaceprefix_ = self.ns_prefix_ + ':'1082 showIndent(outfile, level, pretty_print)1083 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1084 already_processed = set()1085 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='WDSMatrix')1086 if self._hasContent():1087 outfile.write('>%s' % (eol_, ))1088 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='WDSMatrix', pretty_print=pretty_print)1089 showIndent(outfile, level, pretty_print)1090 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1091 else:1092 outfile.write('/>%s' % (eol_, ))1093 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='WDSMatrix'):1094 if self.Name is not None and 'Name' not in already_processed:1095 already_processed.add('Name')1096 outfile.write(' Name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Name), input_name='Name')), ))1097 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='WDSMatrix', fromsubclass_=False, pretty_print=True):1098 if pretty_print:1099 eol_ = '\n'1100 else:1101 eol_ = ''1102 if self.NumberOfStates is not None:1103 namespaceprefix_ = self.NumberOfStates_nsprefix_ + ':' if (UseCapturedNS_ and self.NumberOfStates_nsprefix_) else ''1104 showIndent(outfile, level, pretty_print)1105 outfile.write('<%sNumberOfStates>%s</%sNumberOfStates>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumberOfStates, input_name='NumberOfStates'), namespaceprefix_ , eol_))1106 if self.NumberOfAdditionalAxes is not None:1107 namespaceprefix_ = self.NumberOfAdditionalAxes_nsprefix_ + ':' if (UseCapturedNS_ and self.NumberOfAdditionalAxes_nsprefix_) else ''1108 showIndent(outfile, level, pretty_print)1109 outfile.write('<%sNumberOfAdditionalAxes>%s</%sNumberOfAdditionalAxes>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumberOfAdditionalAxes, input_name='NumberOfAdditionalAxes'), namespaceprefix_ , eol_))1110 if self.ProvidesNonZeroCoords is not None:1111 namespaceprefix_ = self.ProvidesNonZeroCoords_nsprefix_ + ':' if (UseCapturedNS_ and self.ProvidesNonZeroCoords_nsprefix_) else ''1112 showIndent(outfile, level, pretty_print)1113 outfile.write('<%sProvidesNonZeroCoords>%s</%sProvidesNonZeroCoords>%s' % (namespaceprefix_ , self.gds_format_integer(self.ProvidesNonZeroCoords, input_name='ProvidesNonZeroCoords'), namespaceprefix_ , eol_))1114 if self.AdditionalAxesUpperLimits is not None:1115 namespaceprefix_ = self.AdditionalAxesUpperLimits_nsprefix_ + ':' if (UseCapturedNS_ and self.AdditionalAxesUpperLimits_nsprefix_) else ''1116 self.AdditionalAxesUpperLimits.export(outfile, level, namespaceprefix_, namespacedef_='', name_='AdditionalAxesUpperLimits', pretty_print=pretty_print)1117 if self.AdditionalAxesLowerLimits is not None:1118 namespaceprefix_ = self.AdditionalAxesLowerLimits_nsprefix_ + ':' if (UseCapturedNS_ and self.AdditionalAxesLowerLimits_nsprefix_) else ''1119 self.AdditionalAxesLowerLimits.export(outfile, level, namespaceprefix_, namespacedef_='', name_='AdditionalAxesLowerLimits', pretty_print=pretty_print)1120 if self.StateLabels is not None:1121 namespaceprefix_ = self.StateLabels_nsprefix_ + ':' if (UseCapturedNS_ and self.StateLabels_nsprefix_) else ''1122 self.StateLabels.export(outfile, level, namespaceprefix_, namespacedef_='', name_='StateLabels', pretty_print=pretty_print)1123 if self.NonZeroElements is not None:1124 namespaceprefix_ = self.NonZeroElements_nsprefix_ + ':' if (UseCapturedNS_ and self.NonZeroElements_nsprefix_) else ''1125 self.NonZeroElements.export(outfile, level, namespaceprefix_, namespacedef_='', name_='NonZeroElements', pretty_print=pretty_print)1126 for MData_ in self.MData:1127 namespaceprefix_ = self.MData_nsprefix_ + ':' if (UseCapturedNS_ and self.MData_nsprefix_) else ''1128 MData_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='MData', pretty_print=pretty_print)1129 if self.Betas is not None:1130 namespaceprefix_ = self.Betas_nsprefix_ + ':' if (UseCapturedNS_ and self.Betas_nsprefix_) else ''1131 self.Betas.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Betas', pretty_print=pretty_print)1132 if self.FunctionalInputs is not None:1133 namespaceprefix_ = self.FunctionalInputs_nsprefix_ + ':' if (UseCapturedNS_ and self.FunctionalInputs_nsprefix_) else ''1134 self.FunctionalInputs.export(outfile, level, namespaceprefix_, namespacedef_='', name_='FunctionalInputs', pretty_print=pretty_print)1135 if self.RedundantFunctionalInputs is not None:1136 namespaceprefix_ = self.RedundantFunctionalInputs_nsprefix_ + ':' if (UseCapturedNS_ and self.RedundantFunctionalInputs_nsprefix_) else ''1137 self.RedundantFunctionalInputs.export(outfile, level, namespaceprefix_, namespacedef_='', name_='RedundantFunctionalInputs', pretty_print=pretty_print)1138 def to_etree(self, parent_element=None, name_='WDSMatrix', mapping_=None, reverse_mapping_=None, nsmap_=None):1139 if parent_element is None:1140 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1141 else:1142 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1143 if self.Name is not None:1144 element.set('Name', self.gds_format_string(self.Name))1145 if self.NumberOfStates is not None:1146 NumberOfStates_ = self.NumberOfStates1147 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}NumberOfStates').text = self.gds_format_integer(NumberOfStates_)1148 if self.NumberOfAdditionalAxes is not None:1149 NumberOfAdditionalAxes_ = self.NumberOfAdditionalAxes1150 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}NumberOfAdditionalAxes').text = self.gds_format_integer(NumberOfAdditionalAxes_)1151 if self.ProvidesNonZeroCoords is not None:1152 ProvidesNonZeroCoords_ = self.ProvidesNonZeroCoords1153 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}ProvidesNonZeroCoords').text = self.gds_format_integer(ProvidesNonZeroCoords_)1154 if self.AdditionalAxesUpperLimits is not None:1155 AdditionalAxesUpperLimits_ = self.AdditionalAxesUpperLimits1156 AdditionalAxesUpperLimits_.to_etree(element, name_='AdditionalAxesUpperLimits', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1157 if self.AdditionalAxesLowerLimits is not None:1158 AdditionalAxesLowerLimits_ = self.AdditionalAxesLowerLimits1159 AdditionalAxesLowerLimits_.to_etree(element, name_='AdditionalAxesLowerLimits', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1160 if self.StateLabels is not None:1161 StateLabels_ = self.StateLabels1162 StateLabels_.to_etree(element, name_='StateLabels', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1163 if self.NonZeroElements is not None:1164 NonZeroElements_ = self.NonZeroElements1165 NonZeroElements_.to_etree(element, name_='NonZeroElements', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1166 for MData_ in self.MData:1167 MData_.to_etree(element, name_='MData', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1168 if self.Betas is not None:1169 Betas_ = self.Betas1170 Betas_.to_etree(element, name_='Betas', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1171 if self.FunctionalInputs is not None:1172 FunctionalInputs_ = self.FunctionalInputs1173 FunctionalInputs_.to_etree(element, name_='FunctionalInputs', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1174 if self.RedundantFunctionalInputs is not None:1175 RedundantFunctionalInputs_ = self.RedundantFunctionalInputs1176 RedundantFunctionalInputs_.to_etree(element, name_='RedundantFunctionalInputs', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1177 if mapping_ is not None:1178 mapping_[id(self)] = element1179 if reverse_mapping_ is not None:1180 reverse_mapping_[element] = self1181 return element1182 def build(self, node, gds_collector_=None):1183 self.gds_collector_ = gds_collector_1184 if SaveElementTreeNode:1185 self.gds_elementtree_node_ = node1186 already_processed = set()1187 self.ns_prefix_ = node.prefix1188 self._buildAttributes(node, node.attrib, already_processed)1189 for child in node:1190 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1191 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1192 return self1193 def _buildAttributes(self, node, attrs, already_processed):1194 value = find_attr_value_('Name', node)1195 if value is not None and 'Name' not in already_processed:1196 already_processed.add('Name')1197 self.Name = value1198 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1199 if nodeName_ == 'NumberOfStates' and child_.text:1200 sval_ = child_.text1201 ival_ = self.gds_parse_integer(sval_, node, 'NumberOfStates')1202 ival_ = self.gds_validate_integer(ival_, node, 'NumberOfStates')1203 self.NumberOfStates = ival_1204 self.NumberOfStates_nsprefix_ = child_.prefix1205 elif nodeName_ == 'NumberOfAdditionalAxes' and child_.text:1206 sval_ = child_.text1207 ival_ = self.gds_parse_integer(sval_, node, 'NumberOfAdditionalAxes')1208 ival_ = self.gds_validate_integer(ival_, node, 'NumberOfAdditionalAxes')1209 self.NumberOfAdditionalAxes = ival_1210 self.NumberOfAdditionalAxes_nsprefix_ = child_.prefix1211 elif nodeName_ == 'ProvidesNonZeroCoords' and child_.text:1212 sval_ = child_.text1213 ival_ = self.gds_parse_integer(sval_, node, 'ProvidesNonZeroCoords')1214 ival_ = self.gds_validate_integer(ival_, node, 'ProvidesNonZeroCoords')1215 self.ProvidesNonZeroCoords = ival_1216 self.ProvidesNonZeroCoords_nsprefix_ = child_.prefix1217 elif nodeName_ == 'AdditionalAxesUpperLimits':1218 obj_ = AdditionalAxesUpperLimitsType.factory(parent_object_=self)1219 obj_.build(child_, gds_collector_=gds_collector_)1220 self.AdditionalAxesUpperLimits = obj_1221 obj_.original_tagname_ = 'AdditionalAxesUpperLimits'1222 elif nodeName_ == 'AdditionalAxesLowerLimits':1223 obj_ = AdditionalAxesLowerLimitsType.factory(parent_object_=self)1224 obj_.build(child_, gds_collector_=gds_collector_)1225 self.AdditionalAxesLowerLimits = obj_1226 obj_.original_tagname_ = 'AdditionalAxesLowerLimits'1227 elif nodeName_ == 'StateLabels':1228 obj_ = StateLabelsType.factory(parent_object_=self)1229 obj_.build(child_, gds_collector_=gds_collector_)1230 self.StateLabels = obj_1231 obj_.original_tagname_ = 'StateLabels'1232 elif nodeName_ == 'NonZeroElements':1233 obj_ = NonZeroElementsType.factory(parent_object_=self)1234 obj_.build(child_, gds_collector_=gds_collector_)1235 self.NonZeroElements = obj_1236 obj_.original_tagname_ = 'NonZeroElements'1237 elif nodeName_ == 'MData':1238 obj_ = MDataType.factory(parent_object_=self)1239 obj_.build(child_, gds_collector_=gds_collector_)1240 self.MData.append(obj_)1241 obj_.original_tagname_ = 'MData'1242 elif nodeName_ == 'Betas':1243 obj_ = BetasType.factory(parent_object_=self)1244 obj_.build(child_, gds_collector_=gds_collector_)1245 self.Betas = obj_1246 obj_.original_tagname_ = 'Betas'1247 elif nodeName_ == 'FunctionalInputs':1248 obj_ = FunctionalInputsType.factory(parent_object_=self)1249 obj_.build(child_, gds_collector_=gds_collector_)1250 self.FunctionalInputs = obj_1251 obj_.original_tagname_ = 'FunctionalInputs'1252 elif nodeName_ == 'RedundantFunctionalInputs':1253 obj_ = RedundantFunctionalInputsType.factory(parent_object_=self)1254 obj_.build(child_, gds_collector_=gds_collector_)1255 self.RedundantFunctionalInputs = obj_1256 obj_.original_tagname_ = 'RedundantFunctionalInputs'1257# end class WDSMatrix1258class AdditionalAxesUpperLimitsType(GeneratedsSuper):1259 __hash__ = GeneratedsSuper.__hash__1260 subclass = None1261 superclass = None1262 def __init__(self, Axis1=None, Axis2=None, Axis3=None, Axis4=None, gds_collector_=None, **kwargs_):1263 self.gds_collector_ = gds_collector_1264 self.gds_elementtree_node_ = None1265 self.original_tagname_ = None1266 self.parent_object_ = kwargs_.get('parent_object_')1267 self.ns_prefix_ = None1268 self.Axis1 = Axis11269 self.Axis1_nsprefix_ = None1270 self.Axis2 = Axis21271 self.Axis2_nsprefix_ = None1272 self.Axis3 = Axis31273 self.Axis3_nsprefix_ = None1274 self.Axis4 = Axis41275 self.Axis4_nsprefix_ = None1276 def factory(*args_, **kwargs_):1277 if CurrentSubclassModule_ is not None:1278 subclass = getSubclassFromModule_(1279 CurrentSubclassModule_, AdditionalAxesUpperLimitsType)1280 if subclass is not None:1281 return subclass(*args_, **kwargs_)1282 if AdditionalAxesUpperLimitsType.subclass:1283 return AdditionalAxesUpperLimitsType.subclass(*args_, **kwargs_)1284 else:1285 return AdditionalAxesUpperLimitsType(*args_, **kwargs_)1286 factory = staticmethod(factory)1287 def get_ns_prefix_(self):1288 return self.ns_prefix_1289 def set_ns_prefix_(self, ns_prefix):1290 self.ns_prefix_ = ns_prefix1291 def get_Axis1(self):1292 return self.Axis11293 def set_Axis1(self, Axis1):1294 self.Axis1 = Axis11295 def get_Axis2(self):1296 return self.Axis21297 def set_Axis2(self, Axis2):1298 self.Axis2 = Axis21299 def get_Axis3(self):1300 return self.Axis31301 def set_Axis3(self, Axis3):1302 self.Axis3 = Axis31303 def get_Axis4(self):1304 return self.Axis41305 def set_Axis4(self, Axis4):1306 self.Axis4 = Axis41307 def _hasContent(self):1308 if (1309 self.Axis1 is not None or1310 self.Axis2 is not None or1311 self.Axis3 is not None or1312 self.Axis4 is not None1313 ):1314 return True1315 else:1316 return False1317 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesUpperLimitsType', pretty_print=True):1318 imported_ns_def_ = GenerateDSNamespaceDefs_.get('AdditionalAxesUpperLimitsType')1319 if imported_ns_def_ is not None:1320 namespacedef_ = imported_ns_def_1321 if pretty_print:1322 eol_ = '\n'1323 else:1324 eol_ = ''1325 if self.original_tagname_ is not None and name_ == 'AdditionalAxesUpperLimitsType':1326 name_ = self.original_tagname_1327 if UseCapturedNS_ and self.ns_prefix_:1328 namespaceprefix_ = self.ns_prefix_ + ':'1329 showIndent(outfile, level, pretty_print)1330 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1331 already_processed = set()1332 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='AdditionalAxesUpperLimitsType')1333 if self._hasContent():1334 outfile.write('>%s' % (eol_, ))1335 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='AdditionalAxesUpperLimitsType', pretty_print=pretty_print)1336 showIndent(outfile, level, pretty_print)1337 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1338 else:1339 outfile.write('/>%s' % (eol_, ))1340 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='AdditionalAxesUpperLimitsType'):1341 pass1342 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesUpperLimitsType', fromsubclass_=False, pretty_print=True):1343 if pretty_print:1344 eol_ = '\n'1345 else:1346 eol_ = ''1347 if self.Axis1 is not None:1348 namespaceprefix_ = self.Axis1_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis1_nsprefix_) else ''1349 showIndent(outfile, level, pretty_print)1350 outfile.write('<%sAxis1>%s</%sAxis1>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis1, input_name='Axis1'), namespaceprefix_ , eol_))1351 if self.Axis2 is not None:1352 namespaceprefix_ = self.Axis2_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis2_nsprefix_) else ''1353 showIndent(outfile, level, pretty_print)1354 outfile.write('<%sAxis2>%s</%sAxis2>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis2, input_name='Axis2'), namespaceprefix_ , eol_))1355 if self.Axis3 is not None:1356 namespaceprefix_ = self.Axis3_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis3_nsprefix_) else ''1357 showIndent(outfile, level, pretty_print)1358 outfile.write('<%sAxis3>%s</%sAxis3>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis3, input_name='Axis3'), namespaceprefix_ , eol_))1359 if self.Axis4 is not None:1360 namespaceprefix_ = self.Axis4_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis4_nsprefix_) else ''1361 showIndent(outfile, level, pretty_print)1362 outfile.write('<%sAxis4>%s</%sAxis4>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis4, input_name='Axis4'), namespaceprefix_ , eol_))1363 def to_etree(self, parent_element=None, name_='AdditionalAxesUpperLimitsType', mapping_=None, reverse_mapping_=None, nsmap_=None):1364 if parent_element is None:1365 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1366 else:1367 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1368 if self.Axis1 is not None:1369 Axis1_ = self.Axis11370 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis1').text = self.gds_format_integer(Axis1_)1371 if self.Axis2 is not None:1372 Axis2_ = self.Axis21373 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis2').text = self.gds_format_integer(Axis2_)1374 if self.Axis3 is not None:1375 Axis3_ = self.Axis31376 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis3').text = self.gds_format_integer(Axis3_)1377 if self.Axis4 is not None:1378 Axis4_ = self.Axis41379 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis4').text = self.gds_format_integer(Axis4_)1380 if mapping_ is not None:1381 mapping_[id(self)] = element1382 if reverse_mapping_ is not None:1383 reverse_mapping_[element] = self1384 return element1385 def build(self, node, gds_collector_=None):1386 self.gds_collector_ = gds_collector_1387 if SaveElementTreeNode:1388 self.gds_elementtree_node_ = node1389 already_processed = set()1390 self.ns_prefix_ = node.prefix1391 self._buildAttributes(node, node.attrib, already_processed)1392 for child in node:1393 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1394 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1395 return self1396 def _buildAttributes(self, node, attrs, already_processed):1397 pass1398 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1399 if nodeName_ == 'Axis1' and child_.text:1400 sval_ = child_.text1401 ival_ = self.gds_parse_integer(sval_, node, 'Axis1')1402 ival_ = self.gds_validate_integer(ival_, node, 'Axis1')1403 self.Axis1 = ival_1404 self.Axis1_nsprefix_ = child_.prefix1405 elif nodeName_ == 'Axis2' and child_.text:1406 sval_ = child_.text1407 ival_ = self.gds_parse_integer(sval_, node, 'Axis2')1408 ival_ = self.gds_validate_integer(ival_, node, 'Axis2')1409 self.Axis2 = ival_1410 self.Axis2_nsprefix_ = child_.prefix1411 elif nodeName_ == 'Axis3' and child_.text:1412 sval_ = child_.text1413 ival_ = self.gds_parse_integer(sval_, node, 'Axis3')1414 ival_ = self.gds_validate_integer(ival_, node, 'Axis3')1415 self.Axis3 = ival_1416 self.Axis3_nsprefix_ = child_.prefix1417 elif nodeName_ == 'Axis4' and child_.text:1418 sval_ = child_.text1419 ival_ = self.gds_parse_integer(sval_, node, 'Axis4')1420 ival_ = self.gds_validate_integer(ival_, node, 'Axis4')1421 self.Axis4 = ival_1422 self.Axis4_nsprefix_ = child_.prefix1423# end class AdditionalAxesUpperLimitsType1424class AdditionalAxesLowerLimitsType(GeneratedsSuper):1425 __hash__ = GeneratedsSuper.__hash__1426 subclass = None1427 superclass = None1428 def __init__(self, Axis1=None, Axis2=None, Axis3=None, Axis4=None, gds_collector_=None, **kwargs_):1429 self.gds_collector_ = gds_collector_1430 self.gds_elementtree_node_ = None1431 self.original_tagname_ = None1432 self.parent_object_ = kwargs_.get('parent_object_')1433 self.ns_prefix_ = None1434 self.Axis1 = Axis11435 self.Axis1_nsprefix_ = None1436 self.Axis2 = Axis21437 self.Axis2_nsprefix_ = None1438 self.Axis3 = Axis31439 self.Axis3_nsprefix_ = None1440 self.Axis4 = Axis41441 self.Axis4_nsprefix_ = None1442 def factory(*args_, **kwargs_):1443 if CurrentSubclassModule_ is not None:1444 subclass = getSubclassFromModule_(1445 CurrentSubclassModule_, AdditionalAxesLowerLimitsType)1446 if subclass is not None:1447 return subclass(*args_, **kwargs_)1448 if AdditionalAxesLowerLimitsType.subclass:1449 return AdditionalAxesLowerLimitsType.subclass(*args_, **kwargs_)1450 else:1451 return AdditionalAxesLowerLimitsType(*args_, **kwargs_)1452 factory = staticmethod(factory)1453 def get_ns_prefix_(self):1454 return self.ns_prefix_1455 def set_ns_prefix_(self, ns_prefix):1456 self.ns_prefix_ = ns_prefix1457 def get_Axis1(self):1458 return self.Axis11459 def set_Axis1(self, Axis1):1460 self.Axis1 = Axis11461 def get_Axis2(self):1462 return self.Axis21463 def set_Axis2(self, Axis2):1464 self.Axis2 = Axis21465 def get_Axis3(self):1466 return self.Axis31467 def set_Axis3(self, Axis3):1468 self.Axis3 = Axis31469 def get_Axis4(self):1470 return self.Axis41471 def set_Axis4(self, Axis4):1472 self.Axis4 = Axis41473 def _hasContent(self):1474 if (1475 self.Axis1 is not None or1476 self.Axis2 is not None or1477 self.Axis3 is not None or1478 self.Axis4 is not None1479 ):1480 return True1481 else:1482 return False1483 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesLowerLimitsType', pretty_print=True):1484 imported_ns_def_ = GenerateDSNamespaceDefs_.get('AdditionalAxesLowerLimitsType')1485 if imported_ns_def_ is not None:1486 namespacedef_ = imported_ns_def_1487 if pretty_print:1488 eol_ = '\n'1489 else:1490 eol_ = ''1491 if self.original_tagname_ is not None and name_ == 'AdditionalAxesLowerLimitsType':1492 name_ = self.original_tagname_1493 if UseCapturedNS_ and self.ns_prefix_:1494 namespaceprefix_ = self.ns_prefix_ + ':'1495 showIndent(outfile, level, pretty_print)1496 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1497 already_processed = set()1498 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='AdditionalAxesLowerLimitsType')1499 if self._hasContent():1500 outfile.write('>%s' % (eol_, ))1501 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='AdditionalAxesLowerLimitsType', pretty_print=pretty_print)1502 showIndent(outfile, level, pretty_print)1503 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1504 else:1505 outfile.write('/>%s' % (eol_, ))1506 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='AdditionalAxesLowerLimitsType'):1507 pass1508 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesLowerLimitsType', fromsubclass_=False, pretty_print=True):1509 if pretty_print:1510 eol_ = '\n'1511 else:1512 eol_ = ''1513 if self.Axis1 is not None:1514 namespaceprefix_ = self.Axis1_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis1_nsprefix_) else ''1515 showIndent(outfile, level, pretty_print)1516 outfile.write('<%sAxis1>%s</%sAxis1>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis1, input_name='Axis1'), namespaceprefix_ , eol_))1517 if self.Axis2 is not None:1518 namespaceprefix_ = self.Axis2_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis2_nsprefix_) else ''1519 showIndent(outfile, level, pretty_print)1520 outfile.write('<%sAxis2>%s</%sAxis2>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis2, input_name='Axis2'), namespaceprefix_ , eol_))1521 if self.Axis3 is not None:1522 namespaceprefix_ = self.Axis3_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis3_nsprefix_) else ''1523 showIndent(outfile, level, pretty_print)1524 outfile.write('<%sAxis3>%s</%sAxis3>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis3, input_name='Axis3'), namespaceprefix_ , eol_))1525 if self.Axis4 is not None:1526 namespaceprefix_ = self.Axis4_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis4_nsprefix_) else ''1527 showIndent(outfile, level, pretty_print)1528 outfile.write('<%sAxis4>%s</%sAxis4>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis4, input_name='Axis4'), namespaceprefix_ , eol_))1529 def to_etree(self, parent_element=None, name_='AdditionalAxesLowerLimitsType', mapping_=None, reverse_mapping_=None, nsmap_=None):1530 if parent_element is None:1531 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1532 else:1533 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1534 if self.Axis1 is not None:1535 Axis1_ = self.Axis11536 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis1').text = self.gds_format_integer(Axis1_)1537 if self.Axis2 is not None:1538 Axis2_ = self.Axis21539 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis2').text = self.gds_format_integer(Axis2_)1540 if self.Axis3 is not None:1541 Axis3_ = self.Axis31542 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis3').text = self.gds_format_integer(Axis3_)1543 if self.Axis4 is not None:1544 Axis4_ = self.Axis41545 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Axis4').text = self.gds_format_integer(Axis4_)1546 if mapping_ is not None:1547 mapping_[id(self)] = element1548 if reverse_mapping_ is not None:1549 reverse_mapping_[element] = self1550 return element1551 def build(self, node, gds_collector_=None):1552 self.gds_collector_ = gds_collector_1553 if SaveElementTreeNode:1554 self.gds_elementtree_node_ = node1555 already_processed = set()1556 self.ns_prefix_ = node.prefix1557 self._buildAttributes(node, node.attrib, already_processed)1558 for child in node:1559 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1560 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1561 return self1562 def _buildAttributes(self, node, attrs, already_processed):1563 pass1564 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1565 if nodeName_ == 'Axis1' and child_.text:1566 sval_ = child_.text1567 ival_ = self.gds_parse_integer(sval_, node, 'Axis1')1568 ival_ = self.gds_validate_integer(ival_, node, 'Axis1')1569 self.Axis1 = ival_1570 self.Axis1_nsprefix_ = child_.prefix1571 elif nodeName_ == 'Axis2' and child_.text:1572 sval_ = child_.text1573 ival_ = self.gds_parse_integer(sval_, node, 'Axis2')1574 ival_ = self.gds_validate_integer(ival_, node, 'Axis2')1575 self.Axis2 = ival_1576 self.Axis2_nsprefix_ = child_.prefix1577 elif nodeName_ == 'Axis3' and child_.text:1578 sval_ = child_.text1579 ival_ = self.gds_parse_integer(sval_, node, 'Axis3')1580 ival_ = self.gds_validate_integer(ival_, node, 'Axis3')1581 self.Axis3 = ival_1582 self.Axis3_nsprefix_ = child_.prefix1583 elif nodeName_ == 'Axis4' and child_.text:1584 sval_ = child_.text1585 ival_ = self.gds_parse_integer(sval_, node, 'Axis4')1586 ival_ = self.gds_validate_integer(ival_, node, 'Axis4')1587 self.Axis4 = ival_1588 self.Axis4_nsprefix_ = child_.prefix1589# end class AdditionalAxesLowerLimitsType1590class StateLabelsType(GeneratedsSuper):1591 __hash__ = GeneratedsSuper.__hash__1592 subclass = None1593 superclass = None1594 def __init__(self, StateLabel=None, gds_collector_=None, **kwargs_):1595 self.gds_collector_ = gds_collector_1596 self.gds_elementtree_node_ = None1597 self.original_tagname_ = None1598 self.parent_object_ = kwargs_.get('parent_object_')1599 self.ns_prefix_ = None1600 if StateLabel is None:1601 self.StateLabel = []1602 else:1603 self.StateLabel = StateLabel1604 self.StateLabel_nsprefix_ = None1605 def factory(*args_, **kwargs_):1606 if CurrentSubclassModule_ is not None:1607 subclass = getSubclassFromModule_(1608 CurrentSubclassModule_, StateLabelsType)1609 if subclass is not None:1610 return subclass(*args_, **kwargs_)1611 if StateLabelsType.subclass:1612 return StateLabelsType.subclass(*args_, **kwargs_)1613 else:1614 return StateLabelsType(*args_, **kwargs_)1615 factory = staticmethod(factory)1616 def get_ns_prefix_(self):1617 return self.ns_prefix_1618 def set_ns_prefix_(self, ns_prefix):1619 self.ns_prefix_ = ns_prefix1620 def get_StateLabel(self):1621 return self.StateLabel1622 def set_StateLabel(self, StateLabel):1623 self.StateLabel = StateLabel1624 def add_StateLabel(self, value):1625 self.StateLabel.append(value)1626 def insert_StateLabel_at(self, index, value):1627 self.StateLabel.insert(index, value)1628 def replace_StateLabel_at(self, index, value):1629 self.StateLabel[index] = value1630 def _hasContent(self):1631 if (1632 self.StateLabel1633 ):1634 return True1635 else:1636 return False1637 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='StateLabelsType', pretty_print=True):1638 imported_ns_def_ = GenerateDSNamespaceDefs_.get('StateLabelsType')1639 if imported_ns_def_ is not None:1640 namespacedef_ = imported_ns_def_1641 if pretty_print:1642 eol_ = '\n'1643 else:1644 eol_ = ''1645 if self.original_tagname_ is not None and name_ == 'StateLabelsType':1646 name_ = self.original_tagname_1647 if UseCapturedNS_ and self.ns_prefix_:1648 namespaceprefix_ = self.ns_prefix_ + ':'1649 showIndent(outfile, level, pretty_print)1650 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1651 already_processed = set()1652 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='StateLabelsType')1653 if self._hasContent():1654 outfile.write('>%s' % (eol_, ))1655 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='StateLabelsType', pretty_print=pretty_print)1656 showIndent(outfile, level, pretty_print)1657 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1658 else:1659 outfile.write('/>%s' % (eol_, ))1660 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='StateLabelsType'):1661 pass1662 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='StateLabelsType', fromsubclass_=False, pretty_print=True):1663 if pretty_print:1664 eol_ = '\n'1665 else:1666 eol_ = ''1667 for StateLabel_ in self.StateLabel:1668 namespaceprefix_ = self.StateLabel_nsprefix_ + ':' if (UseCapturedNS_ and self.StateLabel_nsprefix_) else ''1669 StateLabel_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='StateLabel', pretty_print=pretty_print)1670 def to_etree(self, parent_element=None, name_='StateLabelsType', mapping_=None, reverse_mapping_=None, nsmap_=None):1671 if parent_element is None:1672 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1673 else:1674 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1675 for StateLabel_ in self.StateLabel:1676 StateLabel_.to_etree(element, name_='StateLabel', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1677 if mapping_ is not None:1678 mapping_[id(self)] = element1679 if reverse_mapping_ is not None:1680 reverse_mapping_[element] = self1681 return element1682 def build(self, node, gds_collector_=None):1683 self.gds_collector_ = gds_collector_1684 if SaveElementTreeNode:1685 self.gds_elementtree_node_ = node1686 already_processed = set()1687 self.ns_prefix_ = node.prefix1688 self._buildAttributes(node, node.attrib, already_processed)1689 for child in node:1690 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1691 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1692 return self1693 def _buildAttributes(self, node, attrs, already_processed):1694 pass1695 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1696 if nodeName_ == 'StateLabel':1697 obj_ = StateLabelType.factory(parent_object_=self)1698 obj_.build(child_, gds_collector_=gds_collector_)1699 self.StateLabel.append(obj_)1700 obj_.original_tagname_ = 'StateLabel'1701# end class StateLabelsType1702class StateLabelType(GeneratedsSuper):1703 __hash__ = GeneratedsSuper.__hash__1704 subclass = None1705 superclass = None1706 def __init__(self, Position=None, valueOf_=None, gds_collector_=None, **kwargs_):1707 self.gds_collector_ = gds_collector_1708 self.gds_elementtree_node_ = None1709 self.original_tagname_ = None1710 self.parent_object_ = kwargs_.get('parent_object_')1711 self.ns_prefix_ = None1712 self.Position = _cast(int, Position)1713 self.Position_nsprefix_ = None1714 self.valueOf_ = valueOf_1715 def factory(*args_, **kwargs_):1716 if CurrentSubclassModule_ is not None:1717 subclass = getSubclassFromModule_(1718 CurrentSubclassModule_, StateLabelType)1719 if subclass is not None:1720 return subclass(*args_, **kwargs_)1721 if StateLabelType.subclass:1722 return StateLabelType.subclass(*args_, **kwargs_)1723 else:1724 return StateLabelType(*args_, **kwargs_)1725 factory = staticmethod(factory)1726 def get_ns_prefix_(self):1727 return self.ns_prefix_1728 def set_ns_prefix_(self, ns_prefix):1729 self.ns_prefix_ = ns_prefix1730 def get_Position(self):1731 return self.Position1732 def set_Position(self, Position):1733 self.Position = Position1734 def get_valueOf_(self): return self.valueOf_1735 def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_1736 def _hasContent(self):1737 if (1738 (1 if type(self.valueOf_) in [int,float] else self.valueOf_)1739 ):1740 return True1741 else:1742 return False1743 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='StateLabelType', pretty_print=True):1744 imported_ns_def_ = GenerateDSNamespaceDefs_.get('StateLabelType')1745 if imported_ns_def_ is not None:1746 namespacedef_ = imported_ns_def_1747 if pretty_print:1748 eol_ = '\n'1749 else:1750 eol_ = ''1751 if self.original_tagname_ is not None and name_ == 'StateLabelType':1752 name_ = self.original_tagname_1753 if UseCapturedNS_ and self.ns_prefix_:1754 namespaceprefix_ = self.ns_prefix_ + ':'1755 showIndent(outfile, level, pretty_print)1756 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1757 already_processed = set()1758 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='StateLabelType')1759 if self._hasContent():1760 outfile.write('>')1761 outfile.write(self.convert_unicode(self.valueOf_))1762 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='StateLabelType', pretty_print=pretty_print)1763 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1764 else:1765 outfile.write('/>%s' % (eol_, ))1766 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='StateLabelType'):1767 if self.Position is not None and 'Position' not in already_processed:1768 already_processed.add('Position')1769 outfile.write(' Position="%s"' % self.gds_format_integer(self.Position, input_name='Position'))1770 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='StateLabelType', fromsubclass_=False, pretty_print=True):1771 pass1772 def to_etree(self, parent_element=None, name_='StateLabelType', mapping_=None, reverse_mapping_=None, nsmap_=None):1773 if parent_element is None:1774 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1775 else:1776 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1777 if self.Position is not None:1778 element.set('Position', self.gds_format_integer(self.Position))1779 if self._hasContent():1780 element.text = self.gds_format_string(self.get_valueOf_())1781 if mapping_ is not None:1782 mapping_[id(self)] = element1783 if reverse_mapping_ is not None:1784 reverse_mapping_[element] = self1785 return element1786 def build(self, node, gds_collector_=None):1787 self.gds_collector_ = gds_collector_1788 if SaveElementTreeNode:1789 self.gds_elementtree_node_ = node1790 already_processed = set()1791 self.ns_prefix_ = node.prefix1792 self._buildAttributes(node, node.attrib, already_processed)1793 self.valueOf_ = get_all_text_(node)1794 for child in node:1795 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1796 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1797 return self1798 def _buildAttributes(self, node, attrs, already_processed):1799 value = find_attr_value_('Position', node)1800 if value is not None and 'Position' not in already_processed:1801 already_processed.add('Position')1802 self.Position = self.gds_parse_integer(value, node, 'Position')1803 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1804 pass1805# end class StateLabelType1806class NonZeroElementsType(GeneratedsSuper):1807 __hash__ = GeneratedsSuper.__hash__1808 subclass = None1809 superclass = None1810 def __init__(self, Number=None, NonZeroCoordinates=None, gds_collector_=None, **kwargs_):1811 self.gds_collector_ = gds_collector_1812 self.gds_elementtree_node_ = None1813 self.original_tagname_ = None1814 self.parent_object_ = kwargs_.get('parent_object_')1815 self.ns_prefix_ = None1816 self.Number = Number1817 self.Number_nsprefix_ = None1818 self.NonZeroCoordinates = NonZeroCoordinates1819 self.NonZeroCoordinates_nsprefix_ = None1820 def factory(*args_, **kwargs_):1821 if CurrentSubclassModule_ is not None:1822 subclass = getSubclassFromModule_(1823 CurrentSubclassModule_, NonZeroElementsType)1824 if subclass is not None:1825 return subclass(*args_, **kwargs_)1826 if NonZeroElementsType.subclass:1827 return NonZeroElementsType.subclass(*args_, **kwargs_)1828 else:1829 return NonZeroElementsType(*args_, **kwargs_)1830 factory = staticmethod(factory)1831 def get_ns_prefix_(self):1832 return self.ns_prefix_1833 def set_ns_prefix_(self, ns_prefix):1834 self.ns_prefix_ = ns_prefix1835 def get_Number(self):1836 return self.Number1837 def set_Number(self, Number):1838 self.Number = Number1839 def get_NonZeroCoordinates(self):1840 return self.NonZeroCoordinates1841 def set_NonZeroCoordinates(self, NonZeroCoordinates):1842 self.NonZeroCoordinates = NonZeroCoordinates1843 def _hasContent(self):1844 if (1845 self.Number is not None or1846 self.NonZeroCoordinates is not None1847 ):1848 return True1849 else:1850 return False1851 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroElementsType', pretty_print=True):1852 imported_ns_def_ = GenerateDSNamespaceDefs_.get('NonZeroElementsType')1853 if imported_ns_def_ is not None:1854 namespacedef_ = imported_ns_def_1855 if pretty_print:1856 eol_ = '\n'1857 else:1858 eol_ = ''1859 if self.original_tagname_ is not None and name_ == 'NonZeroElementsType':1860 name_ = self.original_tagname_1861 if UseCapturedNS_ and self.ns_prefix_:1862 namespaceprefix_ = self.ns_prefix_ + ':'1863 showIndent(outfile, level, pretty_print)1864 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1865 already_processed = set()1866 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='NonZeroElementsType')1867 if self._hasContent():1868 outfile.write('>%s' % (eol_, ))1869 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='NonZeroElementsType', pretty_print=pretty_print)1870 showIndent(outfile, level, pretty_print)1871 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1872 else:1873 outfile.write('/>%s' % (eol_, ))1874 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='NonZeroElementsType'):1875 pass1876 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroElementsType', fromsubclass_=False, pretty_print=True):1877 if pretty_print:1878 eol_ = '\n'1879 else:1880 eol_ = ''1881 if self.Number is not None:1882 namespaceprefix_ = self.Number_nsprefix_ + ':' if (UseCapturedNS_ and self.Number_nsprefix_) else ''1883 showIndent(outfile, level, pretty_print)1884 outfile.write('<%sNumber>%s</%sNumber>%s' % (namespaceprefix_ , self.gds_format_integer(self.Number, input_name='Number'), namespaceprefix_ , eol_))1885 if self.NonZeroCoordinates is not None:1886 namespaceprefix_ = self.NonZeroCoordinates_nsprefix_ + ':' if (UseCapturedNS_ and self.NonZeroCoordinates_nsprefix_) else ''1887 self.NonZeroCoordinates.export(outfile, level, namespaceprefix_, namespacedef_='', name_='NonZeroCoordinates', pretty_print=pretty_print)1888 def to_etree(self, parent_element=None, name_='NonZeroElementsType', mapping_=None, reverse_mapping_=None, nsmap_=None):1889 if parent_element is None:1890 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1891 else:1892 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)1893 if self.Number is not None:1894 Number_ = self.Number1895 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Number').text = self.gds_format_integer(Number_)1896 if self.NonZeroCoordinates is not None:1897 NonZeroCoordinates_ = self.NonZeroCoordinates1898 NonZeroCoordinates_.to_etree(element, name_='NonZeroCoordinates', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)1899 if mapping_ is not None:1900 mapping_[id(self)] = element1901 if reverse_mapping_ is not None:1902 reverse_mapping_[element] = self1903 return element1904 def build(self, node, gds_collector_=None):1905 self.gds_collector_ = gds_collector_1906 if SaveElementTreeNode:1907 self.gds_elementtree_node_ = node1908 already_processed = set()1909 self.ns_prefix_ = node.prefix1910 self._buildAttributes(node, node.attrib, already_processed)1911 for child in node:1912 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1913 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1914 return self1915 def _buildAttributes(self, node, attrs, already_processed):1916 pass1917 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1918 if nodeName_ == 'Number' and child_.text:1919 sval_ = child_.text1920 ival_ = self.gds_parse_integer(sval_, node, 'Number')1921 ival_ = self.gds_validate_integer(ival_, node, 'Number')1922 self.Number = ival_1923 self.Number_nsprefix_ = child_.prefix1924 elif nodeName_ == 'NonZeroCoordinates':1925 obj_ = NonZeroCoordinatesType.factory(parent_object_=self)1926 obj_.build(child_, gds_collector_=gds_collector_)1927 self.NonZeroCoordinates = obj_1928 obj_.original_tagname_ = 'NonZeroCoordinates'1929# end class NonZeroElementsType1930class NonZeroCoordinatesType(GeneratedsSuper):1931 __hash__ = GeneratedsSuper.__hash__1932 subclass = None1933 superclass = None1934 def __init__(self, NonZeroCoordinate=None, gds_collector_=None, **kwargs_):1935 self.gds_collector_ = gds_collector_1936 self.gds_elementtree_node_ = None1937 self.original_tagname_ = None1938 self.parent_object_ = kwargs_.get('parent_object_')1939 self.ns_prefix_ = None1940 if NonZeroCoordinate is None:1941 self.NonZeroCoordinate = []1942 else:1943 self.NonZeroCoordinate = NonZeroCoordinate1944 self.NonZeroCoordinate_nsprefix_ = None1945 def factory(*args_, **kwargs_):1946 if CurrentSubclassModule_ is not None:1947 subclass = getSubclassFromModule_(1948 CurrentSubclassModule_, NonZeroCoordinatesType)1949 if subclass is not None:1950 return subclass(*args_, **kwargs_)1951 if NonZeroCoordinatesType.subclass:1952 return NonZeroCoordinatesType.subclass(*args_, **kwargs_)1953 else:1954 return NonZeroCoordinatesType(*args_, **kwargs_)1955 factory = staticmethod(factory)1956 def get_ns_prefix_(self):1957 return self.ns_prefix_1958 def set_ns_prefix_(self, ns_prefix):1959 self.ns_prefix_ = ns_prefix1960 def get_NonZeroCoordinate(self):1961 return self.NonZeroCoordinate1962 def set_NonZeroCoordinate(self, NonZeroCoordinate):1963 self.NonZeroCoordinate = NonZeroCoordinate1964 def add_NonZeroCoordinate(self, value):1965 self.NonZeroCoordinate.append(value)1966 def insert_NonZeroCoordinate_at(self, index, value):1967 self.NonZeroCoordinate.insert(index, value)1968 def replace_NonZeroCoordinate_at(self, index, value):1969 self.NonZeroCoordinate[index] = value1970 def _hasContent(self):1971 if (1972 self.NonZeroCoordinate1973 ):1974 return True1975 else:1976 return False1977 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroCoordinatesType', pretty_print=True):1978 imported_ns_def_ = GenerateDSNamespaceDefs_.get('NonZeroCoordinatesType')1979 if imported_ns_def_ is not None:1980 namespacedef_ = imported_ns_def_1981 if pretty_print:1982 eol_ = '\n'1983 else:1984 eol_ = ''1985 if self.original_tagname_ is not None and name_ == 'NonZeroCoordinatesType':1986 name_ = self.original_tagname_1987 if UseCapturedNS_ and self.ns_prefix_:1988 namespaceprefix_ = self.ns_prefix_ + ':'1989 showIndent(outfile, level, pretty_print)1990 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1991 already_processed = set()1992 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='NonZeroCoordinatesType')1993 if self._hasContent():1994 outfile.write('>%s' % (eol_, ))1995 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='NonZeroCoordinatesType', pretty_print=pretty_print)1996 showIndent(outfile, level, pretty_print)1997 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1998 else:1999 outfile.write('/>%s' % (eol_, ))2000 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='NonZeroCoordinatesType'):2001 pass2002 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroCoordinatesType', fromsubclass_=False, pretty_print=True):2003 if pretty_print:2004 eol_ = '\n'2005 else:2006 eol_ = ''2007 for NonZeroCoordinate_ in self.NonZeroCoordinate:2008 namespaceprefix_ = self.NonZeroCoordinate_nsprefix_ + ':' if (UseCapturedNS_ and self.NonZeroCoordinate_nsprefix_) else ''2009 NonZeroCoordinate_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='NonZeroCoordinate', pretty_print=pretty_print)2010 def to_etree(self, parent_element=None, name_='NonZeroCoordinatesType', mapping_=None, reverse_mapping_=None, nsmap_=None):2011 if parent_element is None:2012 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2013 else:2014 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2015 for NonZeroCoordinate_ in self.NonZeroCoordinate:2016 NonZeroCoordinate_.to_etree(element, name_='NonZeroCoordinate', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)2017 if mapping_ is not None:2018 mapping_[id(self)] = element2019 if reverse_mapping_ is not None:2020 reverse_mapping_[element] = self2021 return element2022 def build(self, node, gds_collector_=None):2023 self.gds_collector_ = gds_collector_2024 if SaveElementTreeNode:2025 self.gds_elementtree_node_ = node2026 already_processed = set()2027 self.ns_prefix_ = node.prefix2028 self._buildAttributes(node, node.attrib, already_processed)2029 for child in node:2030 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2031 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)2032 return self2033 def _buildAttributes(self, node, attrs, already_processed):2034 pass2035 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):2036 if nodeName_ == 'NonZeroCoordinate':2037 obj_ = NonZeroCoordinateType.factory(parent_object_=self)2038 obj_.build(child_, gds_collector_=gds_collector_)2039 self.NonZeroCoordinate.append(obj_)2040 obj_.original_tagname_ = 'NonZeroCoordinate'2041# end class NonZeroCoordinatesType2042class NonZeroCoordinateType(GeneratedsSuper):2043 __hash__ = GeneratedsSuper.__hash__2044 subclass = None2045 superclass = None2046 def __init__(self, Position=None, I=None, J=None, gds_collector_=None, **kwargs_):2047 self.gds_collector_ = gds_collector_2048 self.gds_elementtree_node_ = None2049 self.original_tagname_ = None2050 self.parent_object_ = kwargs_.get('parent_object_')2051 self.ns_prefix_ = None2052 self.Position = _cast(int, Position)2053 self.Position_nsprefix_ = None2054 self.I = I2055 self.I_nsprefix_ = None2056 self.J = J2057 self.J_nsprefix_ = None2058 def factory(*args_, **kwargs_):2059 if CurrentSubclassModule_ is not None:2060 subclass = getSubclassFromModule_(2061 CurrentSubclassModule_, NonZeroCoordinateType)2062 if subclass is not None:2063 return subclass(*args_, **kwargs_)2064 if NonZeroCoordinateType.subclass:2065 return NonZeroCoordinateType.subclass(*args_, **kwargs_)2066 else:2067 return NonZeroCoordinateType(*args_, **kwargs_)2068 factory = staticmethod(factory)2069 def get_ns_prefix_(self):2070 return self.ns_prefix_2071 def set_ns_prefix_(self, ns_prefix):2072 self.ns_prefix_ = ns_prefix2073 def get_I(self):2074 return self.I2075 def set_I(self, I):2076 self.I = I2077 def get_J(self):2078 return self.J2079 def set_J(self, J):2080 self.J = J2081 def get_Position(self):2082 return self.Position2083 def set_Position(self, Position):2084 self.Position = Position2085 def _hasContent(self):2086 if (2087 self.I is not None or2088 self.J is not None2089 ):2090 return True2091 else:2092 return False2093 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroCoordinateType', pretty_print=True):2094 imported_ns_def_ = GenerateDSNamespaceDefs_.get('NonZeroCoordinateType')2095 if imported_ns_def_ is not None:2096 namespacedef_ = imported_ns_def_2097 if pretty_print:2098 eol_ = '\n'2099 else:2100 eol_ = ''2101 if self.original_tagname_ is not None and name_ == 'NonZeroCoordinateType':2102 name_ = self.original_tagname_2103 if UseCapturedNS_ and self.ns_prefix_:2104 namespaceprefix_ = self.ns_prefix_ + ':'2105 showIndent(outfile, level, pretty_print)2106 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2107 already_processed = set()2108 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='NonZeroCoordinateType')2109 if self._hasContent():2110 outfile.write('>%s' % (eol_, ))2111 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='NonZeroCoordinateType', pretty_print=pretty_print)2112 showIndent(outfile, level, pretty_print)2113 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))2114 else:2115 outfile.write('/>%s' % (eol_, ))2116 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='NonZeroCoordinateType'):2117 if self.Position is not None and 'Position' not in already_processed:2118 already_processed.add('Position')2119 outfile.write(' Position="%s"' % self.gds_format_integer(self.Position, input_name='Position'))2120 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='NonZeroCoordinateType', fromsubclass_=False, pretty_print=True):2121 if pretty_print:2122 eol_ = '\n'2123 else:2124 eol_ = ''2125 if self.I is not None:2126 namespaceprefix_ = self.I_nsprefix_ + ':' if (UseCapturedNS_ and self.I_nsprefix_) else ''2127 showIndent(outfile, level, pretty_print)2128 outfile.write('<%sI>%s</%sI>%s' % (namespaceprefix_ , self.gds_format_integer(self.I, input_name='I'), namespaceprefix_ , eol_))2129 if self.J is not None:2130 namespaceprefix_ = self.J_nsprefix_ + ':' if (UseCapturedNS_ and self.J_nsprefix_) else ''2131 showIndent(outfile, level, pretty_print)2132 outfile.write('<%sJ>%s</%sJ>%s' % (namespaceprefix_ , self.gds_format_integer(self.J, input_name='J'), namespaceprefix_ , eol_))2133 def to_etree(self, parent_element=None, name_='NonZeroCoordinateType', mapping_=None, reverse_mapping_=None, nsmap_=None):2134 if parent_element is None:2135 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2136 else:2137 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2138 if self.Position is not None:2139 element.set('Position', self.gds_format_integer(self.Position))2140 if self.I is not None:2141 I_ = self.I2142 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}I').text = self.gds_format_integer(I_)2143 if self.J is not None:2144 J_ = self.J2145 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}J').text = self.gds_format_integer(J_)2146 if mapping_ is not None:2147 mapping_[id(self)] = element2148 if reverse_mapping_ is not None:2149 reverse_mapping_[element] = self2150 return element2151 def build(self, node, gds_collector_=None):2152 self.gds_collector_ = gds_collector_2153 if SaveElementTreeNode:2154 self.gds_elementtree_node_ = node2155 already_processed = set()2156 self.ns_prefix_ = node.prefix2157 self._buildAttributes(node, node.attrib, already_processed)2158 for child in node:2159 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2160 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)2161 return self2162 def _buildAttributes(self, node, attrs, already_processed):2163 value = find_attr_value_('Position', node)2164 if value is not None and 'Position' not in already_processed:2165 already_processed.add('Position')2166 self.Position = self.gds_parse_integer(value, node, 'Position')2167 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):2168 if nodeName_ == 'I' and child_.text:2169 sval_ = child_.text2170 ival_ = self.gds_parse_integer(sval_, node, 'I')2171 ival_ = self.gds_validate_integer(ival_, node, 'I')2172 self.I = ival_2173 self.I_nsprefix_ = child_.prefix2174 elif nodeName_ == 'J' and child_.text:2175 sval_ = child_.text2176 ival_ = self.gds_parse_integer(sval_, node, 'J')2177 ival_ = self.gds_validate_integer(ival_, node, 'J')2178 self.J = ival_2179 self.J_nsprefix_ = child_.prefix2180# end class NonZeroCoordinateType2181class MDataType(GeneratedsSuper):2182 __hash__ = GeneratedsSuper.__hash__2183 subclass = None2184 superclass = None2185 def __init__(self, Row=None, Axis1=None, Axis2=None, Axis3=None, Axis4=None, Col1=None, Col2=None, Col3=None, Col4=None, Col5=None, Col6=None, Col7=None, Col8=None, Col9=None, Col10=None, Col11=None, Col12=None, Col13=None, Col14=None, Col15=None, Col16=None, Col17=None, Col18=None, Col19=None, Col20=None, Col21=None, Col22=None, Col23=None, Col24=None, Col25=None, Col26=None, Col27=None, Col28=None, Col29=None, Col30=None, Col31=None, Col32=None, Col33=None, Col34=None, Col35=None, Col36=None, Col37=None, Col38=None, Col39=None, Col40=None, Col41=None, Col42=None, Col43=None, Col44=None, Col45=None, Col46=None, Col47=None, Col48=None, Col49=None, Col50=None, Col51=None, Col52=None, Col53=None, Col54=None, Col55=None, Col56=None, Col57=None, Col58=None, Col59=None, Col60=None, Col61=None, Col62=None, Col63=None, Col64=None, gds_collector_=None, **kwargs_):2186 self.gds_collector_ = gds_collector_2187 self.gds_elementtree_node_ = None2188 self.original_tagname_ = None2189 self.parent_object_ = kwargs_.get('parent_object_')2190 self.ns_prefix_ = None2191 self.Row = _cast(int, Row)2192 self.Row_nsprefix_ = None2193 self.Axis1 = _cast(int, Axis1)2194 self.Axis1_nsprefix_ = None2195 self.Axis2 = _cast(int, Axis2)2196 self.Axis2_nsprefix_ = None2197 self.Axis3 = _cast(int, Axis3)2198 self.Axis3_nsprefix_ = None2199 self.Axis4 = _cast(int, Axis4)2200 self.Axis4_nsprefix_ = None2201 self.Col1 = Col12202 self.Col1_nsprefix_ = None2203 self.Col2 = Col22204 self.Col2_nsprefix_ = None2205 self.Col3 = Col32206 self.Col3_nsprefix_ = None2207 self.Col4 = Col42208 self.Col4_nsprefix_ = None2209 self.Col5 = Col52210 self.Col5_nsprefix_ = None2211 self.Col6 = Col62212 self.Col6_nsprefix_ = None2213 self.Col7 = Col72214 self.Col7_nsprefix_ = None2215 self.Col8 = Col82216 self.Col8_nsprefix_ = None2217 self.Col9 = Col92218 self.Col9_nsprefix_ = None2219 self.Col10 = Col102220 self.Col10_nsprefix_ = None2221 self.Col11 = Col112222 self.Col11_nsprefix_ = None2223 self.Col12 = Col122224 self.Col12_nsprefix_ = None2225 self.Col13 = Col132226 self.Col13_nsprefix_ = None2227 self.Col14 = Col142228 self.Col14_nsprefix_ = None2229 self.Col15 = Col152230 self.Col15_nsprefix_ = None2231 self.Col16 = Col162232 self.Col16_nsprefix_ = None2233 self.Col17 = Col172234 self.Col17_nsprefix_ = None2235 self.Col18 = Col182236 self.Col18_nsprefix_ = None2237 self.Col19 = Col192238 self.Col19_nsprefix_ = None2239 self.Col20 = Col202240 self.Col20_nsprefix_ = None2241 self.Col21 = Col212242 self.Col21_nsprefix_ = None2243 self.Col22 = Col222244 self.Col22_nsprefix_ = None2245 self.Col23 = Col232246 self.Col23_nsprefix_ = None2247 self.Col24 = Col242248 self.Col24_nsprefix_ = None2249 self.Col25 = Col252250 self.Col25_nsprefix_ = None2251 self.Col26 = Col262252 self.Col26_nsprefix_ = None2253 self.Col27 = Col272254 self.Col27_nsprefix_ = None2255 self.Col28 = Col282256 self.Col28_nsprefix_ = None2257 self.Col29 = Col292258 self.Col29_nsprefix_ = None2259 self.Col30 = Col302260 self.Col30_nsprefix_ = None2261 self.Col31 = Col312262 self.Col31_nsprefix_ = None2263 self.Col32 = Col322264 self.Col32_nsprefix_ = None2265 self.Col33 = Col332266 self.Col33_nsprefix_ = None2267 self.Col34 = Col342268 self.Col34_nsprefix_ = None2269 self.Col35 = Col352270 self.Col35_nsprefix_ = None2271 self.Col36 = Col362272 self.Col36_nsprefix_ = None2273 self.Col37 = Col372274 self.Col37_nsprefix_ = None2275 self.Col38 = Col382276 self.Col38_nsprefix_ = None2277 self.Col39 = Col392278 self.Col39_nsprefix_ = None2279 self.Col40 = Col402280 self.Col40_nsprefix_ = None2281 self.Col41 = Col412282 self.Col41_nsprefix_ = None2283 self.Col42 = Col422284 self.Col42_nsprefix_ = None2285 self.Col43 = Col432286 self.Col43_nsprefix_ = None2287 self.Col44 = Col442288 self.Col44_nsprefix_ = None2289 self.Col45 = Col452290 self.Col45_nsprefix_ = None2291 self.Col46 = Col462292 self.Col46_nsprefix_ = None2293 self.Col47 = Col472294 self.Col47_nsprefix_ = None2295 self.Col48 = Col482296 self.Col48_nsprefix_ = None2297 self.Col49 = Col492298 self.Col49_nsprefix_ = None2299 self.Col50 = Col502300 self.Col50_nsprefix_ = None2301 self.Col51 = Col512302 self.Col51_nsprefix_ = None2303 self.Col52 = Col522304 self.Col52_nsprefix_ = None2305 self.Col53 = Col532306 self.Col53_nsprefix_ = None2307 self.Col54 = Col542308 self.Col54_nsprefix_ = None2309 self.Col55 = Col552310 self.Col55_nsprefix_ = None2311 self.Col56 = Col562312 self.Col56_nsprefix_ = None2313 self.Col57 = Col572314 self.Col57_nsprefix_ = None2315 self.Col58 = Col582316 self.Col58_nsprefix_ = None2317 self.Col59 = Col592318 self.Col59_nsprefix_ = None2319 self.Col60 = Col602320 self.Col60_nsprefix_ = None2321 self.Col61 = Col612322 self.Col61_nsprefix_ = None2323 self.Col62 = Col622324 self.Col62_nsprefix_ = None2325 self.Col63 = Col632326 self.Col63_nsprefix_ = None2327 self.Col64 = Col642328 self.Col64_nsprefix_ = None2329 def factory(*args_, **kwargs_):2330 if CurrentSubclassModule_ is not None:2331 subclass = getSubclassFromModule_(2332 CurrentSubclassModule_, MDataType)2333 if subclass is not None:2334 return subclass(*args_, **kwargs_)2335 if MDataType.subclass:2336 return MDataType.subclass(*args_, **kwargs_)2337 else:2338 return MDataType(*args_, **kwargs_)2339 factory = staticmethod(factory)2340 def get_ns_prefix_(self):2341 return self.ns_prefix_2342 def set_ns_prefix_(self, ns_prefix):2343 self.ns_prefix_ = ns_prefix2344 def get_Col1(self):2345 return self.Col12346 def set_Col1(self, Col1):2347 self.Col1 = Col12348 def get_Col2(self):2349 return self.Col22350 def set_Col2(self, Col2):2351 self.Col2 = Col22352 def get_Col3(self):2353 return self.Col32354 def set_Col3(self, Col3):2355 self.Col3 = Col32356 def get_Col4(self):2357 return self.Col42358 def set_Col4(self, Col4):2359 self.Col4 = Col42360 def get_Col5(self):2361 return self.Col52362 def set_Col5(self, Col5):2363 self.Col5 = Col52364 def get_Col6(self):2365 return self.Col62366 def set_Col6(self, Col6):2367 self.Col6 = Col62368 def get_Col7(self):2369 return self.Col72370 def set_Col7(self, Col7):2371 self.Col7 = Col72372 def get_Col8(self):2373 return self.Col82374 def set_Col8(self, Col8):2375 self.Col8 = Col82376 def get_Col9(self):2377 return self.Col92378 def set_Col9(self, Col9):2379 self.Col9 = Col92380 def get_Col10(self):2381 return self.Col102382 def set_Col10(self, Col10):2383 self.Col10 = Col102384 def get_Col11(self):2385 return self.Col112386 def set_Col11(self, Col11):2387 self.Col11 = Col112388 def get_Col12(self):2389 return self.Col122390 def set_Col12(self, Col12):2391 self.Col12 = Col122392 def get_Col13(self):2393 return self.Col132394 def set_Col13(self, Col13):2395 self.Col13 = Col132396 def get_Col14(self):2397 return self.Col142398 def set_Col14(self, Col14):2399 self.Col14 = Col142400 def get_Col15(self):2401 return self.Col152402 def set_Col15(self, Col15):2403 self.Col15 = Col152404 def get_Col16(self):2405 return self.Col162406 def set_Col16(self, Col16):2407 self.Col16 = Col162408 def get_Col17(self):2409 return self.Col172410 def set_Col17(self, Col17):2411 self.Col17 = Col172412 def get_Col18(self):2413 return self.Col182414 def set_Col18(self, Col18):2415 self.Col18 = Col182416 def get_Col19(self):2417 return self.Col192418 def set_Col19(self, Col19):2419 self.Col19 = Col192420 def get_Col20(self):2421 return self.Col202422 def set_Col20(self, Col20):2423 self.Col20 = Col202424 def get_Col21(self):2425 return self.Col212426 def set_Col21(self, Col21):2427 self.Col21 = Col212428 def get_Col22(self):2429 return self.Col222430 def set_Col22(self, Col22):2431 self.Col22 = Col222432 def get_Col23(self):2433 return self.Col232434 def set_Col23(self, Col23):2435 self.Col23 = Col232436 def get_Col24(self):2437 return self.Col242438 def set_Col24(self, Col24):2439 self.Col24 = Col242440 def get_Col25(self):2441 return self.Col252442 def set_Col25(self, Col25):2443 self.Col25 = Col252444 def get_Col26(self):2445 return self.Col262446 def set_Col26(self, Col26):2447 self.Col26 = Col262448 def get_Col27(self):2449 return self.Col272450 def set_Col27(self, Col27):2451 self.Col27 = Col272452 def get_Col28(self):2453 return self.Col282454 def set_Col28(self, Col28):2455 self.Col28 = Col282456 def get_Col29(self):2457 return self.Col292458 def set_Col29(self, Col29):2459 self.Col29 = Col292460 def get_Col30(self):2461 return self.Col302462 def set_Col30(self, Col30):2463 self.Col30 = Col302464 def get_Col31(self):2465 return self.Col312466 def set_Col31(self, Col31):2467 self.Col31 = Col312468 def get_Col32(self):2469 return self.Col322470 def set_Col32(self, Col32):2471 self.Col32 = Col322472 def get_Col33(self):2473 return self.Col332474 def set_Col33(self, Col33):2475 self.Col33 = Col332476 def get_Col34(self):2477 return self.Col342478 def set_Col34(self, Col34):2479 self.Col34 = Col342480 def get_Col35(self):2481 return self.Col352482 def set_Col35(self, Col35):2483 self.Col35 = Col352484 def get_Col36(self):2485 return self.Col362486 def set_Col36(self, Col36):2487 self.Col36 = Col362488 def get_Col37(self):2489 return self.Col372490 def set_Col37(self, Col37):2491 self.Col37 = Col372492 def get_Col38(self):2493 return self.Col382494 def set_Col38(self, Col38):2495 self.Col38 = Col382496 def get_Col39(self):2497 return self.Col392498 def set_Col39(self, Col39):2499 self.Col39 = Col392500 def get_Col40(self):2501 return self.Col402502 def set_Col40(self, Col40):2503 self.Col40 = Col402504 def get_Col41(self):2505 return self.Col412506 def set_Col41(self, Col41):2507 self.Col41 = Col412508 def get_Col42(self):2509 return self.Col422510 def set_Col42(self, Col42):2511 self.Col42 = Col422512 def get_Col43(self):2513 return self.Col432514 def set_Col43(self, Col43):2515 self.Col43 = Col432516 def get_Col44(self):2517 return self.Col442518 def set_Col44(self, Col44):2519 self.Col44 = Col442520 def get_Col45(self):2521 return self.Col452522 def set_Col45(self, Col45):2523 self.Col45 = Col452524 def get_Col46(self):2525 return self.Col462526 def set_Col46(self, Col46):2527 self.Col46 = Col462528 def get_Col47(self):2529 return self.Col472530 def set_Col47(self, Col47):2531 self.Col47 = Col472532 def get_Col48(self):2533 return self.Col482534 def set_Col48(self, Col48):2535 self.Col48 = Col482536 def get_Col49(self):2537 return self.Col492538 def set_Col49(self, Col49):2539 self.Col49 = Col492540 def get_Col50(self):2541 return self.Col502542 def set_Col50(self, Col50):2543 self.Col50 = Col502544 def get_Col51(self):2545 return self.Col512546 def set_Col51(self, Col51):2547 self.Col51 = Col512548 def get_Col52(self):2549 return self.Col522550 def set_Col52(self, Col52):2551 self.Col52 = Col522552 def get_Col53(self):2553 return self.Col532554 def set_Col53(self, Col53):2555 self.Col53 = Col532556 def get_Col54(self):2557 return self.Col542558 def set_Col54(self, Col54):2559 self.Col54 = Col542560 def get_Col55(self):2561 return self.Col552562 def set_Col55(self, Col55):2563 self.Col55 = Col552564 def get_Col56(self):2565 return self.Col562566 def set_Col56(self, Col56):2567 self.Col56 = Col562568 def get_Col57(self):2569 return self.Col572570 def set_Col57(self, Col57):2571 self.Col57 = Col572572 def get_Col58(self):2573 return self.Col582574 def set_Col58(self, Col58):2575 self.Col58 = Col582576 def get_Col59(self):2577 return self.Col592578 def set_Col59(self, Col59):2579 self.Col59 = Col592580 def get_Col60(self):2581 return self.Col602582 def set_Col60(self, Col60):2583 self.Col60 = Col602584 def get_Col61(self):2585 return self.Col612586 def set_Col61(self, Col61):2587 self.Col61 = Col612588 def get_Col62(self):2589 return self.Col622590 def set_Col62(self, Col62):2591 self.Col62 = Col622592 def get_Col63(self):2593 return self.Col632594 def set_Col63(self, Col63):2595 self.Col63 = Col632596 def get_Col64(self):2597 return self.Col642598 def set_Col64(self, Col64):2599 self.Col64 = Col642600 def get_Row(self):2601 return self.Row2602 def set_Row(self, Row):2603 self.Row = Row2604 def get_Axis1(self):2605 return self.Axis12606 def set_Axis1(self, Axis1):2607 self.Axis1 = Axis12608 def get_Axis2(self):2609 return self.Axis22610 def set_Axis2(self, Axis2):2611 self.Axis2 = Axis22612 def get_Axis3(self):2613 return self.Axis32614 def set_Axis3(self, Axis3):2615 self.Axis3 = Axis32616 def get_Axis4(self):2617 return self.Axis42618 def set_Axis4(self, Axis4):2619 self.Axis4 = Axis42620 def _hasContent(self):2621 if (2622 self.Col1 is not None or2623 self.Col2 is not None or2624 self.Col3 is not None or2625 self.Col4 is not None or2626 self.Col5 is not None or2627 self.Col6 is not None or2628 self.Col7 is not None or2629 self.Col8 is not None or2630 self.Col9 is not None or2631 self.Col10 is not None or2632 self.Col11 is not None or2633 self.Col12 is not None or2634 self.Col13 is not None or2635 self.Col14 is not None or2636 self.Col15 is not None or2637 self.Col16 is not None or2638 self.Col17 is not None or2639 self.Col18 is not None or2640 self.Col19 is not None or2641 self.Col20 is not None or2642 self.Col21 is not None or2643 self.Col22 is not None or2644 self.Col23 is not None or2645 self.Col24 is not None or2646 self.Col25 is not None or2647 self.Col26 is not None or2648 self.Col27 is not None or2649 self.Col28 is not None or2650 self.Col29 is not None or2651 self.Col30 is not None or2652 self.Col31 is not None or2653 self.Col32 is not None or2654 self.Col33 is not None or2655 self.Col34 is not None or2656 self.Col35 is not None or2657 self.Col36 is not None or2658 self.Col37 is not None or2659 self.Col38 is not None or2660 self.Col39 is not None or2661 self.Col40 is not None or2662 self.Col41 is not None or2663 self.Col42 is not None or2664 self.Col43 is not None or2665 self.Col44 is not None or2666 self.Col45 is not None or2667 self.Col46 is not None or2668 self.Col47 is not None or2669 self.Col48 is not None or2670 self.Col49 is not None or2671 self.Col50 is not None or2672 self.Col51 is not None or2673 self.Col52 is not None or2674 self.Col53 is not None or2675 self.Col54 is not None or2676 self.Col55 is not None or2677 self.Col56 is not None or2678 self.Col57 is not None or2679 self.Col58 is not None or2680 self.Col59 is not None or2681 self.Col60 is not None or2682 self.Col61 is not None or2683 self.Col62 is not None or2684 self.Col63 is not None or2685 self.Col64 is not None2686 ):2687 return True2688 else:2689 return False2690 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='MDataType', pretty_print=True):2691 imported_ns_def_ = GenerateDSNamespaceDefs_.get('MDataType')2692 if imported_ns_def_ is not None:2693 namespacedef_ = imported_ns_def_2694 if pretty_print:2695 eol_ = '\n'2696 else:2697 eol_ = ''2698 if self.original_tagname_ is not None and name_ == 'MDataType':2699 name_ = self.original_tagname_2700 if UseCapturedNS_ and self.ns_prefix_:2701 namespaceprefix_ = self.ns_prefix_ + ':'2702 showIndent(outfile, level, pretty_print)2703 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2704 already_processed = set()2705 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='MDataType')2706 if self._hasContent():2707 outfile.write('>%s' % (eol_, ))2708 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='MDataType', pretty_print=pretty_print)2709 showIndent(outfile, level, pretty_print)2710 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))2711 else:2712 outfile.write('/>%s' % (eol_, ))2713 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='MDataType'):2714 if self.Row is not None and 'Row' not in already_processed:2715 already_processed.add('Row')2716 outfile.write(' Row="%s"' % self.gds_format_integer(self.Row, input_name='Row'))2717 if self.Axis1 is not None and 'Axis1' not in already_processed:2718 already_processed.add('Axis1')2719 outfile.write(' Axis1="%s"' % self.gds_format_integer(self.Axis1, input_name='Axis1'))2720 if self.Axis2 is not None and 'Axis2' not in already_processed:2721 already_processed.add('Axis2')2722 outfile.write(' Axis2="%s"' % self.gds_format_integer(self.Axis2, input_name='Axis2'))2723 if self.Axis3 is not None and 'Axis3' not in already_processed:2724 already_processed.add('Axis3')2725 outfile.write(' Axis3="%s"' % self.gds_format_integer(self.Axis3, input_name='Axis3'))2726 if self.Axis4 is not None and 'Axis4' not in already_processed:2727 already_processed.add('Axis4')2728 outfile.write(' Axis4="%s"' % self.gds_format_integer(self.Axis4, input_name='Axis4'))2729 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='MDataType', fromsubclass_=False, pretty_print=True):2730 if pretty_print:2731 eol_ = '\n'2732 else:2733 eol_ = ''2734 if self.Col1 is not None:2735 namespaceprefix_ = self.Col1_nsprefix_ + ':' if (UseCapturedNS_ and self.Col1_nsprefix_) else ''2736 showIndent(outfile, level, pretty_print)2737 outfile.write('<%sCol1>%s</%sCol1>%s' % (namespaceprefix_ , self.gds_format_double(self.Col1, input_name='Col1'), namespaceprefix_ , eol_))2738 if self.Col2 is not None:2739 namespaceprefix_ = self.Col2_nsprefix_ + ':' if (UseCapturedNS_ and self.Col2_nsprefix_) else ''2740 showIndent(outfile, level, pretty_print)2741 outfile.write('<%sCol2>%s</%sCol2>%s' % (namespaceprefix_ , self.gds_format_double(self.Col2, input_name='Col2'), namespaceprefix_ , eol_))2742 if self.Col3 is not None:2743 namespaceprefix_ = self.Col3_nsprefix_ + ':' if (UseCapturedNS_ and self.Col3_nsprefix_) else ''2744 showIndent(outfile, level, pretty_print)2745 outfile.write('<%sCol3>%s</%sCol3>%s' % (namespaceprefix_ , self.gds_format_double(self.Col3, input_name='Col3'), namespaceprefix_ , eol_))2746 if self.Col4 is not None:2747 namespaceprefix_ = self.Col4_nsprefix_ + ':' if (UseCapturedNS_ and self.Col4_nsprefix_) else ''2748 showIndent(outfile, level, pretty_print)2749 outfile.write('<%sCol4>%s</%sCol4>%s' % (namespaceprefix_ , self.gds_format_double(self.Col4, input_name='Col4'), namespaceprefix_ , eol_))2750 if self.Col5 is not None:2751 namespaceprefix_ = self.Col5_nsprefix_ + ':' if (UseCapturedNS_ and self.Col5_nsprefix_) else ''2752 showIndent(outfile, level, pretty_print)2753 outfile.write('<%sCol5>%s</%sCol5>%s' % (namespaceprefix_ , self.gds_format_double(self.Col5, input_name='Col5'), namespaceprefix_ , eol_))2754 if self.Col6 is not None:2755 namespaceprefix_ = self.Col6_nsprefix_ + ':' if (UseCapturedNS_ and self.Col6_nsprefix_) else ''2756 showIndent(outfile, level, pretty_print)2757 outfile.write('<%sCol6>%s</%sCol6>%s' % (namespaceprefix_ , self.gds_format_double(self.Col6, input_name='Col6'), namespaceprefix_ , eol_))2758 if self.Col7 is not None:2759 namespaceprefix_ = self.Col7_nsprefix_ + ':' if (UseCapturedNS_ and self.Col7_nsprefix_) else ''2760 showIndent(outfile, level, pretty_print)2761 outfile.write('<%sCol7>%s</%sCol7>%s' % (namespaceprefix_ , self.gds_format_double(self.Col7, input_name='Col7'), namespaceprefix_ , eol_))2762 if self.Col8 is not None:2763 namespaceprefix_ = self.Col8_nsprefix_ + ':' if (UseCapturedNS_ and self.Col8_nsprefix_) else ''2764 showIndent(outfile, level, pretty_print)2765 outfile.write('<%sCol8>%s</%sCol8>%s' % (namespaceprefix_ , self.gds_format_double(self.Col8, input_name='Col8'), namespaceprefix_ , eol_))2766 if self.Col9 is not None:2767 namespaceprefix_ = self.Col9_nsprefix_ + ':' if (UseCapturedNS_ and self.Col9_nsprefix_) else ''2768 showIndent(outfile, level, pretty_print)2769 outfile.write('<%sCol9>%s</%sCol9>%s' % (namespaceprefix_ , self.gds_format_double(self.Col9, input_name='Col9'), namespaceprefix_ , eol_))2770 if self.Col10 is not None:2771 namespaceprefix_ = self.Col10_nsprefix_ + ':' if (UseCapturedNS_ and self.Col10_nsprefix_) else ''2772 showIndent(outfile, level, pretty_print)2773 outfile.write('<%sCol10>%s</%sCol10>%s' % (namespaceprefix_ , self.gds_format_double(self.Col10, input_name='Col10'), namespaceprefix_ , eol_))2774 if self.Col11 is not None:2775 namespaceprefix_ = self.Col11_nsprefix_ + ':' if (UseCapturedNS_ and self.Col11_nsprefix_) else ''2776 showIndent(outfile, level, pretty_print)2777 outfile.write('<%sCol11>%s</%sCol11>%s' % (namespaceprefix_ , self.gds_format_double(self.Col11, input_name='Col11'), namespaceprefix_ , eol_))2778 if self.Col12 is not None:2779 namespaceprefix_ = self.Col12_nsprefix_ + ':' if (UseCapturedNS_ and self.Col12_nsprefix_) else ''2780 showIndent(outfile, level, pretty_print)2781 outfile.write('<%sCol12>%s</%sCol12>%s' % (namespaceprefix_ , self.gds_format_double(self.Col12, input_name='Col12'), namespaceprefix_ , eol_))2782 if self.Col13 is not None:2783 namespaceprefix_ = self.Col13_nsprefix_ + ':' if (UseCapturedNS_ and self.Col13_nsprefix_) else ''2784 showIndent(outfile, level, pretty_print)2785 outfile.write('<%sCol13>%s</%sCol13>%s' % (namespaceprefix_ , self.gds_format_double(self.Col13, input_name='Col13'), namespaceprefix_ , eol_))2786 if self.Col14 is not None:2787 namespaceprefix_ = self.Col14_nsprefix_ + ':' if (UseCapturedNS_ and self.Col14_nsprefix_) else ''2788 showIndent(outfile, level, pretty_print)2789 outfile.write('<%sCol14>%s</%sCol14>%s' % (namespaceprefix_ , self.gds_format_double(self.Col14, input_name='Col14'), namespaceprefix_ , eol_))2790 if self.Col15 is not None:2791 namespaceprefix_ = self.Col15_nsprefix_ + ':' if (UseCapturedNS_ and self.Col15_nsprefix_) else ''2792 showIndent(outfile, level, pretty_print)2793 outfile.write('<%sCol15>%s</%sCol15>%s' % (namespaceprefix_ , self.gds_format_double(self.Col15, input_name='Col15'), namespaceprefix_ , eol_))2794 if self.Col16 is not None:2795 namespaceprefix_ = self.Col16_nsprefix_ + ':' if (UseCapturedNS_ and self.Col16_nsprefix_) else ''2796 showIndent(outfile, level, pretty_print)2797 outfile.write('<%sCol16>%s</%sCol16>%s' % (namespaceprefix_ , self.gds_format_double(self.Col16, input_name='Col16'), namespaceprefix_ , eol_))2798 if self.Col17 is not None:2799 namespaceprefix_ = self.Col17_nsprefix_ + ':' if (UseCapturedNS_ and self.Col17_nsprefix_) else ''2800 showIndent(outfile, level, pretty_print)2801 outfile.write('<%sCol17>%s</%sCol17>%s' % (namespaceprefix_ , self.gds_format_double(self.Col17, input_name='Col17'), namespaceprefix_ , eol_))2802 if self.Col18 is not None:2803 namespaceprefix_ = self.Col18_nsprefix_ + ':' if (UseCapturedNS_ and self.Col18_nsprefix_) else ''2804 showIndent(outfile, level, pretty_print)2805 outfile.write('<%sCol18>%s</%sCol18>%s' % (namespaceprefix_ , self.gds_format_double(self.Col18, input_name='Col18'), namespaceprefix_ , eol_))2806 if self.Col19 is not None:2807 namespaceprefix_ = self.Col19_nsprefix_ + ':' if (UseCapturedNS_ and self.Col19_nsprefix_) else ''2808 showIndent(outfile, level, pretty_print)2809 outfile.write('<%sCol19>%s</%sCol19>%s' % (namespaceprefix_ , self.gds_format_double(self.Col19, input_name='Col19'), namespaceprefix_ , eol_))2810 if self.Col20 is not None:2811 namespaceprefix_ = self.Col20_nsprefix_ + ':' if (UseCapturedNS_ and self.Col20_nsprefix_) else ''2812 showIndent(outfile, level, pretty_print)2813 outfile.write('<%sCol20>%s</%sCol20>%s' % (namespaceprefix_ , self.gds_format_double(self.Col20, input_name='Col20'), namespaceprefix_ , eol_))2814 if self.Col21 is not None:2815 namespaceprefix_ = self.Col21_nsprefix_ + ':' if (UseCapturedNS_ and self.Col21_nsprefix_) else ''2816 showIndent(outfile, level, pretty_print)2817 outfile.write('<%sCol21>%s</%sCol21>%s' % (namespaceprefix_ , self.gds_format_double(self.Col21, input_name='Col21'), namespaceprefix_ , eol_))2818 if self.Col22 is not None:2819 namespaceprefix_ = self.Col22_nsprefix_ + ':' if (UseCapturedNS_ and self.Col22_nsprefix_) else ''2820 showIndent(outfile, level, pretty_print)2821 outfile.write('<%sCol22>%s</%sCol22>%s' % (namespaceprefix_ , self.gds_format_double(self.Col22, input_name='Col22'), namespaceprefix_ , eol_))2822 if self.Col23 is not None:2823 namespaceprefix_ = self.Col23_nsprefix_ + ':' if (UseCapturedNS_ and self.Col23_nsprefix_) else ''2824 showIndent(outfile, level, pretty_print)2825 outfile.write('<%sCol23>%s</%sCol23>%s' % (namespaceprefix_ , self.gds_format_double(self.Col23, input_name='Col23'), namespaceprefix_ , eol_))2826 if self.Col24 is not None:2827 namespaceprefix_ = self.Col24_nsprefix_ + ':' if (UseCapturedNS_ and self.Col24_nsprefix_) else ''2828 showIndent(outfile, level, pretty_print)2829 outfile.write('<%sCol24>%s</%sCol24>%s' % (namespaceprefix_ , self.gds_format_double(self.Col24, input_name='Col24'), namespaceprefix_ , eol_))2830 if self.Col25 is not None:2831 namespaceprefix_ = self.Col25_nsprefix_ + ':' if (UseCapturedNS_ and self.Col25_nsprefix_) else ''2832 showIndent(outfile, level, pretty_print)2833 outfile.write('<%sCol25>%s</%sCol25>%s' % (namespaceprefix_ , self.gds_format_double(self.Col25, input_name='Col25'), namespaceprefix_ , eol_))2834 if self.Col26 is not None:2835 namespaceprefix_ = self.Col26_nsprefix_ + ':' if (UseCapturedNS_ and self.Col26_nsprefix_) else ''2836 showIndent(outfile, level, pretty_print)2837 outfile.write('<%sCol26>%s</%sCol26>%s' % (namespaceprefix_ , self.gds_format_double(self.Col26, input_name='Col26'), namespaceprefix_ , eol_))2838 if self.Col27 is not None:2839 namespaceprefix_ = self.Col27_nsprefix_ + ':' if (UseCapturedNS_ and self.Col27_nsprefix_) else ''2840 showIndent(outfile, level, pretty_print)2841 outfile.write('<%sCol27>%s</%sCol27>%s' % (namespaceprefix_ , self.gds_format_double(self.Col27, input_name='Col27'), namespaceprefix_ , eol_))2842 if self.Col28 is not None:2843 namespaceprefix_ = self.Col28_nsprefix_ + ':' if (UseCapturedNS_ and self.Col28_nsprefix_) else ''2844 showIndent(outfile, level, pretty_print)2845 outfile.write('<%sCol28>%s</%sCol28>%s' % (namespaceprefix_ , self.gds_format_double(self.Col28, input_name='Col28'), namespaceprefix_ , eol_))2846 if self.Col29 is not None:2847 namespaceprefix_ = self.Col29_nsprefix_ + ':' if (UseCapturedNS_ and self.Col29_nsprefix_) else ''2848 showIndent(outfile, level, pretty_print)2849 outfile.write('<%sCol29>%s</%sCol29>%s' % (namespaceprefix_ , self.gds_format_double(self.Col29, input_name='Col29'), namespaceprefix_ , eol_))2850 if self.Col30 is not None:2851 namespaceprefix_ = self.Col30_nsprefix_ + ':' if (UseCapturedNS_ and self.Col30_nsprefix_) else ''2852 showIndent(outfile, level, pretty_print)2853 outfile.write('<%sCol30>%s</%sCol30>%s' % (namespaceprefix_ , self.gds_format_double(self.Col30, input_name='Col30'), namespaceprefix_ , eol_))2854 if self.Col31 is not None:2855 namespaceprefix_ = self.Col31_nsprefix_ + ':' if (UseCapturedNS_ and self.Col31_nsprefix_) else ''2856 showIndent(outfile, level, pretty_print)2857 outfile.write('<%sCol31>%s</%sCol31>%s' % (namespaceprefix_ , self.gds_format_double(self.Col31, input_name='Col31'), namespaceprefix_ , eol_))2858 if self.Col32 is not None:2859 namespaceprefix_ = self.Col32_nsprefix_ + ':' if (UseCapturedNS_ and self.Col32_nsprefix_) else ''2860 showIndent(outfile, level, pretty_print)2861 outfile.write('<%sCol32>%s</%sCol32>%s' % (namespaceprefix_ , self.gds_format_double(self.Col32, input_name='Col32'), namespaceprefix_ , eol_))2862 if self.Col33 is not None:2863 namespaceprefix_ = self.Col33_nsprefix_ + ':' if (UseCapturedNS_ and self.Col33_nsprefix_) else ''2864 showIndent(outfile, level, pretty_print)2865 outfile.write('<%sCol33>%s</%sCol33>%s' % (namespaceprefix_ , self.gds_format_double(self.Col33, input_name='Col33'), namespaceprefix_ , eol_))2866 if self.Col34 is not None:2867 namespaceprefix_ = self.Col34_nsprefix_ + ':' if (UseCapturedNS_ and self.Col34_nsprefix_) else ''2868 showIndent(outfile, level, pretty_print)2869 outfile.write('<%sCol34>%s</%sCol34>%s' % (namespaceprefix_ , self.gds_format_double(self.Col34, input_name='Col34'), namespaceprefix_ , eol_))2870 if self.Col35 is not None:2871 namespaceprefix_ = self.Col35_nsprefix_ + ':' if (UseCapturedNS_ and self.Col35_nsprefix_) else ''2872 showIndent(outfile, level, pretty_print)2873 outfile.write('<%sCol35>%s</%sCol35>%s' % (namespaceprefix_ , self.gds_format_double(self.Col35, input_name='Col35'), namespaceprefix_ , eol_))2874 if self.Col36 is not None:2875 namespaceprefix_ = self.Col36_nsprefix_ + ':' if (UseCapturedNS_ and self.Col36_nsprefix_) else ''2876 showIndent(outfile, level, pretty_print)2877 outfile.write('<%sCol36>%s</%sCol36>%s' % (namespaceprefix_ , self.gds_format_double(self.Col36, input_name='Col36'), namespaceprefix_ , eol_))2878 if self.Col37 is not None:2879 namespaceprefix_ = self.Col37_nsprefix_ + ':' if (UseCapturedNS_ and self.Col37_nsprefix_) else ''2880 showIndent(outfile, level, pretty_print)2881 outfile.write('<%sCol37>%s</%sCol37>%s' % (namespaceprefix_ , self.gds_format_double(self.Col37, input_name='Col37'), namespaceprefix_ , eol_))2882 if self.Col38 is not None:2883 namespaceprefix_ = self.Col38_nsprefix_ + ':' if (UseCapturedNS_ and self.Col38_nsprefix_) else ''2884 showIndent(outfile, level, pretty_print)2885 outfile.write('<%sCol38>%s</%sCol38>%s' % (namespaceprefix_ , self.gds_format_double(self.Col38, input_name='Col38'), namespaceprefix_ , eol_))2886 if self.Col39 is not None:2887 namespaceprefix_ = self.Col39_nsprefix_ + ':' if (UseCapturedNS_ and self.Col39_nsprefix_) else ''2888 showIndent(outfile, level, pretty_print)2889 outfile.write('<%sCol39>%s</%sCol39>%s' % (namespaceprefix_ , self.gds_format_double(self.Col39, input_name='Col39'), namespaceprefix_ , eol_))2890 if self.Col40 is not None:2891 namespaceprefix_ = self.Col40_nsprefix_ + ':' if (UseCapturedNS_ and self.Col40_nsprefix_) else ''2892 showIndent(outfile, level, pretty_print)2893 outfile.write('<%sCol40>%s</%sCol40>%s' % (namespaceprefix_ , self.gds_format_double(self.Col40, input_name='Col40'), namespaceprefix_ , eol_))2894 if self.Col41 is not None:2895 namespaceprefix_ = self.Col41_nsprefix_ + ':' if (UseCapturedNS_ and self.Col41_nsprefix_) else ''2896 showIndent(outfile, level, pretty_print)2897 outfile.write('<%sCol41>%s</%sCol41>%s' % (namespaceprefix_ , self.gds_format_double(self.Col41, input_name='Col41'), namespaceprefix_ , eol_))2898 if self.Col42 is not None:2899 namespaceprefix_ = self.Col42_nsprefix_ + ':' if (UseCapturedNS_ and self.Col42_nsprefix_) else ''2900 showIndent(outfile, level, pretty_print)2901 outfile.write('<%sCol42>%s</%sCol42>%s' % (namespaceprefix_ , self.gds_format_double(self.Col42, input_name='Col42'), namespaceprefix_ , eol_))2902 if self.Col43 is not None:2903 namespaceprefix_ = self.Col43_nsprefix_ + ':' if (UseCapturedNS_ and self.Col43_nsprefix_) else ''2904 showIndent(outfile, level, pretty_print)2905 outfile.write('<%sCol43>%s</%sCol43>%s' % (namespaceprefix_ , self.gds_format_double(self.Col43, input_name='Col43'), namespaceprefix_ , eol_))2906 if self.Col44 is not None:2907 namespaceprefix_ = self.Col44_nsprefix_ + ':' if (UseCapturedNS_ and self.Col44_nsprefix_) else ''2908 showIndent(outfile, level, pretty_print)2909 outfile.write('<%sCol44>%s</%sCol44>%s' % (namespaceprefix_ , self.gds_format_double(self.Col44, input_name='Col44'), namespaceprefix_ , eol_))2910 if self.Col45 is not None:2911 namespaceprefix_ = self.Col45_nsprefix_ + ':' if (UseCapturedNS_ and self.Col45_nsprefix_) else ''2912 showIndent(outfile, level, pretty_print)2913 outfile.write('<%sCol45>%s</%sCol45>%s' % (namespaceprefix_ , self.gds_format_double(self.Col45, input_name='Col45'), namespaceprefix_ , eol_))2914 if self.Col46 is not None:2915 namespaceprefix_ = self.Col46_nsprefix_ + ':' if (UseCapturedNS_ and self.Col46_nsprefix_) else ''2916 showIndent(outfile, level, pretty_print)2917 outfile.write('<%sCol46>%s</%sCol46>%s' % (namespaceprefix_ , self.gds_format_double(self.Col46, input_name='Col46'), namespaceprefix_ , eol_))2918 if self.Col47 is not None:2919 namespaceprefix_ = self.Col47_nsprefix_ + ':' if (UseCapturedNS_ and self.Col47_nsprefix_) else ''2920 showIndent(outfile, level, pretty_print)2921 outfile.write('<%sCol47>%s</%sCol47>%s' % (namespaceprefix_ , self.gds_format_double(self.Col47, input_name='Col47'), namespaceprefix_ , eol_))2922 if self.Col48 is not None:2923 namespaceprefix_ = self.Col48_nsprefix_ + ':' if (UseCapturedNS_ and self.Col48_nsprefix_) else ''2924 showIndent(outfile, level, pretty_print)2925 outfile.write('<%sCol48>%s</%sCol48>%s' % (namespaceprefix_ , self.gds_format_double(self.Col48, input_name='Col48'), namespaceprefix_ , eol_))2926 if self.Col49 is not None:2927 namespaceprefix_ = self.Col49_nsprefix_ + ':' if (UseCapturedNS_ and self.Col49_nsprefix_) else ''2928 showIndent(outfile, level, pretty_print)2929 outfile.write('<%sCol49>%s</%sCol49>%s' % (namespaceprefix_ , self.gds_format_double(self.Col49, input_name='Col49'), namespaceprefix_ , eol_))2930 if self.Col50 is not None:2931 namespaceprefix_ = self.Col50_nsprefix_ + ':' if (UseCapturedNS_ and self.Col50_nsprefix_) else ''2932 showIndent(outfile, level, pretty_print)2933 outfile.write('<%sCol50>%s</%sCol50>%s' % (namespaceprefix_ , self.gds_format_double(self.Col50, input_name='Col50'), namespaceprefix_ , eol_))2934 if self.Col51 is not None:2935 namespaceprefix_ = self.Col51_nsprefix_ + ':' if (UseCapturedNS_ and self.Col51_nsprefix_) else ''2936 showIndent(outfile, level, pretty_print)2937 outfile.write('<%sCol51>%s</%sCol51>%s' % (namespaceprefix_ , self.gds_format_double(self.Col51, input_name='Col51'), namespaceprefix_ , eol_))2938 if self.Col52 is not None:2939 namespaceprefix_ = self.Col52_nsprefix_ + ':' if (UseCapturedNS_ and self.Col52_nsprefix_) else ''2940 showIndent(outfile, level, pretty_print)2941 outfile.write('<%sCol52>%s</%sCol52>%s' % (namespaceprefix_ , self.gds_format_double(self.Col52, input_name='Col52'), namespaceprefix_ , eol_))2942 if self.Col53 is not None:2943 namespaceprefix_ = self.Col53_nsprefix_ + ':' if (UseCapturedNS_ and self.Col53_nsprefix_) else ''2944 showIndent(outfile, level, pretty_print)2945 outfile.write('<%sCol53>%s</%sCol53>%s' % (namespaceprefix_ , self.gds_format_double(self.Col53, input_name='Col53'), namespaceprefix_ , eol_))2946 if self.Col54 is not None:2947 namespaceprefix_ = self.Col54_nsprefix_ + ':' if (UseCapturedNS_ and self.Col54_nsprefix_) else ''2948 showIndent(outfile, level, pretty_print)2949 outfile.write('<%sCol54>%s</%sCol54>%s' % (namespaceprefix_ , self.gds_format_double(self.Col54, input_name='Col54'), namespaceprefix_ , eol_))2950 if self.Col55 is not None:2951 namespaceprefix_ = self.Col55_nsprefix_ + ':' if (UseCapturedNS_ and self.Col55_nsprefix_) else ''2952 showIndent(outfile, level, pretty_print)2953 outfile.write('<%sCol55>%s</%sCol55>%s' % (namespaceprefix_ , self.gds_format_double(self.Col55, input_name='Col55'), namespaceprefix_ , eol_))2954 if self.Col56 is not None:2955 namespaceprefix_ = self.Col56_nsprefix_ + ':' if (UseCapturedNS_ and self.Col56_nsprefix_) else ''2956 showIndent(outfile, level, pretty_print)2957 outfile.write('<%sCol56>%s</%sCol56>%s' % (namespaceprefix_ , self.gds_format_double(self.Col56, input_name='Col56'), namespaceprefix_ , eol_))2958 if self.Col57 is not None:2959 namespaceprefix_ = self.Col57_nsprefix_ + ':' if (UseCapturedNS_ and self.Col57_nsprefix_) else ''2960 showIndent(outfile, level, pretty_print)2961 outfile.write('<%sCol57>%s</%sCol57>%s' % (namespaceprefix_ , self.gds_format_double(self.Col57, input_name='Col57'), namespaceprefix_ , eol_))2962 if self.Col58 is not None:2963 namespaceprefix_ = self.Col58_nsprefix_ + ':' if (UseCapturedNS_ and self.Col58_nsprefix_) else ''2964 showIndent(outfile, level, pretty_print)2965 outfile.write('<%sCol58>%s</%sCol58>%s' % (namespaceprefix_ , self.gds_format_double(self.Col58, input_name='Col58'), namespaceprefix_ , eol_))2966 if self.Col59 is not None:2967 namespaceprefix_ = self.Col59_nsprefix_ + ':' if (UseCapturedNS_ and self.Col59_nsprefix_) else ''2968 showIndent(outfile, level, pretty_print)2969 outfile.write('<%sCol59>%s</%sCol59>%s' % (namespaceprefix_ , self.gds_format_double(self.Col59, input_name='Col59'), namespaceprefix_ , eol_))2970 if self.Col60 is not None:2971 namespaceprefix_ = self.Col60_nsprefix_ + ':' if (UseCapturedNS_ and self.Col60_nsprefix_) else ''2972 showIndent(outfile, level, pretty_print)2973 outfile.write('<%sCol60>%s</%sCol60>%s' % (namespaceprefix_ , self.gds_format_double(self.Col60, input_name='Col60'), namespaceprefix_ , eol_))2974 if self.Col61 is not None:2975 namespaceprefix_ = self.Col61_nsprefix_ + ':' if (UseCapturedNS_ and self.Col61_nsprefix_) else ''2976 showIndent(outfile, level, pretty_print)2977 outfile.write('<%sCol61>%s</%sCol61>%s' % (namespaceprefix_ , self.gds_format_double(self.Col61, input_name='Col61'), namespaceprefix_ , eol_))2978 if self.Col62 is not None:2979 namespaceprefix_ = self.Col62_nsprefix_ + ':' if (UseCapturedNS_ and self.Col62_nsprefix_) else ''2980 showIndent(outfile, level, pretty_print)2981 outfile.write('<%sCol62>%s</%sCol62>%s' % (namespaceprefix_ , self.gds_format_double(self.Col62, input_name='Col62'), namespaceprefix_ , eol_))2982 if self.Col63 is not None:2983 namespaceprefix_ = self.Col63_nsprefix_ + ':' if (UseCapturedNS_ and self.Col63_nsprefix_) else ''2984 showIndent(outfile, level, pretty_print)2985 outfile.write('<%sCol63>%s</%sCol63>%s' % (namespaceprefix_ , self.gds_format_double(self.Col63, input_name='Col63'), namespaceprefix_ , eol_))2986 if self.Col64 is not None:2987 namespaceprefix_ = self.Col64_nsprefix_ + ':' if (UseCapturedNS_ and self.Col64_nsprefix_) else ''2988 showIndent(outfile, level, pretty_print)2989 outfile.write('<%sCol64>%s</%sCol64>%s' % (namespaceprefix_ , self.gds_format_double(self.Col64, input_name='Col64'), namespaceprefix_ , eol_))2990 def to_etree(self, parent_element=None, name_='MDataType', mapping_=None, reverse_mapping_=None, nsmap_=None):2991 if parent_element is None:2992 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2993 else:2994 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)2995 if self.Row is not None:2996 element.set('Row', self.gds_format_integer(self.Row))2997 if self.Axis1 is not None:2998 element.set('Axis1', self.gds_format_integer(self.Axis1))2999 if self.Axis2 is not None:3000 element.set('Axis2', self.gds_format_integer(self.Axis2))3001 if self.Axis3 is not None:3002 element.set('Axis3', self.gds_format_integer(self.Axis3))3003 if self.Axis4 is not None:3004 element.set('Axis4', self.gds_format_integer(self.Axis4))3005 if self.Col1 is not None:3006 Col1_ = self.Col13007 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col1').text = self.gds_format_double(Col1_)3008 if self.Col2 is not None:3009 Col2_ = self.Col23010 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col2').text = self.gds_format_double(Col2_)3011 if self.Col3 is not None:3012 Col3_ = self.Col33013 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col3').text = self.gds_format_double(Col3_)3014 if self.Col4 is not None:3015 Col4_ = self.Col43016 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col4').text = self.gds_format_double(Col4_)3017 if self.Col5 is not None:3018 Col5_ = self.Col53019 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col5').text = self.gds_format_double(Col5_)3020 if self.Col6 is not None:3021 Col6_ = self.Col63022 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col6').text = self.gds_format_double(Col6_)3023 if self.Col7 is not None:3024 Col7_ = self.Col73025 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col7').text = self.gds_format_double(Col7_)3026 if self.Col8 is not None:3027 Col8_ = self.Col83028 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col8').text = self.gds_format_double(Col8_)3029 if self.Col9 is not None:3030 Col9_ = self.Col93031 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col9').text = self.gds_format_double(Col9_)3032 if self.Col10 is not None:3033 Col10_ = self.Col103034 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col10').text = self.gds_format_double(Col10_)3035 if self.Col11 is not None:3036 Col11_ = self.Col113037 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col11').text = self.gds_format_double(Col11_)3038 if self.Col12 is not None:3039 Col12_ = self.Col123040 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col12').text = self.gds_format_double(Col12_)3041 if self.Col13 is not None:3042 Col13_ = self.Col133043 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col13').text = self.gds_format_double(Col13_)3044 if self.Col14 is not None:3045 Col14_ = self.Col143046 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col14').text = self.gds_format_double(Col14_)3047 if self.Col15 is not None:3048 Col15_ = self.Col153049 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col15').text = self.gds_format_double(Col15_)3050 if self.Col16 is not None:3051 Col16_ = self.Col163052 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col16').text = self.gds_format_double(Col16_)3053 if self.Col17 is not None:3054 Col17_ = self.Col173055 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col17').text = self.gds_format_double(Col17_)3056 if self.Col18 is not None:3057 Col18_ = self.Col183058 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col18').text = self.gds_format_double(Col18_)3059 if self.Col19 is not None:3060 Col19_ = self.Col193061 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col19').text = self.gds_format_double(Col19_)3062 if self.Col20 is not None:3063 Col20_ = self.Col203064 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col20').text = self.gds_format_double(Col20_)3065 if self.Col21 is not None:3066 Col21_ = self.Col213067 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col21').text = self.gds_format_double(Col21_)3068 if self.Col22 is not None:3069 Col22_ = self.Col223070 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col22').text = self.gds_format_double(Col22_)3071 if self.Col23 is not None:3072 Col23_ = self.Col233073 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col23').text = self.gds_format_double(Col23_)3074 if self.Col24 is not None:3075 Col24_ = self.Col243076 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col24').text = self.gds_format_double(Col24_)3077 if self.Col25 is not None:3078 Col25_ = self.Col253079 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col25').text = self.gds_format_double(Col25_)3080 if self.Col26 is not None:3081 Col26_ = self.Col263082 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col26').text = self.gds_format_double(Col26_)3083 if self.Col27 is not None:3084 Col27_ = self.Col273085 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col27').text = self.gds_format_double(Col27_)3086 if self.Col28 is not None:3087 Col28_ = self.Col283088 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col28').text = self.gds_format_double(Col28_)3089 if self.Col29 is not None:3090 Col29_ = self.Col293091 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col29').text = self.gds_format_double(Col29_)3092 if self.Col30 is not None:3093 Col30_ = self.Col303094 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col30').text = self.gds_format_double(Col30_)3095 if self.Col31 is not None:3096 Col31_ = self.Col313097 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col31').text = self.gds_format_double(Col31_)3098 if self.Col32 is not None:3099 Col32_ = self.Col323100 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col32').text = self.gds_format_double(Col32_)3101 if self.Col33 is not None:3102 Col33_ = self.Col333103 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col33').text = self.gds_format_double(Col33_)3104 if self.Col34 is not None:3105 Col34_ = self.Col343106 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col34').text = self.gds_format_double(Col34_)3107 if self.Col35 is not None:3108 Col35_ = self.Col353109 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col35').text = self.gds_format_double(Col35_)3110 if self.Col36 is not None:3111 Col36_ = self.Col363112 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col36').text = self.gds_format_double(Col36_)3113 if self.Col37 is not None:3114 Col37_ = self.Col373115 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col37').text = self.gds_format_double(Col37_)3116 if self.Col38 is not None:3117 Col38_ = self.Col383118 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col38').text = self.gds_format_double(Col38_)3119 if self.Col39 is not None:3120 Col39_ = self.Col393121 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col39').text = self.gds_format_double(Col39_)3122 if self.Col40 is not None:3123 Col40_ = self.Col403124 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col40').text = self.gds_format_double(Col40_)3125 if self.Col41 is not None:3126 Col41_ = self.Col413127 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col41').text = self.gds_format_double(Col41_)3128 if self.Col42 is not None:3129 Col42_ = self.Col423130 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col42').text = self.gds_format_double(Col42_)3131 if self.Col43 is not None:3132 Col43_ = self.Col433133 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col43').text = self.gds_format_double(Col43_)3134 if self.Col44 is not None:3135 Col44_ = self.Col443136 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col44').text = self.gds_format_double(Col44_)3137 if self.Col45 is not None:3138 Col45_ = self.Col453139 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col45').text = self.gds_format_double(Col45_)3140 if self.Col46 is not None:3141 Col46_ = self.Col463142 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col46').text = self.gds_format_double(Col46_)3143 if self.Col47 is not None:3144 Col47_ = self.Col473145 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col47').text = self.gds_format_double(Col47_)3146 if self.Col48 is not None:3147 Col48_ = self.Col483148 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col48').text = self.gds_format_double(Col48_)3149 if self.Col49 is not None:3150 Col49_ = self.Col493151 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col49').text = self.gds_format_double(Col49_)3152 if self.Col50 is not None:3153 Col50_ = self.Col503154 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col50').text = self.gds_format_double(Col50_)3155 if self.Col51 is not None:3156 Col51_ = self.Col513157 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col51').text = self.gds_format_double(Col51_)3158 if self.Col52 is not None:3159 Col52_ = self.Col523160 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col52').text = self.gds_format_double(Col52_)3161 if self.Col53 is not None:3162 Col53_ = self.Col533163 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col53').text = self.gds_format_double(Col53_)3164 if self.Col54 is not None:3165 Col54_ = self.Col543166 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col54').text = self.gds_format_double(Col54_)3167 if self.Col55 is not None:3168 Col55_ = self.Col553169 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col55').text = self.gds_format_double(Col55_)3170 if self.Col56 is not None:3171 Col56_ = self.Col563172 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col56').text = self.gds_format_double(Col56_)3173 if self.Col57 is not None:3174 Col57_ = self.Col573175 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col57').text = self.gds_format_double(Col57_)3176 if self.Col58 is not None:3177 Col58_ = self.Col583178 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col58').text = self.gds_format_double(Col58_)3179 if self.Col59 is not None:3180 Col59_ = self.Col593181 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col59').text = self.gds_format_double(Col59_)3182 if self.Col60 is not None:3183 Col60_ = self.Col603184 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col60').text = self.gds_format_double(Col60_)3185 if self.Col61 is not None:3186 Col61_ = self.Col613187 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col61').text = self.gds_format_double(Col61_)3188 if self.Col62 is not None:3189 Col62_ = self.Col623190 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col62').text = self.gds_format_double(Col62_)3191 if self.Col63 is not None:3192 Col63_ = self.Col633193 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col63').text = self.gds_format_double(Col63_)3194 if self.Col64 is not None:3195 Col64_ = self.Col643196 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Col64').text = self.gds_format_double(Col64_)3197 if mapping_ is not None:3198 mapping_[id(self)] = element3199 if reverse_mapping_ is not None:3200 reverse_mapping_[element] = self3201 return element3202 def build(self, node, gds_collector_=None):3203 self.gds_collector_ = gds_collector_3204 if SaveElementTreeNode:3205 self.gds_elementtree_node_ = node3206 already_processed = set()3207 self.ns_prefix_ = node.prefix3208 self._buildAttributes(node, node.attrib, already_processed)3209 for child in node:3210 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3211 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)3212 return self3213 def _buildAttributes(self, node, attrs, already_processed):3214 value = find_attr_value_('Row', node)3215 if value is not None and 'Row' not in already_processed:3216 already_processed.add('Row')3217 self.Row = self.gds_parse_integer(value, node, 'Row')3218 value = find_attr_value_('Axis1', node)3219 if value is not None and 'Axis1' not in already_processed:3220 already_processed.add('Axis1')3221 self.Axis1 = self.gds_parse_integer(value, node, 'Axis1')3222 value = find_attr_value_('Axis2', node)3223 if value is not None and 'Axis2' not in already_processed:3224 already_processed.add('Axis2')3225 self.Axis2 = self.gds_parse_integer(value, node, 'Axis2')3226 value = find_attr_value_('Axis3', node)3227 if value is not None and 'Axis3' not in already_processed:3228 already_processed.add('Axis3')3229 self.Axis3 = self.gds_parse_integer(value, node, 'Axis3')3230 value = find_attr_value_('Axis4', node)3231 if value is not None and 'Axis4' not in already_processed:3232 already_processed.add('Axis4')3233 self.Axis4 = self.gds_parse_integer(value, node, 'Axis4')3234 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):3235 if nodeName_ == 'Col1' and child_.text:3236 sval_ = child_.text3237 fval_ = self.gds_parse_double(sval_, node, 'Col1')3238 fval_ = self.gds_validate_double(fval_, node, 'Col1')3239 self.Col1 = fval_3240 self.Col1_nsprefix_ = child_.prefix3241 elif nodeName_ == 'Col2' and child_.text:3242 sval_ = child_.text3243 fval_ = self.gds_parse_double(sval_, node, 'Col2')3244 fval_ = self.gds_validate_double(fval_, node, 'Col2')3245 self.Col2 = fval_3246 self.Col2_nsprefix_ = child_.prefix3247 elif nodeName_ == 'Col3' and child_.text:3248 sval_ = child_.text3249 fval_ = self.gds_parse_double(sval_, node, 'Col3')3250 fval_ = self.gds_validate_double(fval_, node, 'Col3')3251 self.Col3 = fval_3252 self.Col3_nsprefix_ = child_.prefix3253 elif nodeName_ == 'Col4' and child_.text:3254 sval_ = child_.text3255 fval_ = self.gds_parse_double(sval_, node, 'Col4')3256 fval_ = self.gds_validate_double(fval_, node, 'Col4')3257 self.Col4 = fval_3258 self.Col4_nsprefix_ = child_.prefix3259 elif nodeName_ == 'Col5' and child_.text:3260 sval_ = child_.text3261 fval_ = self.gds_parse_double(sval_, node, 'Col5')3262 fval_ = self.gds_validate_double(fval_, node, 'Col5')3263 self.Col5 = fval_3264 self.Col5_nsprefix_ = child_.prefix3265 elif nodeName_ == 'Col6' and child_.text:3266 sval_ = child_.text3267 fval_ = self.gds_parse_double(sval_, node, 'Col6')3268 fval_ = self.gds_validate_double(fval_, node, 'Col6')3269 self.Col6 = fval_3270 self.Col6_nsprefix_ = child_.prefix3271 elif nodeName_ == 'Col7' and child_.text:3272 sval_ = child_.text3273 fval_ = self.gds_parse_double(sval_, node, 'Col7')3274 fval_ = self.gds_validate_double(fval_, node, 'Col7')3275 self.Col7 = fval_3276 self.Col7_nsprefix_ = child_.prefix3277 elif nodeName_ == 'Col8' and child_.text:3278 sval_ = child_.text3279 fval_ = self.gds_parse_double(sval_, node, 'Col8')3280 fval_ = self.gds_validate_double(fval_, node, 'Col8')3281 self.Col8 = fval_3282 self.Col8_nsprefix_ = child_.prefix3283 elif nodeName_ == 'Col9' and child_.text:3284 sval_ = child_.text3285 fval_ = self.gds_parse_double(sval_, node, 'Col9')3286 fval_ = self.gds_validate_double(fval_, node, 'Col9')3287 self.Col9 = fval_3288 self.Col9_nsprefix_ = child_.prefix3289 elif nodeName_ == 'Col10' and child_.text:3290 sval_ = child_.text3291 fval_ = self.gds_parse_double(sval_, node, 'Col10')3292 fval_ = self.gds_validate_double(fval_, node, 'Col10')3293 self.Col10 = fval_3294 self.Col10_nsprefix_ = child_.prefix3295 elif nodeName_ == 'Col11' and child_.text:3296 sval_ = child_.text3297 fval_ = self.gds_parse_double(sval_, node, 'Col11')3298 fval_ = self.gds_validate_double(fval_, node, 'Col11')3299 self.Col11 = fval_3300 self.Col11_nsprefix_ = child_.prefix3301 elif nodeName_ == 'Col12' and child_.text:3302 sval_ = child_.text3303 fval_ = self.gds_parse_double(sval_, node, 'Col12')3304 fval_ = self.gds_validate_double(fval_, node, 'Col12')3305 self.Col12 = fval_3306 self.Col12_nsprefix_ = child_.prefix3307 elif nodeName_ == 'Col13' and child_.text:3308 sval_ = child_.text3309 fval_ = self.gds_parse_double(sval_, node, 'Col13')3310 fval_ = self.gds_validate_double(fval_, node, 'Col13')3311 self.Col13 = fval_3312 self.Col13_nsprefix_ = child_.prefix3313 elif nodeName_ == 'Col14' and child_.text:3314 sval_ = child_.text3315 fval_ = self.gds_parse_double(sval_, node, 'Col14')3316 fval_ = self.gds_validate_double(fval_, node, 'Col14')3317 self.Col14 = fval_3318 self.Col14_nsprefix_ = child_.prefix3319 elif nodeName_ == 'Col15' and child_.text:3320 sval_ = child_.text3321 fval_ = self.gds_parse_double(sval_, node, 'Col15')3322 fval_ = self.gds_validate_double(fval_, node, 'Col15')3323 self.Col15 = fval_3324 self.Col15_nsprefix_ = child_.prefix3325 elif nodeName_ == 'Col16' and child_.text:3326 sval_ = child_.text3327 fval_ = self.gds_parse_double(sval_, node, 'Col16')3328 fval_ = self.gds_validate_double(fval_, node, 'Col16')3329 self.Col16 = fval_3330 self.Col16_nsprefix_ = child_.prefix3331 elif nodeName_ == 'Col17' and child_.text:3332 sval_ = child_.text3333 fval_ = self.gds_parse_double(sval_, node, 'Col17')3334 fval_ = self.gds_validate_double(fval_, node, 'Col17')3335 self.Col17 = fval_3336 self.Col17_nsprefix_ = child_.prefix3337 elif nodeName_ == 'Col18' and child_.text:3338 sval_ = child_.text3339 fval_ = self.gds_parse_double(sval_, node, 'Col18')3340 fval_ = self.gds_validate_double(fval_, node, 'Col18')3341 self.Col18 = fval_3342 self.Col18_nsprefix_ = child_.prefix3343 elif nodeName_ == 'Col19' and child_.text:3344 sval_ = child_.text3345 fval_ = self.gds_parse_double(sval_, node, 'Col19')3346 fval_ = self.gds_validate_double(fval_, node, 'Col19')3347 self.Col19 = fval_3348 self.Col19_nsprefix_ = child_.prefix3349 elif nodeName_ == 'Col20' and child_.text:3350 sval_ = child_.text3351 fval_ = self.gds_parse_double(sval_, node, 'Col20')3352 fval_ = self.gds_validate_double(fval_, node, 'Col20')3353 self.Col20 = fval_3354 self.Col20_nsprefix_ = child_.prefix3355 elif nodeName_ == 'Col21' and child_.text:3356 sval_ = child_.text3357 fval_ = self.gds_parse_double(sval_, node, 'Col21')3358 fval_ = self.gds_validate_double(fval_, node, 'Col21')3359 self.Col21 = fval_3360 self.Col21_nsprefix_ = child_.prefix3361 elif nodeName_ == 'Col22' and child_.text:3362 sval_ = child_.text3363 fval_ = self.gds_parse_double(sval_, node, 'Col22')3364 fval_ = self.gds_validate_double(fval_, node, 'Col22')3365 self.Col22 = fval_3366 self.Col22_nsprefix_ = child_.prefix3367 elif nodeName_ == 'Col23' and child_.text:3368 sval_ = child_.text3369 fval_ = self.gds_parse_double(sval_, node, 'Col23')3370 fval_ = self.gds_validate_double(fval_, node, 'Col23')3371 self.Col23 = fval_3372 self.Col23_nsprefix_ = child_.prefix3373 elif nodeName_ == 'Col24' and child_.text:3374 sval_ = child_.text3375 fval_ = self.gds_parse_double(sval_, node, 'Col24')3376 fval_ = self.gds_validate_double(fval_, node, 'Col24')3377 self.Col24 = fval_3378 self.Col24_nsprefix_ = child_.prefix3379 elif nodeName_ == 'Col25' and child_.text:3380 sval_ = child_.text3381 fval_ = self.gds_parse_double(sval_, node, 'Col25')3382 fval_ = self.gds_validate_double(fval_, node, 'Col25')3383 self.Col25 = fval_3384 self.Col25_nsprefix_ = child_.prefix3385 elif nodeName_ == 'Col26' and child_.text:3386 sval_ = child_.text3387 fval_ = self.gds_parse_double(sval_, node, 'Col26')3388 fval_ = self.gds_validate_double(fval_, node, 'Col26')3389 self.Col26 = fval_3390 self.Col26_nsprefix_ = child_.prefix3391 elif nodeName_ == 'Col27' and child_.text:3392 sval_ = child_.text3393 fval_ = self.gds_parse_double(sval_, node, 'Col27')3394 fval_ = self.gds_validate_double(fval_, node, 'Col27')3395 self.Col27 = fval_3396 self.Col27_nsprefix_ = child_.prefix3397 elif nodeName_ == 'Col28' and child_.text:3398 sval_ = child_.text3399 fval_ = self.gds_parse_double(sval_, node, 'Col28')3400 fval_ = self.gds_validate_double(fval_, node, 'Col28')3401 self.Col28 = fval_3402 self.Col28_nsprefix_ = child_.prefix3403 elif nodeName_ == 'Col29' and child_.text:3404 sval_ = child_.text3405 fval_ = self.gds_parse_double(sval_, node, 'Col29')3406 fval_ = self.gds_validate_double(fval_, node, 'Col29')3407 self.Col29 = fval_3408 self.Col29_nsprefix_ = child_.prefix3409 elif nodeName_ == 'Col30' and child_.text:3410 sval_ = child_.text3411 fval_ = self.gds_parse_double(sval_, node, 'Col30')3412 fval_ = self.gds_validate_double(fval_, node, 'Col30')3413 self.Col30 = fval_3414 self.Col30_nsprefix_ = child_.prefix3415 elif nodeName_ == 'Col31' and child_.text:3416 sval_ = child_.text3417 fval_ = self.gds_parse_double(sval_, node, 'Col31')3418 fval_ = self.gds_validate_double(fval_, node, 'Col31')3419 self.Col31 = fval_3420 self.Col31_nsprefix_ = child_.prefix3421 elif nodeName_ == 'Col32' and child_.text:3422 sval_ = child_.text3423 fval_ = self.gds_parse_double(sval_, node, 'Col32')3424 fval_ = self.gds_validate_double(fval_, node, 'Col32')3425 self.Col32 = fval_3426 self.Col32_nsprefix_ = child_.prefix3427 elif nodeName_ == 'Col33' and child_.text:3428 sval_ = child_.text3429 fval_ = self.gds_parse_double(sval_, node, 'Col33')3430 fval_ = self.gds_validate_double(fval_, node, 'Col33')3431 self.Col33 = fval_3432 self.Col33_nsprefix_ = child_.prefix3433 elif nodeName_ == 'Col34' and child_.text:3434 sval_ = child_.text3435 fval_ = self.gds_parse_double(sval_, node, 'Col34')3436 fval_ = self.gds_validate_double(fval_, node, 'Col34')3437 self.Col34 = fval_3438 self.Col34_nsprefix_ = child_.prefix3439 elif nodeName_ == 'Col35' and child_.text:3440 sval_ = child_.text3441 fval_ = self.gds_parse_double(sval_, node, 'Col35')3442 fval_ = self.gds_validate_double(fval_, node, 'Col35')3443 self.Col35 = fval_3444 self.Col35_nsprefix_ = child_.prefix3445 elif nodeName_ == 'Col36' and child_.text:3446 sval_ = child_.text3447 fval_ = self.gds_parse_double(sval_, node, 'Col36')3448 fval_ = self.gds_validate_double(fval_, node, 'Col36')3449 self.Col36 = fval_3450 self.Col36_nsprefix_ = child_.prefix3451 elif nodeName_ == 'Col37' and child_.text:3452 sval_ = child_.text3453 fval_ = self.gds_parse_double(sval_, node, 'Col37')3454 fval_ = self.gds_validate_double(fval_, node, 'Col37')3455 self.Col37 = fval_3456 self.Col37_nsprefix_ = child_.prefix3457 elif nodeName_ == 'Col38' and child_.text:3458 sval_ = child_.text3459 fval_ = self.gds_parse_double(sval_, node, 'Col38')3460 fval_ = self.gds_validate_double(fval_, node, 'Col38')3461 self.Col38 = fval_3462 self.Col38_nsprefix_ = child_.prefix3463 elif nodeName_ == 'Col39' and child_.text:3464 sval_ = child_.text3465 fval_ = self.gds_parse_double(sval_, node, 'Col39')3466 fval_ = self.gds_validate_double(fval_, node, 'Col39')3467 self.Col39 = fval_3468 self.Col39_nsprefix_ = child_.prefix3469 elif nodeName_ == 'Col40' and child_.text:3470 sval_ = child_.text3471 fval_ = self.gds_parse_double(sval_, node, 'Col40')3472 fval_ = self.gds_validate_double(fval_, node, 'Col40')3473 self.Col40 = fval_3474 self.Col40_nsprefix_ = child_.prefix3475 elif nodeName_ == 'Col41' and child_.text:3476 sval_ = child_.text3477 fval_ = self.gds_parse_double(sval_, node, 'Col41')3478 fval_ = self.gds_validate_double(fval_, node, 'Col41')3479 self.Col41 = fval_3480 self.Col41_nsprefix_ = child_.prefix3481 elif nodeName_ == 'Col42' and child_.text:3482 sval_ = child_.text3483 fval_ = self.gds_parse_double(sval_, node, 'Col42')3484 fval_ = self.gds_validate_double(fval_, node, 'Col42')3485 self.Col42 = fval_3486 self.Col42_nsprefix_ = child_.prefix3487 elif nodeName_ == 'Col43' and child_.text:3488 sval_ = child_.text3489 fval_ = self.gds_parse_double(sval_, node, 'Col43')3490 fval_ = self.gds_validate_double(fval_, node, 'Col43')3491 self.Col43 = fval_3492 self.Col43_nsprefix_ = child_.prefix3493 elif nodeName_ == 'Col44' and child_.text:3494 sval_ = child_.text3495 fval_ = self.gds_parse_double(sval_, node, 'Col44')3496 fval_ = self.gds_validate_double(fval_, node, 'Col44')3497 self.Col44 = fval_3498 self.Col44_nsprefix_ = child_.prefix3499 elif nodeName_ == 'Col45' and child_.text:3500 sval_ = child_.text3501 fval_ = self.gds_parse_double(sval_, node, 'Col45')3502 fval_ = self.gds_validate_double(fval_, node, 'Col45')3503 self.Col45 = fval_3504 self.Col45_nsprefix_ = child_.prefix3505 elif nodeName_ == 'Col46' and child_.text:3506 sval_ = child_.text3507 fval_ = self.gds_parse_double(sval_, node, 'Col46')3508 fval_ = self.gds_validate_double(fval_, node, 'Col46')3509 self.Col46 = fval_3510 self.Col46_nsprefix_ = child_.prefix3511 elif nodeName_ == 'Col47' and child_.text:3512 sval_ = child_.text3513 fval_ = self.gds_parse_double(sval_, node, 'Col47')3514 fval_ = self.gds_validate_double(fval_, node, 'Col47')3515 self.Col47 = fval_3516 self.Col47_nsprefix_ = child_.prefix3517 elif nodeName_ == 'Col48' and child_.text:3518 sval_ = child_.text3519 fval_ = self.gds_parse_double(sval_, node, 'Col48')3520 fval_ = self.gds_validate_double(fval_, node, 'Col48')3521 self.Col48 = fval_3522 self.Col48_nsprefix_ = child_.prefix3523 elif nodeName_ == 'Col49' and child_.text:3524 sval_ = child_.text3525 fval_ = self.gds_parse_double(sval_, node, 'Col49')3526 fval_ = self.gds_validate_double(fval_, node, 'Col49')3527 self.Col49 = fval_3528 self.Col49_nsprefix_ = child_.prefix3529 elif nodeName_ == 'Col50' and child_.text:3530 sval_ = child_.text3531 fval_ = self.gds_parse_double(sval_, node, 'Col50')3532 fval_ = self.gds_validate_double(fval_, node, 'Col50')3533 self.Col50 = fval_3534 self.Col50_nsprefix_ = child_.prefix3535 elif nodeName_ == 'Col51' and child_.text:3536 sval_ = child_.text3537 fval_ = self.gds_parse_double(sval_, node, 'Col51')3538 fval_ = self.gds_validate_double(fval_, node, 'Col51')3539 self.Col51 = fval_3540 self.Col51_nsprefix_ = child_.prefix3541 elif nodeName_ == 'Col52' and child_.text:3542 sval_ = child_.text3543 fval_ = self.gds_parse_double(sval_, node, 'Col52')3544 fval_ = self.gds_validate_double(fval_, node, 'Col52')3545 self.Col52 = fval_3546 self.Col52_nsprefix_ = child_.prefix3547 elif nodeName_ == 'Col53' and child_.text:3548 sval_ = child_.text3549 fval_ = self.gds_parse_double(sval_, node, 'Col53')3550 fval_ = self.gds_validate_double(fval_, node, 'Col53')3551 self.Col53 = fval_3552 self.Col53_nsprefix_ = child_.prefix3553 elif nodeName_ == 'Col54' and child_.text:3554 sval_ = child_.text3555 fval_ = self.gds_parse_double(sval_, node, 'Col54')3556 fval_ = self.gds_validate_double(fval_, node, 'Col54')3557 self.Col54 = fval_3558 self.Col54_nsprefix_ = child_.prefix3559 elif nodeName_ == 'Col55' and child_.text:3560 sval_ = child_.text3561 fval_ = self.gds_parse_double(sval_, node, 'Col55')3562 fval_ = self.gds_validate_double(fval_, node, 'Col55')3563 self.Col55 = fval_3564 self.Col55_nsprefix_ = child_.prefix3565 elif nodeName_ == 'Col56' and child_.text:3566 sval_ = child_.text3567 fval_ = self.gds_parse_double(sval_, node, 'Col56')3568 fval_ = self.gds_validate_double(fval_, node, 'Col56')3569 self.Col56 = fval_3570 self.Col56_nsprefix_ = child_.prefix3571 elif nodeName_ == 'Col57' and child_.text:3572 sval_ = child_.text3573 fval_ = self.gds_parse_double(sval_, node, 'Col57')3574 fval_ = self.gds_validate_double(fval_, node, 'Col57')3575 self.Col57 = fval_3576 self.Col57_nsprefix_ = child_.prefix3577 elif nodeName_ == 'Col58' and child_.text:3578 sval_ = child_.text3579 fval_ = self.gds_parse_double(sval_, node, 'Col58')3580 fval_ = self.gds_validate_double(fval_, node, 'Col58')3581 self.Col58 = fval_3582 self.Col58_nsprefix_ = child_.prefix3583 elif nodeName_ == 'Col59' and child_.text:3584 sval_ = child_.text3585 fval_ = self.gds_parse_double(sval_, node, 'Col59')3586 fval_ = self.gds_validate_double(fval_, node, 'Col59')3587 self.Col59 = fval_3588 self.Col59_nsprefix_ = child_.prefix3589 elif nodeName_ == 'Col60' and child_.text:3590 sval_ = child_.text3591 fval_ = self.gds_parse_double(sval_, node, 'Col60')3592 fval_ = self.gds_validate_double(fval_, node, 'Col60')3593 self.Col60 = fval_3594 self.Col60_nsprefix_ = child_.prefix3595 elif nodeName_ == 'Col61' and child_.text:3596 sval_ = child_.text3597 fval_ = self.gds_parse_double(sval_, node, 'Col61')3598 fval_ = self.gds_validate_double(fval_, node, 'Col61')3599 self.Col61 = fval_3600 self.Col61_nsprefix_ = child_.prefix3601 elif nodeName_ == 'Col62' and child_.text:3602 sval_ = child_.text3603 fval_ = self.gds_parse_double(sval_, node, 'Col62')3604 fval_ = self.gds_validate_double(fval_, node, 'Col62')3605 self.Col62 = fval_3606 self.Col62_nsprefix_ = child_.prefix3607 elif nodeName_ == 'Col63' and child_.text:3608 sval_ = child_.text3609 fval_ = self.gds_parse_double(sval_, node, 'Col63')3610 fval_ = self.gds_validate_double(fval_, node, 'Col63')3611 self.Col63 = fval_3612 self.Col63_nsprefix_ = child_.prefix3613 elif nodeName_ == 'Col64' and child_.text:3614 sval_ = child_.text3615 fval_ = self.gds_parse_double(sval_, node, 'Col64')3616 fval_ = self.gds_validate_double(fval_, node, 'Col64')3617 self.Col64 = fval_3618 self.Col64_nsprefix_ = child_.prefix3619# end class MDataType3620class BetasType(GeneratedsSuper):3621 __hash__ = GeneratedsSuper.__hash__3622 subclass = None3623 superclass = None3624 def __init__(self, Number=None, Beta=None, gds_collector_=None, **kwargs_):3625 self.gds_collector_ = gds_collector_3626 self.gds_elementtree_node_ = None3627 self.original_tagname_ = None3628 self.parent_object_ = kwargs_.get('parent_object_')3629 self.ns_prefix_ = None3630 self.Number = Number3631 self.Number_nsprefix_ = None3632 if Beta is None:3633 self.Beta = []3634 else:3635 self.Beta = Beta3636 self.Beta_nsprefix_ = None3637 def factory(*args_, **kwargs_):3638 if CurrentSubclassModule_ is not None:3639 subclass = getSubclassFromModule_(3640 CurrentSubclassModule_, BetasType)3641 if subclass is not None:3642 return subclass(*args_, **kwargs_)3643 if BetasType.subclass:3644 return BetasType.subclass(*args_, **kwargs_)3645 else:3646 return BetasType(*args_, **kwargs_)3647 factory = staticmethod(factory)3648 def get_ns_prefix_(self):3649 return self.ns_prefix_3650 def set_ns_prefix_(self, ns_prefix):3651 self.ns_prefix_ = ns_prefix3652 def get_Number(self):3653 return self.Number3654 def set_Number(self, Number):3655 self.Number = Number3656 def get_Beta(self):3657 return self.Beta3658 def set_Beta(self, Beta):3659 self.Beta = Beta3660 def add_Beta(self, value):3661 self.Beta.append(value)3662 def insert_Beta_at(self, index, value):3663 self.Beta.insert(index, value)3664 def replace_Beta_at(self, index, value):3665 self.Beta[index] = value3666 def _hasContent(self):3667 if (3668 self.Number is not None or3669 self.Beta3670 ):3671 return True3672 else:3673 return False3674 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='BetasType', pretty_print=True):3675 imported_ns_def_ = GenerateDSNamespaceDefs_.get('BetasType')3676 if imported_ns_def_ is not None:3677 namespacedef_ = imported_ns_def_3678 if pretty_print:3679 eol_ = '\n'3680 else:3681 eol_ = ''3682 if self.original_tagname_ is not None and name_ == 'BetasType':3683 name_ = self.original_tagname_3684 if UseCapturedNS_ and self.ns_prefix_:3685 namespaceprefix_ = self.ns_prefix_ + ':'3686 showIndent(outfile, level, pretty_print)3687 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3688 already_processed = set()3689 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='BetasType')3690 if self._hasContent():3691 outfile.write('>%s' % (eol_, ))3692 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='BetasType', pretty_print=pretty_print)3693 showIndent(outfile, level, pretty_print)3694 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))3695 else:3696 outfile.write('/>%s' % (eol_, ))3697 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='BetasType'):3698 pass3699 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='BetasType', fromsubclass_=False, pretty_print=True):3700 if pretty_print:3701 eol_ = '\n'3702 else:3703 eol_ = ''3704 if self.Number is not None:3705 namespaceprefix_ = self.Number_nsprefix_ + ':' if (UseCapturedNS_ and self.Number_nsprefix_) else ''3706 showIndent(outfile, level, pretty_print)3707 outfile.write('<%sNumber>%s</%sNumber>%s' % (namespaceprefix_ , self.gds_format_integer(self.Number, input_name='Number'), namespaceprefix_ , eol_))3708 for Beta_ in self.Beta:3709 namespaceprefix_ = self.Beta_nsprefix_ + ':' if (UseCapturedNS_ and self.Beta_nsprefix_) else ''3710 Beta_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Beta', pretty_print=pretty_print)3711 def to_etree(self, parent_element=None, name_='BetasType', mapping_=None, reverse_mapping_=None, nsmap_=None):3712 if parent_element is None:3713 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)3714 else:3715 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)3716 if self.Number is not None:3717 Number_ = self.Number3718 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Number').text = self.gds_format_integer(Number_)3719 for Beta_ in self.Beta:3720 Beta_.to_etree(element, name_='Beta', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)3721 if mapping_ is not None:3722 mapping_[id(self)] = element3723 if reverse_mapping_ is not None:3724 reverse_mapping_[element] = self3725 return element3726 def build(self, node, gds_collector_=None):3727 self.gds_collector_ = gds_collector_3728 if SaveElementTreeNode:3729 self.gds_elementtree_node_ = node3730 already_processed = set()3731 self.ns_prefix_ = node.prefix3732 self._buildAttributes(node, node.attrib, already_processed)3733 for child in node:3734 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3735 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)3736 return self3737 def _buildAttributes(self, node, attrs, already_processed):3738 pass3739 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):3740 if nodeName_ == 'Number' and child_.text:3741 sval_ = child_.text3742 ival_ = self.gds_parse_integer(sval_, node, 'Number')3743 ival_ = self.gds_validate_integer(ival_, node, 'Number')3744 self.Number = ival_3745 self.Number_nsprefix_ = child_.prefix3746 elif nodeName_ == 'Beta':3747 obj_ = BetaType.factory(parent_object_=self)3748 obj_.build(child_, gds_collector_=gds_collector_)3749 self.Beta.append(obj_)3750 obj_.original_tagname_ = 'Beta'3751# end class BetasType3752class BetaType(GeneratedsSuper):3753 __hash__ = GeneratedsSuper.__hash__3754 subclass = None3755 superclass = None3756 def __init__(self, Position=None, Label=None, I=None, J=None, Value=None, FlowRef=None, OpZeroOrOne=None, gds_collector_=None, **kwargs_):3757 self.gds_collector_ = gds_collector_3758 self.gds_elementtree_node_ = None3759 self.original_tagname_ = None3760 self.parent_object_ = kwargs_.get('parent_object_')3761 self.ns_prefix_ = None3762 self.Position = _cast(int, Position)3763 self.Position_nsprefix_ = None3764 self.Label = Label3765 self.Label_nsprefix_ = None3766 self.I = I3767 self.I_nsprefix_ = None3768 self.J = J3769 self.J_nsprefix_ = None3770 self.Value = Value3771 self.Value_nsprefix_ = None3772 self.FlowRef = FlowRef3773 self.FlowRef_nsprefix_ = None3774 self.OpZeroOrOne = OpZeroOrOne3775 self.OpZeroOrOne_nsprefix_ = None3776 def factory(*args_, **kwargs_):3777 if CurrentSubclassModule_ is not None:3778 subclass = getSubclassFromModule_(3779 CurrentSubclassModule_, BetaType)3780 if subclass is not None:3781 return subclass(*args_, **kwargs_)3782 if BetaType.subclass:3783 return BetaType.subclass(*args_, **kwargs_)3784 else:3785 return BetaType(*args_, **kwargs_)3786 factory = staticmethod(factory)3787 def get_ns_prefix_(self):3788 return self.ns_prefix_3789 def set_ns_prefix_(self, ns_prefix):3790 self.ns_prefix_ = ns_prefix3791 def get_Label(self):3792 return self.Label3793 def set_Label(self, Label):3794 self.Label = Label3795 def get_I(self):3796 return self.I3797 def set_I(self, I):3798 self.I = I3799 def get_J(self):3800 return self.J3801 def set_J(self, J):3802 self.J = J3803 def get_Value(self):3804 return self.Value3805 def set_Value(self, Value):3806 self.Value = Value3807 def get_FlowRef(self):3808 return self.FlowRef3809 def set_FlowRef(self, FlowRef):3810 self.FlowRef = FlowRef3811 def get_OpZeroOrOne(self):3812 return self.OpZeroOrOne3813 def set_OpZeroOrOne(self, OpZeroOrOne):3814 self.OpZeroOrOne = OpZeroOrOne3815 def get_Position(self):3816 return self.Position3817 def set_Position(self, Position):3818 self.Position = Position3819 def _hasContent(self):3820 if (3821 self.Label is not None or3822 self.I is not None or3823 self.J is not None or3824 self.Value is not None or3825 self.FlowRef is not None or3826 self.OpZeroOrOne is not None3827 ):3828 return True3829 else:3830 return False3831 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='BetaType', pretty_print=True):3832 imported_ns_def_ = GenerateDSNamespaceDefs_.get('BetaType')3833 if imported_ns_def_ is not None:3834 namespacedef_ = imported_ns_def_3835 if pretty_print:3836 eol_ = '\n'3837 else:3838 eol_ = ''3839 if self.original_tagname_ is not None and name_ == 'BetaType':3840 name_ = self.original_tagname_3841 if UseCapturedNS_ and self.ns_prefix_:3842 namespaceprefix_ = self.ns_prefix_ + ':'3843 showIndent(outfile, level, pretty_print)3844 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3845 already_processed = set()3846 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='BetaType')3847 if self._hasContent():3848 outfile.write('>%s' % (eol_, ))3849 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='BetaType', pretty_print=pretty_print)3850 showIndent(outfile, level, pretty_print)3851 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))3852 else:3853 outfile.write('/>%s' % (eol_, ))3854 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='BetaType'):3855 if self.Position is not None and 'Position' not in already_processed:3856 already_processed.add('Position')3857 outfile.write(' Position="%s"' % self.gds_format_integer(self.Position, input_name='Position'))3858 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='BetaType', fromsubclass_=False, pretty_print=True):3859 if pretty_print:3860 eol_ = '\n'3861 else:3862 eol_ = ''3863 if self.Label is not None:3864 namespaceprefix_ = self.Label_nsprefix_ + ':' if (UseCapturedNS_ and self.Label_nsprefix_) else ''3865 showIndent(outfile, level, pretty_print)3866 outfile.write('<%sLabel>%s</%sLabel>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Label), input_name='Label')), namespaceprefix_ , eol_))3867 if self.I is not None:3868 namespaceprefix_ = self.I_nsprefix_ + ':' if (UseCapturedNS_ and self.I_nsprefix_) else ''3869 showIndent(outfile, level, pretty_print)3870 outfile.write('<%sI>%s</%sI>%s' % (namespaceprefix_ , self.gds_format_integer(self.I, input_name='I'), namespaceprefix_ , eol_))3871 if self.J is not None:3872 namespaceprefix_ = self.J_nsprefix_ + ':' if (UseCapturedNS_ and self.J_nsprefix_) else ''3873 showIndent(outfile, level, pretty_print)3874 outfile.write('<%sJ>%s</%sJ>%s' % (namespaceprefix_ , self.gds_format_integer(self.J, input_name='J'), namespaceprefix_ , eol_))3875 if self.Value is not None:3876 namespaceprefix_ = self.Value_nsprefix_ + ':' if (UseCapturedNS_ and self.Value_nsprefix_) else ''3877 showIndent(outfile, level, pretty_print)3878 outfile.write('<%sValue>%s</%sValue>%s' % (namespaceprefix_ , self.gds_format_double(self.Value, input_name='Value'), namespaceprefix_ , eol_))3879 if self.FlowRef is not None:3880 namespaceprefix_ = self.FlowRef_nsprefix_ + ':' if (UseCapturedNS_ and self.FlowRef_nsprefix_) else ''3881 showIndent(outfile, level, pretty_print)3882 outfile.write('<%sFlowRef>%s</%sFlowRef>%s' % (namespaceprefix_ , self.gds_format_integer(self.FlowRef, input_name='FlowRef'), namespaceprefix_ , eol_))3883 if self.OpZeroOrOne is not None:3884 namespaceprefix_ = self.OpZeroOrOne_nsprefix_ + ':' if (UseCapturedNS_ and self.OpZeroOrOne_nsprefix_) else ''3885 showIndent(outfile, level, pretty_print)3886 outfile.write('<%sOpZeroOrOne>%s</%sOpZeroOrOne>%s' % (namespaceprefix_ , self.gds_format_integer(self.OpZeroOrOne, input_name='OpZeroOrOne'), namespaceprefix_ , eol_))3887 def to_etree(self, parent_element=None, name_='BetaType', mapping_=None, reverse_mapping_=None, nsmap_=None):3888 if parent_element is None:3889 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)3890 else:3891 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)3892 if self.Position is not None:3893 element.set('Position', self.gds_format_integer(self.Position))3894 if self.Label is not None:3895 Label_ = self.Label3896 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Label').text = self.gds_format_string(Label_)3897 if self.I is not None:3898 I_ = self.I3899 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}I').text = self.gds_format_integer(I_)3900 if self.J is not None:3901 J_ = self.J3902 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}J').text = self.gds_format_integer(J_)3903 if self.Value is not None:3904 Value_ = self.Value3905 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Value').text = self.gds_format_double(Value_)3906 if self.FlowRef is not None:3907 FlowRef_ = self.FlowRef3908 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}FlowRef').text = self.gds_format_integer(FlowRef_)3909 if self.OpZeroOrOne is not None:3910 OpZeroOrOne_ = self.OpZeroOrOne3911 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}OpZeroOrOne').text = self.gds_format_integer(OpZeroOrOne_)3912 if mapping_ is not None:3913 mapping_[id(self)] = element3914 if reverse_mapping_ is not None:3915 reverse_mapping_[element] = self3916 return element3917 def build(self, node, gds_collector_=None):3918 self.gds_collector_ = gds_collector_3919 if SaveElementTreeNode:3920 self.gds_elementtree_node_ = node3921 already_processed = set()3922 self.ns_prefix_ = node.prefix3923 self._buildAttributes(node, node.attrib, already_processed)3924 for child in node:3925 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3926 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)3927 return self3928 def _buildAttributes(self, node, attrs, already_processed):3929 value = find_attr_value_('Position', node)3930 if value is not None and 'Position' not in already_processed:3931 already_processed.add('Position')3932 self.Position = self.gds_parse_integer(value, node, 'Position')3933 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):3934 if nodeName_ == 'Label':3935 value_ = child_.text3936 value_ = self.gds_parse_string(value_, node, 'Label')3937 value_ = self.gds_validate_string(value_, node, 'Label')3938 self.Label = value_3939 self.Label_nsprefix_ = child_.prefix3940 elif nodeName_ == 'I' and child_.text:3941 sval_ = child_.text3942 ival_ = self.gds_parse_integer(sval_, node, 'I')3943 ival_ = self.gds_validate_integer(ival_, node, 'I')3944 self.I = ival_3945 self.I_nsprefix_ = child_.prefix3946 elif nodeName_ == 'J' and child_.text:3947 sval_ = child_.text3948 ival_ = self.gds_parse_integer(sval_, node, 'J')3949 ival_ = self.gds_validate_integer(ival_, node, 'J')3950 self.J = ival_3951 self.J_nsprefix_ = child_.prefix3952 elif nodeName_ == 'Value' and child_.text:3953 sval_ = child_.text3954 fval_ = self.gds_parse_double(sval_, node, 'Value')3955 fval_ = self.gds_validate_double(fval_, node, 'Value')3956 self.Value = fval_3957 self.Value_nsprefix_ = child_.prefix3958 elif nodeName_ == 'FlowRef' and child_.text:3959 sval_ = child_.text3960 ival_ = self.gds_parse_integer(sval_, node, 'FlowRef')3961 ival_ = self.gds_validate_integer(ival_, node, 'FlowRef')3962 self.FlowRef = ival_3963 self.FlowRef_nsprefix_ = child_.prefix3964 elif nodeName_ == 'OpZeroOrOne' and child_.text:3965 sval_ = child_.text3966 ival_ = self.gds_parse_integer(sval_, node, 'OpZeroOrOne')3967 ival_ = self.gds_validate_integer(ival_, node, 'OpZeroOrOne')3968 self.OpZeroOrOne = ival_3969 self.OpZeroOrOne_nsprefix_ = child_.prefix3970# end class BetaType3971class FunctionalInputsType(GeneratedsSuper):3972 __hash__ = GeneratedsSuper.__hash__3973 subclass = None3974 superclass = None3975 def __init__(self, Number=None, FunctionInput=None, gds_collector_=None, **kwargs_):3976 self.gds_collector_ = gds_collector_3977 self.gds_elementtree_node_ = None3978 self.original_tagname_ = None3979 self.parent_object_ = kwargs_.get('parent_object_')3980 self.ns_prefix_ = None3981 self.Number = Number3982 self.Number_nsprefix_ = None3983 if FunctionInput is None:3984 self.FunctionInput = []3985 else:3986 self.FunctionInput = FunctionInput3987 self.FunctionInput_nsprefix_ = None3988 def factory(*args_, **kwargs_):3989 if CurrentSubclassModule_ is not None:3990 subclass = getSubclassFromModule_(3991 CurrentSubclassModule_, FunctionalInputsType)3992 if subclass is not None:3993 return subclass(*args_, **kwargs_)3994 if FunctionalInputsType.subclass:3995 return FunctionalInputsType.subclass(*args_, **kwargs_)3996 else:3997 return FunctionalInputsType(*args_, **kwargs_)3998 factory = staticmethod(factory)3999 def get_ns_prefix_(self):4000 return self.ns_prefix_4001 def set_ns_prefix_(self, ns_prefix):4002 self.ns_prefix_ = ns_prefix4003 def get_Number(self):4004 return self.Number4005 def set_Number(self, Number):4006 self.Number = Number4007 def get_FunctionInput(self):4008 return self.FunctionInput4009 def set_FunctionInput(self, FunctionInput):4010 self.FunctionInput = FunctionInput4011 def add_FunctionInput(self, value):4012 self.FunctionInput.append(value)4013 def insert_FunctionInput_at(self, index, value):4014 self.FunctionInput.insert(index, value)4015 def replace_FunctionInput_at(self, index, value):4016 self.FunctionInput[index] = value4017 def _hasContent(self):4018 if (4019 self.Number is not None or4020 self.FunctionInput4021 ):4022 return True4023 else:4024 return False4025 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionalInputsType', pretty_print=True):4026 imported_ns_def_ = GenerateDSNamespaceDefs_.get('FunctionalInputsType')4027 if imported_ns_def_ is not None:4028 namespacedef_ = imported_ns_def_4029 if pretty_print:4030 eol_ = '\n'4031 else:4032 eol_ = ''4033 if self.original_tagname_ is not None and name_ == 'FunctionalInputsType':4034 name_ = self.original_tagname_4035 if UseCapturedNS_ and self.ns_prefix_:4036 namespaceprefix_ = self.ns_prefix_ + ':'4037 showIndent(outfile, level, pretty_print)4038 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4039 already_processed = set()4040 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='FunctionalInputsType')4041 if self._hasContent():4042 outfile.write('>%s' % (eol_, ))4043 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='FunctionalInputsType', pretty_print=pretty_print)4044 showIndent(outfile, level, pretty_print)4045 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))4046 else:4047 outfile.write('/>%s' % (eol_, ))4048 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='FunctionalInputsType'):4049 pass4050 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionalInputsType', fromsubclass_=False, pretty_print=True):4051 if pretty_print:4052 eol_ = '\n'4053 else:4054 eol_ = ''4055 if self.Number is not None:4056 namespaceprefix_ = self.Number_nsprefix_ + ':' if (UseCapturedNS_ and self.Number_nsprefix_) else ''4057 showIndent(outfile, level, pretty_print)4058 outfile.write('<%sNumber>%s</%sNumber>%s' % (namespaceprefix_ , self.gds_format_integer(self.Number, input_name='Number'), namespaceprefix_ , eol_))4059 for FunctionInput_ in self.FunctionInput:4060 namespaceprefix_ = self.FunctionInput_nsprefix_ + ':' if (UseCapturedNS_ and self.FunctionInput_nsprefix_) else ''4061 FunctionInput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='FunctionInput', pretty_print=pretty_print)4062 def to_etree(self, parent_element=None, name_='FunctionalInputsType', mapping_=None, reverse_mapping_=None, nsmap_=None):4063 if parent_element is None:4064 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4065 else:4066 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4067 if self.Number is not None:4068 Number_ = self.Number4069 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Number').text = self.gds_format_integer(Number_)4070 for FunctionInput_ in self.FunctionInput:4071 FunctionInput_.to_etree(element, name_='FunctionInput', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)4072 if mapping_ is not None:4073 mapping_[id(self)] = element4074 if reverse_mapping_ is not None:4075 reverse_mapping_[element] = self4076 return element4077 def build(self, node, gds_collector_=None):4078 self.gds_collector_ = gds_collector_4079 if SaveElementTreeNode:4080 self.gds_elementtree_node_ = node4081 already_processed = set()4082 self.ns_prefix_ = node.prefix4083 self._buildAttributes(node, node.attrib, already_processed)4084 for child in node:4085 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4086 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)4087 return self4088 def _buildAttributes(self, node, attrs, already_processed):4089 pass4090 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):4091 if nodeName_ == 'Number' and child_.text:4092 sval_ = child_.text4093 ival_ = self.gds_parse_integer(sval_, node, 'Number')4094 ival_ = self.gds_validate_integer(ival_, node, 'Number')4095 self.Number = ival_4096 self.Number_nsprefix_ = child_.prefix4097 elif nodeName_ == 'FunctionInput':4098 obj_ = FunctionInputType.factory(parent_object_=self)4099 obj_.build(child_, gds_collector_=gds_collector_)4100 self.FunctionInput.append(obj_)4101 obj_.original_tagname_ = 'FunctionInput'4102# end class FunctionalInputsType4103class FunctionInputType(GeneratedsSuper):4104 __hash__ = GeneratedsSuper.__hash__4105 subclass = None4106 superclass = None4107 def __init__(self, Position=None, Label=None, I=None, J=None, Value=None, FlowRef=None, OpZeroOrOne=None, BaseSetInd=None, Script=None, InputReference=None, gds_collector_=None, **kwargs_):4108 self.gds_collector_ = gds_collector_4109 self.gds_elementtree_node_ = None4110 self.original_tagname_ = None4111 self.parent_object_ = kwargs_.get('parent_object_')4112 self.ns_prefix_ = None4113 self.Position = _cast(int, Position)4114 self.Position_nsprefix_ = None4115 self.Label = Label4116 self.Label_nsprefix_ = None4117 self.I = I4118 self.I_nsprefix_ = None4119 self.J = J4120 self.J_nsprefix_ = None4121 self.Value = Value4122 self.Value_nsprefix_ = None4123 self.FlowRef = FlowRef4124 self.FlowRef_nsprefix_ = None4125 self.OpZeroOrOne = OpZeroOrOne4126 self.OpZeroOrOne_nsprefix_ = None4127 self.BaseSetInd = BaseSetInd4128 self.BaseSetInd_nsprefix_ = None4129 self.Script = Script4130 self.Script_nsprefix_ = None4131 self.InputReference = InputReference4132 self.InputReference_nsprefix_ = None4133 def factory(*args_, **kwargs_):4134 if CurrentSubclassModule_ is not None:4135 subclass = getSubclassFromModule_(4136 CurrentSubclassModule_, FunctionInputType)4137 if subclass is not None:4138 return subclass(*args_, **kwargs_)4139 if FunctionInputType.subclass:4140 return FunctionInputType.subclass(*args_, **kwargs_)4141 else:4142 return FunctionInputType(*args_, **kwargs_)4143 factory = staticmethod(factory)4144 def get_ns_prefix_(self):4145 return self.ns_prefix_4146 def set_ns_prefix_(self, ns_prefix):4147 self.ns_prefix_ = ns_prefix4148 def get_Label(self):4149 return self.Label4150 def set_Label(self, Label):4151 self.Label = Label4152 def get_I(self):4153 return self.I4154 def set_I(self, I):4155 self.I = I4156 def get_J(self):4157 return self.J4158 def set_J(self, J):4159 self.J = J4160 def get_Value(self):4161 return self.Value4162 def set_Value(self, Value):4163 self.Value = Value4164 def get_FlowRef(self):4165 return self.FlowRef4166 def set_FlowRef(self, FlowRef):4167 self.FlowRef = FlowRef4168 def get_OpZeroOrOne(self):4169 return self.OpZeroOrOne4170 def set_OpZeroOrOne(self, OpZeroOrOne):4171 self.OpZeroOrOne = OpZeroOrOne4172 def get_BaseSetInd(self):4173 return self.BaseSetInd4174 def set_BaseSetInd(self, BaseSetInd):4175 self.BaseSetInd = BaseSetInd4176 def get_Script(self):4177 return self.Script4178 def set_Script(self, Script):4179 self.Script = Script4180 def get_InputReference(self):4181 return self.InputReference4182 def set_InputReference(self, InputReference):4183 self.InputReference = InputReference4184 def get_Position(self):4185 return self.Position4186 def set_Position(self, Position):4187 self.Position = Position4188 def _hasContent(self):4189 if (4190 self.Label is not None or4191 self.I is not None or4192 self.J is not None or4193 self.Value is not None or4194 self.FlowRef is not None or4195 self.OpZeroOrOne is not None or4196 self.BaseSetInd is not None or4197 self.Script is not None or4198 self.InputReference is not None4199 ):4200 return True4201 else:4202 return False4203 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionInputType', pretty_print=True):4204 imported_ns_def_ = GenerateDSNamespaceDefs_.get('FunctionInputType')4205 if imported_ns_def_ is not None:4206 namespacedef_ = imported_ns_def_4207 if pretty_print:4208 eol_ = '\n'4209 else:4210 eol_ = ''4211 if self.original_tagname_ is not None and name_ == 'FunctionInputType':4212 name_ = self.original_tagname_4213 if UseCapturedNS_ and self.ns_prefix_:4214 namespaceprefix_ = self.ns_prefix_ + ':'4215 showIndent(outfile, level, pretty_print)4216 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4217 already_processed = set()4218 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='FunctionInputType')4219 if self._hasContent():4220 outfile.write('>%s' % (eol_, ))4221 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='FunctionInputType', pretty_print=pretty_print)4222 showIndent(outfile, level, pretty_print)4223 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))4224 else:4225 outfile.write('/>%s' % (eol_, ))4226 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='FunctionInputType'):4227 if self.Position is not None and 'Position' not in already_processed:4228 already_processed.add('Position')4229 outfile.write(' Position="%s"' % self.gds_format_integer(self.Position, input_name='Position'))4230 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionInputType', fromsubclass_=False, pretty_print=True):4231 if pretty_print:4232 eol_ = '\n'4233 else:4234 eol_ = ''4235 if self.Label is not None:4236 namespaceprefix_ = self.Label_nsprefix_ + ':' if (UseCapturedNS_ and self.Label_nsprefix_) else ''4237 showIndent(outfile, level, pretty_print)4238 outfile.write('<%sLabel>%s</%sLabel>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Label), input_name='Label')), namespaceprefix_ , eol_))4239 if self.I is not None:4240 namespaceprefix_ = self.I_nsprefix_ + ':' if (UseCapturedNS_ and self.I_nsprefix_) else ''4241 showIndent(outfile, level, pretty_print)4242 outfile.write('<%sI>%s</%sI>%s' % (namespaceprefix_ , self.gds_format_integer(self.I, input_name='I'), namespaceprefix_ , eol_))4243 if self.J is not None:4244 namespaceprefix_ = self.J_nsprefix_ + ':' if (UseCapturedNS_ and self.J_nsprefix_) else ''4245 showIndent(outfile, level, pretty_print)4246 outfile.write('<%sJ>%s</%sJ>%s' % (namespaceprefix_ , self.gds_format_integer(self.J, input_name='J'), namespaceprefix_ , eol_))4247 if self.Value is not None:4248 namespaceprefix_ = self.Value_nsprefix_ + ':' if (UseCapturedNS_ and self.Value_nsprefix_) else ''4249 showIndent(outfile, level, pretty_print)4250 outfile.write('<%sValue>%s</%sValue>%s' % (namespaceprefix_ , self.gds_format_double(self.Value, input_name='Value'), namespaceprefix_ , eol_))4251 if self.FlowRef is not None:4252 namespaceprefix_ = self.FlowRef_nsprefix_ + ':' if (UseCapturedNS_ and self.FlowRef_nsprefix_) else ''4253 showIndent(outfile, level, pretty_print)4254 outfile.write('<%sFlowRef>%s</%sFlowRef>%s' % (namespaceprefix_ , self.gds_format_integer(self.FlowRef, input_name='FlowRef'), namespaceprefix_ , eol_))4255 if self.OpZeroOrOne is not None:4256 namespaceprefix_ = self.OpZeroOrOne_nsprefix_ + ':' if (UseCapturedNS_ and self.OpZeroOrOne_nsprefix_) else ''4257 showIndent(outfile, level, pretty_print)4258 outfile.write('<%sOpZeroOrOne>%s</%sOpZeroOrOne>%s' % (namespaceprefix_ , self.gds_format_integer(self.OpZeroOrOne, input_name='OpZeroOrOne'), namespaceprefix_ , eol_))4259 if self.BaseSetInd is not None:4260 namespaceprefix_ = self.BaseSetInd_nsprefix_ + ':' if (UseCapturedNS_ and self.BaseSetInd_nsprefix_) else ''4261 showIndent(outfile, level, pretty_print)4262 outfile.write('<%sBaseSetInd>%s</%sBaseSetInd>%s' % (namespaceprefix_ , self.gds_format_integer(self.BaseSetInd, input_name='BaseSetInd'), namespaceprefix_ , eol_))4263 if self.Script is not None:4264 namespaceprefix_ = self.Script_nsprefix_ + ':' if (UseCapturedNS_ and self.Script_nsprefix_) else ''4265 showIndent(outfile, level, pretty_print)4266 outfile.write('<%sScript>%s</%sScript>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Script), input_name='Script')), namespaceprefix_ , eol_))4267 if self.InputReference is not None:4268 namespaceprefix_ = self.InputReference_nsprefix_ + ':' if (UseCapturedNS_ and self.InputReference_nsprefix_) else ''4269 showIndent(outfile, level, pretty_print)4270 outfile.write('<%sInputReference>%s</%sInputReference>%s' % (namespaceprefix_ , self.gds_format_integer(self.InputReference, input_name='InputReference'), namespaceprefix_ , eol_))4271 def to_etree(self, parent_element=None, name_='FunctionInputType', mapping_=None, reverse_mapping_=None, nsmap_=None):4272 if parent_element is None:4273 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4274 else:4275 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4276 if self.Position is not None:4277 element.set('Position', self.gds_format_integer(self.Position))4278 if self.Label is not None:4279 Label_ = self.Label4280 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Label').text = self.gds_format_string(Label_)4281 if self.I is not None:4282 I_ = self.I4283 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}I').text = self.gds_format_integer(I_)4284 if self.J is not None:4285 J_ = self.J4286 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}J').text = self.gds_format_integer(J_)4287 if self.Value is not None:4288 Value_ = self.Value4289 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Value').text = self.gds_format_double(Value_)4290 if self.FlowRef is not None:4291 FlowRef_ = self.FlowRef4292 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}FlowRef').text = self.gds_format_integer(FlowRef_)4293 if self.OpZeroOrOne is not None:4294 OpZeroOrOne_ = self.OpZeroOrOne4295 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}OpZeroOrOne').text = self.gds_format_integer(OpZeroOrOne_)4296 if self.BaseSetInd is not None:4297 BaseSetInd_ = self.BaseSetInd4298 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}BaseSetInd').text = self.gds_format_integer(BaseSetInd_)4299 if self.Script is not None:4300 Script_ = self.Script4301 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Script').text = self.gds_format_string(Script_)4302 if self.InputReference is not None:4303 InputReference_ = self.InputReference4304 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}InputReference').text = self.gds_format_integer(InputReference_)4305 if mapping_ is not None:4306 mapping_[id(self)] = element4307 if reverse_mapping_ is not None:4308 reverse_mapping_[element] = self4309 return element4310 def build(self, node, gds_collector_=None):4311 self.gds_collector_ = gds_collector_4312 if SaveElementTreeNode:4313 self.gds_elementtree_node_ = node4314 already_processed = set()4315 self.ns_prefix_ = node.prefix4316 self._buildAttributes(node, node.attrib, already_processed)4317 for child in node:4318 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4319 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)4320 return self4321 def _buildAttributes(self, node, attrs, already_processed):4322 value = find_attr_value_('Position', node)4323 if value is not None and 'Position' not in already_processed:4324 already_processed.add('Position')4325 self.Position = self.gds_parse_integer(value, node, 'Position')4326 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):4327 if nodeName_ == 'Label':4328 value_ = child_.text4329 value_ = self.gds_parse_string(value_, node, 'Label')4330 value_ = self.gds_validate_string(value_, node, 'Label')4331 self.Label = value_4332 self.Label_nsprefix_ = child_.prefix4333 elif nodeName_ == 'I' and child_.text:4334 sval_ = child_.text4335 ival_ = self.gds_parse_integer(sval_, node, 'I')4336 ival_ = self.gds_validate_integer(ival_, node, 'I')4337 self.I = ival_4338 self.I_nsprefix_ = child_.prefix4339 elif nodeName_ == 'J' and child_.text:4340 sval_ = child_.text4341 ival_ = self.gds_parse_integer(sval_, node, 'J')4342 ival_ = self.gds_validate_integer(ival_, node, 'J')4343 self.J = ival_4344 self.J_nsprefix_ = child_.prefix4345 elif nodeName_ == 'Value' and child_.text:4346 sval_ = child_.text4347 fval_ = self.gds_parse_double(sval_, node, 'Value')4348 fval_ = self.gds_validate_double(fval_, node, 'Value')4349 self.Value = fval_4350 self.Value_nsprefix_ = child_.prefix4351 elif nodeName_ == 'FlowRef' and child_.text:4352 sval_ = child_.text4353 ival_ = self.gds_parse_integer(sval_, node, 'FlowRef')4354 ival_ = self.gds_validate_integer(ival_, node, 'FlowRef')4355 self.FlowRef = ival_4356 self.FlowRef_nsprefix_ = child_.prefix4357 elif nodeName_ == 'OpZeroOrOne' and child_.text:4358 sval_ = child_.text4359 ival_ = self.gds_parse_integer(sval_, node, 'OpZeroOrOne')4360 ival_ = self.gds_validate_integer(ival_, node, 'OpZeroOrOne')4361 self.OpZeroOrOne = ival_4362 self.OpZeroOrOne_nsprefix_ = child_.prefix4363 elif nodeName_ == 'BaseSetInd' and child_.text:4364 sval_ = child_.text4365 ival_ = self.gds_parse_integer(sval_, node, 'BaseSetInd')4366 ival_ = self.gds_validate_integer(ival_, node, 'BaseSetInd')4367 self.BaseSetInd = ival_4368 self.BaseSetInd_nsprefix_ = child_.prefix4369 elif nodeName_ == 'Script':4370 value_ = child_.text4371 value_ = self.gds_parse_string(value_, node, 'Script')4372 value_ = self.gds_validate_string(value_, node, 'Script')4373 self.Script = value_4374 self.Script_nsprefix_ = child_.prefix4375 elif nodeName_ == 'InputReference' and child_.text:4376 sval_ = child_.text4377 ival_ = self.gds_parse_integer(sval_, node, 'InputReference')4378 ival_ = self.gds_validate_integer(ival_, node, 'InputReference')4379 self.InputReference = ival_4380 self.InputReference_nsprefix_ = child_.prefix4381# end class FunctionInputType4382class RedundantFunctionalInputsType(GeneratedsSuper):4383 __hash__ = GeneratedsSuper.__hash__4384 subclass = None4385 superclass = None4386 def __init__(self, Number=None, FunctionInput=None, gds_collector_=None, **kwargs_):4387 self.gds_collector_ = gds_collector_4388 self.gds_elementtree_node_ = None4389 self.original_tagname_ = None4390 self.parent_object_ = kwargs_.get('parent_object_')4391 self.ns_prefix_ = None4392 self.Number = Number4393 self.Number_nsprefix_ = None4394 if FunctionInput is None:4395 self.FunctionInput = []4396 else:4397 self.FunctionInput = FunctionInput4398 self.FunctionInput_nsprefix_ = None4399 def factory(*args_, **kwargs_):4400 if CurrentSubclassModule_ is not None:4401 subclass = getSubclassFromModule_(4402 CurrentSubclassModule_, RedundantFunctionalInputsType)4403 if subclass is not None:4404 return subclass(*args_, **kwargs_)4405 if RedundantFunctionalInputsType.subclass:4406 return RedundantFunctionalInputsType.subclass(*args_, **kwargs_)4407 else:4408 return RedundantFunctionalInputsType(*args_, **kwargs_)4409 factory = staticmethod(factory)4410 def get_ns_prefix_(self):4411 return self.ns_prefix_4412 def set_ns_prefix_(self, ns_prefix):4413 self.ns_prefix_ = ns_prefix4414 def get_Number(self):4415 return self.Number4416 def set_Number(self, Number):4417 self.Number = Number4418 def get_FunctionInput(self):4419 return self.FunctionInput4420 def set_FunctionInput(self, FunctionInput):4421 self.FunctionInput = FunctionInput4422 def add_FunctionInput(self, value):4423 self.FunctionInput.append(value)4424 def insert_FunctionInput_at(self, index, value):4425 self.FunctionInput.insert(index, value)4426 def replace_FunctionInput_at(self, index, value):4427 self.FunctionInput[index] = value4428 def _hasContent(self):4429 if (4430 self.Number is not None or4431 self.FunctionInput4432 ):4433 return True4434 else:4435 return False4436 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='RedundantFunctionalInputsType', pretty_print=True):4437 imported_ns_def_ = GenerateDSNamespaceDefs_.get('RedundantFunctionalInputsType')4438 if imported_ns_def_ is not None:4439 namespacedef_ = imported_ns_def_4440 if pretty_print:4441 eol_ = '\n'4442 else:4443 eol_ = ''4444 if self.original_tagname_ is not None and name_ == 'RedundantFunctionalInputsType':4445 name_ = self.original_tagname_4446 if UseCapturedNS_ and self.ns_prefix_:4447 namespaceprefix_ = self.ns_prefix_ + ':'4448 showIndent(outfile, level, pretty_print)4449 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4450 already_processed = set()4451 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RedundantFunctionalInputsType')4452 if self._hasContent():4453 outfile.write('>%s' % (eol_, ))4454 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RedundantFunctionalInputsType', pretty_print=pretty_print)4455 showIndent(outfile, level, pretty_print)4456 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))4457 else:4458 outfile.write('/>%s' % (eol_, ))4459 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RedundantFunctionalInputsType'):4460 pass4461 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='RedundantFunctionalInputsType', fromsubclass_=False, pretty_print=True):4462 if pretty_print:4463 eol_ = '\n'4464 else:4465 eol_ = ''4466 if self.Number is not None:4467 namespaceprefix_ = self.Number_nsprefix_ + ':' if (UseCapturedNS_ and self.Number_nsprefix_) else ''4468 showIndent(outfile, level, pretty_print)4469 outfile.write('<%sNumber>%s</%sNumber>%s' % (namespaceprefix_ , self.gds_format_integer(self.Number, input_name='Number'), namespaceprefix_ , eol_))4470 for FunctionInput_ in self.FunctionInput:4471 namespaceprefix_ = self.FunctionInput_nsprefix_ + ':' if (UseCapturedNS_ and self.FunctionInput_nsprefix_) else ''4472 FunctionInput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='FunctionInput', pretty_print=pretty_print)4473 def to_etree(self, parent_element=None, name_='RedundantFunctionalInputsType', mapping_=None, reverse_mapping_=None, nsmap_=None):4474 if parent_element is None:4475 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4476 else:4477 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4478 if self.Number is not None:4479 Number_ = self.Number4480 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Number').text = self.gds_format_integer(Number_)4481 for FunctionInput_ in self.FunctionInput:4482 FunctionInput_.to_etree(element, name_='FunctionInput', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_)4483 if mapping_ is not None:4484 mapping_[id(self)] = element4485 if reverse_mapping_ is not None:4486 reverse_mapping_[element] = self4487 return element4488 def build(self, node, gds_collector_=None):4489 self.gds_collector_ = gds_collector_4490 if SaveElementTreeNode:4491 self.gds_elementtree_node_ = node4492 already_processed = set()4493 self.ns_prefix_ = node.prefix4494 self._buildAttributes(node, node.attrib, already_processed)4495 for child in node:4496 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4497 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)4498 return self4499 def _buildAttributes(self, node, attrs, already_processed):4500 pass4501 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):4502 if nodeName_ == 'Number' and child_.text:4503 sval_ = child_.text4504 ival_ = self.gds_parse_integer(sval_, node, 'Number')4505 ival_ = self.gds_validate_integer(ival_, node, 'Number')4506 self.Number = ival_4507 self.Number_nsprefix_ = child_.prefix4508 elif nodeName_ == 'FunctionInput':4509 obj_ = FunctionInputType1.factory(parent_object_=self)4510 obj_.build(child_, gds_collector_=gds_collector_)4511 self.FunctionInput.append(obj_)4512 obj_.original_tagname_ = 'FunctionInput'4513# end class RedundantFunctionalInputsType4514class FunctionInputType1(GeneratedsSuper):4515 __hash__ = GeneratedsSuper.__hash__4516 subclass = None4517 superclass = None4518 def __init__(self, Position=None, Label=None, I=None, J=None, Value=None, FlowRef=None, OpZeroOrOne=None, BaseSetInd=None, Script=None, InputReference=None, gds_collector_=None, **kwargs_):4519 self.gds_collector_ = gds_collector_4520 self.gds_elementtree_node_ = None4521 self.original_tagname_ = None4522 self.parent_object_ = kwargs_.get('parent_object_')4523 self.ns_prefix_ = None4524 self.Position = _cast(int, Position)4525 self.Position_nsprefix_ = None4526 self.Label = Label4527 self.Label_nsprefix_ = None4528 self.I = I4529 self.I_nsprefix_ = None4530 self.J = J4531 self.J_nsprefix_ = None4532 self.Value = Value4533 self.Value_nsprefix_ = None4534 self.FlowRef = FlowRef4535 self.FlowRef_nsprefix_ = None4536 self.OpZeroOrOne = OpZeroOrOne4537 self.OpZeroOrOne_nsprefix_ = None4538 self.BaseSetInd = BaseSetInd4539 self.BaseSetInd_nsprefix_ = None4540 self.Script = Script4541 self.Script_nsprefix_ = None4542 self.InputReference = InputReference4543 self.InputReference_nsprefix_ = None4544 def factory(*args_, **kwargs_):4545 if CurrentSubclassModule_ is not None:4546 subclass = getSubclassFromModule_(4547 CurrentSubclassModule_, FunctionInputType1)4548 if subclass is not None:4549 return subclass(*args_, **kwargs_)4550 if FunctionInputType1.subclass:4551 return FunctionInputType1.subclass(*args_, **kwargs_)4552 else:4553 return FunctionInputType1(*args_, **kwargs_)4554 factory = staticmethod(factory)4555 def get_ns_prefix_(self):4556 return self.ns_prefix_4557 def set_ns_prefix_(self, ns_prefix):4558 self.ns_prefix_ = ns_prefix4559 def get_Label(self):4560 return self.Label4561 def set_Label(self, Label):4562 self.Label = Label4563 def get_I(self):4564 return self.I4565 def set_I(self, I):4566 self.I = I4567 def get_J(self):4568 return self.J4569 def set_J(self, J):4570 self.J = J4571 def get_Value(self):4572 return self.Value4573 def set_Value(self, Value):4574 self.Value = Value4575 def get_FlowRef(self):4576 return self.FlowRef4577 def set_FlowRef(self, FlowRef):4578 self.FlowRef = FlowRef4579 def get_OpZeroOrOne(self):4580 return self.OpZeroOrOne4581 def set_OpZeroOrOne(self, OpZeroOrOne):4582 self.OpZeroOrOne = OpZeroOrOne4583 def get_BaseSetInd(self):4584 return self.BaseSetInd4585 def set_BaseSetInd(self, BaseSetInd):4586 self.BaseSetInd = BaseSetInd4587 def get_Script(self):4588 return self.Script4589 def set_Script(self, Script):4590 self.Script = Script4591 def get_InputReference(self):4592 return self.InputReference4593 def set_InputReference(self, InputReference):4594 self.InputReference = InputReference4595 def get_Position(self):4596 return self.Position4597 def set_Position(self, Position):4598 self.Position = Position4599 def _hasContent(self):4600 if (4601 self.Label is not None or4602 self.I is not None or4603 self.J is not None or4604 self.Value is not None or4605 self.FlowRef is not None or4606 self.OpZeroOrOne is not None or4607 self.BaseSetInd is not None or4608 self.Script is not None or4609 self.InputReference is not None4610 ):4611 return True4612 else:4613 return False4614 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionInputType1', pretty_print=True):4615 imported_ns_def_ = GenerateDSNamespaceDefs_.get('FunctionInputType1')4616 if imported_ns_def_ is not None:4617 namespacedef_ = imported_ns_def_4618 if pretty_print:4619 eol_ = '\n'4620 else:4621 eol_ = ''4622 if self.original_tagname_ is not None and name_ == 'FunctionInputType1':4623 name_ = self.original_tagname_4624 if UseCapturedNS_ and self.ns_prefix_:4625 namespaceprefix_ = self.ns_prefix_ + ':'4626 showIndent(outfile, level, pretty_print)4627 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4628 already_processed = set()4629 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='FunctionInputType1')4630 if self._hasContent():4631 outfile.write('>%s' % (eol_, ))4632 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='FunctionInputType1', pretty_print=pretty_print)4633 showIndent(outfile, level, pretty_print)4634 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))4635 else:4636 outfile.write('/>%s' % (eol_, ))4637 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='FunctionInputType1'):4638 if self.Position is not None and 'Position' not in already_processed:4639 already_processed.add('Position')4640 outfile.write(' Position="%s"' % self.gds_format_integer(self.Position, input_name='Position'))4641 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='FunctionInputType1', fromsubclass_=False, pretty_print=True):4642 if pretty_print:4643 eol_ = '\n'4644 else:4645 eol_ = ''4646 if self.Label is not None:4647 namespaceprefix_ = self.Label_nsprefix_ + ':' if (UseCapturedNS_ and self.Label_nsprefix_) else ''4648 showIndent(outfile, level, pretty_print)4649 outfile.write('<%sLabel>%s</%sLabel>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Label), input_name='Label')), namespaceprefix_ , eol_))4650 if self.I is not None:4651 namespaceprefix_ = self.I_nsprefix_ + ':' if (UseCapturedNS_ and self.I_nsprefix_) else ''4652 showIndent(outfile, level, pretty_print)4653 outfile.write('<%sI>%s</%sI>%s' % (namespaceprefix_ , self.gds_format_integer(self.I, input_name='I'), namespaceprefix_ , eol_))4654 if self.J is not None:4655 namespaceprefix_ = self.J_nsprefix_ + ':' if (UseCapturedNS_ and self.J_nsprefix_) else ''4656 showIndent(outfile, level, pretty_print)4657 outfile.write('<%sJ>%s</%sJ>%s' % (namespaceprefix_ , self.gds_format_integer(self.J, input_name='J'), namespaceprefix_ , eol_))4658 if self.Value is not None:4659 namespaceprefix_ = self.Value_nsprefix_ + ':' if (UseCapturedNS_ and self.Value_nsprefix_) else ''4660 showIndent(outfile, level, pretty_print)4661 outfile.write('<%sValue>%s</%sValue>%s' % (namespaceprefix_ , self.gds_format_double(self.Value, input_name='Value'), namespaceprefix_ , eol_))4662 if self.FlowRef is not None:4663 namespaceprefix_ = self.FlowRef_nsprefix_ + ':' if (UseCapturedNS_ and self.FlowRef_nsprefix_) else ''4664 showIndent(outfile, level, pretty_print)4665 outfile.write('<%sFlowRef>%s</%sFlowRef>%s' % (namespaceprefix_ , self.gds_format_integer(self.FlowRef, input_name='FlowRef'), namespaceprefix_ , eol_))4666 if self.OpZeroOrOne is not None:4667 namespaceprefix_ = self.OpZeroOrOne_nsprefix_ + ':' if (UseCapturedNS_ and self.OpZeroOrOne_nsprefix_) else ''4668 showIndent(outfile, level, pretty_print)4669 outfile.write('<%sOpZeroOrOne>%s</%sOpZeroOrOne>%s' % (namespaceprefix_ , self.gds_format_integer(self.OpZeroOrOne, input_name='OpZeroOrOne'), namespaceprefix_ , eol_))4670 if self.BaseSetInd is not None:4671 namespaceprefix_ = self.BaseSetInd_nsprefix_ + ':' if (UseCapturedNS_ and self.BaseSetInd_nsprefix_) else ''4672 showIndent(outfile, level, pretty_print)4673 outfile.write('<%sBaseSetInd>%s</%sBaseSetInd>%s' % (namespaceprefix_ , self.gds_format_integer(self.BaseSetInd, input_name='BaseSetInd'), namespaceprefix_ , eol_))4674 if self.Script is not None:4675 namespaceprefix_ = self.Script_nsprefix_ + ':' if (UseCapturedNS_ and self.Script_nsprefix_) else ''4676 showIndent(outfile, level, pretty_print)4677 outfile.write('<%sScript>%s</%sScript>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Script), input_name='Script')), namespaceprefix_ , eol_))4678 if self.InputReference is not None:4679 namespaceprefix_ = self.InputReference_nsprefix_ + ':' if (UseCapturedNS_ and self.InputReference_nsprefix_) else ''4680 showIndent(outfile, level, pretty_print)4681 outfile.write('<%sInputReference>%s</%sInputReference>%s' % (namespaceprefix_ , self.gds_format_integer(self.InputReference, input_name='InputReference'), namespaceprefix_ , eol_))4682 def to_etree(self, parent_element=None, name_='FunctionInputType1', mapping_=None, reverse_mapping_=None, nsmap_=None):4683 if parent_element is None:4684 element = etree_.Element('{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4685 else:4686 element = etree_.SubElement(parent_element, '{https://github.com/wdatasci/WDS-ModelSpec}' + name_, nsmap=nsmap_)4687 if self.Position is not None:4688 element.set('Position', self.gds_format_integer(self.Position))4689 if self.Label is not None:4690 Label_ = self.Label4691 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Label').text = self.gds_format_string(Label_)4692 if self.I is not None:4693 I_ = self.I4694 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}I').text = self.gds_format_integer(I_)4695 if self.J is not None:4696 J_ = self.J4697 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}J').text = self.gds_format_integer(J_)4698 if self.Value is not None:4699 Value_ = self.Value4700 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Value').text = self.gds_format_double(Value_)4701 if self.FlowRef is not None:4702 FlowRef_ = self.FlowRef4703 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}FlowRef').text = self.gds_format_integer(FlowRef_)4704 if self.OpZeroOrOne is not None:4705 OpZeroOrOne_ = self.OpZeroOrOne4706 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}OpZeroOrOne').text = self.gds_format_integer(OpZeroOrOne_)4707 if self.BaseSetInd is not None:4708 BaseSetInd_ = self.BaseSetInd4709 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}BaseSetInd').text = self.gds_format_integer(BaseSetInd_)4710 if self.Script is not None:4711 Script_ = self.Script4712 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}Script').text = self.gds_format_string(Script_)4713 if self.InputReference is not None:4714 InputReference_ = self.InputReference4715 etree_.SubElement(element, '{https://github.com/wdatasci/WDS-ModelSpec}InputReference').text = self.gds_format_integer(InputReference_)4716 if mapping_ is not None:4717 mapping_[id(self)] = element4718 if reverse_mapping_ is not None:4719 reverse_mapping_[element] = self4720 return element4721 def build(self, node, gds_collector_=None):4722 self.gds_collector_ = gds_collector_4723 if SaveElementTreeNode:4724 self.gds_elementtree_node_ = node4725 already_processed = set()4726 self.ns_prefix_ = node.prefix4727 self._buildAttributes(node, node.attrib, already_processed)4728 for child in node:4729 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4730 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)4731 return self4732 def _buildAttributes(self, node, attrs, already_processed):4733 value = find_attr_value_('Position', node)4734 if value is not None and 'Position' not in already_processed:4735 already_processed.add('Position')4736 self.Position = self.gds_parse_integer(value, node, 'Position')4737 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):4738 if nodeName_ == 'Label':4739 value_ = child_.text4740 value_ = self.gds_parse_string(value_, node, 'Label')4741 value_ = self.gds_validate_string(value_, node, 'Label')4742 self.Label = value_4743 self.Label_nsprefix_ = child_.prefix4744 elif nodeName_ == 'I' and child_.text:4745 sval_ = child_.text4746 ival_ = self.gds_parse_integer(sval_, node, 'I')4747 ival_ = self.gds_validate_integer(ival_, node, 'I')4748 self.I = ival_4749 self.I_nsprefix_ = child_.prefix4750 elif nodeName_ == 'J' and child_.text:4751 sval_ = child_.text4752 ival_ = self.gds_parse_integer(sval_, node, 'J')4753 ival_ = self.gds_validate_integer(ival_, node, 'J')4754 self.J = ival_4755 self.J_nsprefix_ = child_.prefix4756 elif nodeName_ == 'Value' and child_.text:4757 sval_ = child_.text4758 fval_ = self.gds_parse_double(sval_, node, 'Value')4759 fval_ = self.gds_validate_double(fval_, node, 'Value')4760 self.Value = fval_4761 self.Value_nsprefix_ = child_.prefix4762 elif nodeName_ == 'FlowRef' and child_.text:4763 sval_ = child_.text4764 ival_ = self.gds_parse_integer(sval_, node, 'FlowRef')4765 ival_ = self.gds_validate_integer(ival_, node, 'FlowRef')4766 self.FlowRef = ival_4767 self.FlowRef_nsprefix_ = child_.prefix4768 elif nodeName_ == 'OpZeroOrOne' and child_.text:4769 sval_ = child_.text4770 ival_ = self.gds_parse_integer(sval_, node, 'OpZeroOrOne')4771 ival_ = self.gds_validate_integer(ival_, node, 'OpZeroOrOne')4772 self.OpZeroOrOne = ival_4773 self.OpZeroOrOne_nsprefix_ = child_.prefix...

Full Screen

Full Screen

gWDSMatrix_literal.py

Source:gWDSMatrix_literal.py Github

copy

Full Screen

...303 fval_ = float(input_data)304 except (TypeError, ValueError) as exp:305 raise_parse_error(node, 'Requires double or float value: %s' % exp)306 return fval_307 def gds_validate_double(self, input_data, node=None, input_name=''):308 try:309 value = float(input_data)310 except (TypeError, ValueError):311 raise_parse_error(node, 'Requires double or float value')312 return value313 def gds_format_double_list(self, input_data, input_name=''):314 if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):315 input_data = [str(s) for s in input_data]316 return '%s' % ' '.join(input_data)317 def gds_validate_double_list(318 self, input_data, node=None, input_name=''):319 values = input_data.split()320 for value in values:321 try:322 float(value)323 except (TypeError, ValueError):324 raise_parse_error(325 node, 'Requires sequence of double or float values')326 return values327 def gds_format_boolean(self, input_data, input_name=''):328 return ('%s' % input_data).lower()329 def gds_parse_boolean(self, input_data, node=None, input_name=''):330 input_data = input_data.strip()331 if input_data in ('true', '1'):332 bval = True333 elif input_data in ('false', '0'):334 bval = False335 else:336 raise_parse_error(node, 'Requires boolean value')337 return bval338 def gds_validate_boolean(self, input_data, node=None, input_name=''):339 if input_data not in (True, 1, False, 0, ):340 raise_parse_error(341 node,342 'Requires boolean value '343 '(one of True, 1, False, 0)')344 return input_data345 def gds_format_boolean_list(self, input_data, input_name=''):346 if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):347 input_data = [str(s) for s in input_data]348 return '%s' % ' '.join(input_data)349 def gds_validate_boolean_list(350 self, input_data, node=None, input_name=''):351 values = input_data.split()352 for value in values:353 value = self.gds_parse_boolean(value, node, input_name)354 if value not in (True, 1, False, 0, ):355 raise_parse_error(356 node,357 'Requires sequence of boolean values '358 '(one of True, 1, False, 0)')359 return values360 def gds_validate_datetime(self, input_data, node=None, input_name=''):361 return input_data362 def gds_format_datetime(self, input_data, input_name=''):363 if input_data.microsecond == 0:364 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (365 input_data.year,366 input_data.month,367 input_data.day,368 input_data.hour,369 input_data.minute,370 input_data.second,371 )372 else:373 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (374 input_data.year,375 input_data.month,376 input_data.day,377 input_data.hour,378 input_data.minute,379 input_data.second,380 ('%f' % (float(input_data.microsecond) / 1000000))[2:],381 )382 if input_data.tzinfo is not None:383 tzoff = input_data.tzinfo.utcoffset(input_data)384 if tzoff is not None:385 total_seconds = tzoff.seconds + (86400 * tzoff.days)386 if total_seconds == 0:387 _svalue += 'Z'388 else:389 if total_seconds < 0:390 _svalue += '-'391 total_seconds *= -1392 else:393 _svalue += '+'394 hours = total_seconds // 3600395 minutes = (total_seconds - (hours * 3600)) // 60396 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)397 return _svalue398 @classmethod399 def gds_parse_datetime(cls, input_data):400 tz = None401 if input_data[-1] == 'Z':402 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')403 input_data = input_data[:-1]404 else:405 results = GeneratedsSuper.tzoff_pattern.search(input_data)406 if results is not None:407 tzoff_parts = results.group(2).split(':')408 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])409 if results.group(1) == '-':410 tzoff *= -1411 tz = GeneratedsSuper._FixedOffsetTZ(412 tzoff, results.group(0))413 input_data = input_data[:-6]414 time_parts = input_data.split('.')415 if len(time_parts) > 1:416 micro_seconds = int(float('0.' + time_parts[1]) * 1000000)417 input_data = '%s.%s' % (418 time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )419 dt = datetime_.datetime.strptime(420 input_data, '%Y-%m-%dT%H:%M:%S.%f')421 else:422 dt = datetime_.datetime.strptime(423 input_data, '%Y-%m-%dT%H:%M:%S')424 dt = dt.replace(tzinfo=tz)425 return dt426 def gds_validate_date(self, input_data, node=None, input_name=''):427 return input_data428 def gds_format_date(self, input_data, input_name=''):429 _svalue = '%04d-%02d-%02d' % (430 input_data.year,431 input_data.month,432 input_data.day,433 )434 try:435 if input_data.tzinfo is not None:436 tzoff = input_data.tzinfo.utcoffset(input_data)437 if tzoff is not None:438 total_seconds = tzoff.seconds + (86400 * tzoff.days)439 if total_seconds == 0:440 _svalue += 'Z'441 else:442 if total_seconds < 0:443 _svalue += '-'444 total_seconds *= -1445 else:446 _svalue += '+'447 hours = total_seconds // 3600448 minutes = (total_seconds - (hours * 3600)) // 60449 _svalue += '{0:02d}:{1:02d}'.format(450 hours, minutes)451 except AttributeError:452 pass453 return _svalue454 @classmethod455 def gds_parse_date(cls, input_data):456 tz = None457 if input_data[-1] == 'Z':458 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')459 input_data = input_data[:-1]460 else:461 results = GeneratedsSuper.tzoff_pattern.search(input_data)462 if results is not None:463 tzoff_parts = results.group(2).split(':')464 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])465 if results.group(1) == '-':466 tzoff *= -1467 tz = GeneratedsSuper._FixedOffsetTZ(468 tzoff, results.group(0))469 input_data = input_data[:-6]470 dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')471 dt = dt.replace(tzinfo=tz)472 return dt.date()473 def gds_validate_time(self, input_data, node=None, input_name=''):474 return input_data475 def gds_format_time(self, input_data, input_name=''):476 if input_data.microsecond == 0:477 _svalue = '%02d:%02d:%02d' % (478 input_data.hour,479 input_data.minute,480 input_data.second,481 )482 else:483 _svalue = '%02d:%02d:%02d.%s' % (484 input_data.hour,485 input_data.minute,486 input_data.second,487 ('%f' % (float(input_data.microsecond) / 1000000))[2:],488 )489 if input_data.tzinfo is not None:490 tzoff = input_data.tzinfo.utcoffset(input_data)491 if tzoff is not None:492 total_seconds = tzoff.seconds + (86400 * tzoff.days)493 if total_seconds == 0:494 _svalue += 'Z'495 else:496 if total_seconds < 0:497 _svalue += '-'498 total_seconds *= -1499 else:500 _svalue += '+'501 hours = total_seconds // 3600502 minutes = (total_seconds - (hours * 3600)) // 60503 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)504 return _svalue505 def gds_validate_simple_patterns(self, patterns, target):506 # pat is a list of lists of strings/patterns.507 # The target value must match at least one of the patterns508 # in order for the test to succeed.509 found1 = True510 target = str(target)511 for patterns1 in patterns:512 found2 = False513 for patterns2 in patterns1:514 mo = re_.search(patterns2, target)515 if mo is not None and len(mo.group(0)) == len(target):516 found2 = True517 break518 if not found2:519 found1 = False520 break521 return found1522 @classmethod523 def gds_parse_time(cls, input_data):524 tz = None525 if input_data[-1] == 'Z':526 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')527 input_data = input_data[:-1]528 else:529 results = GeneratedsSuper.tzoff_pattern.search(input_data)530 if results is not None:531 tzoff_parts = results.group(2).split(':')532 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])533 if results.group(1) == '-':534 tzoff *= -1535 tz = GeneratedsSuper._FixedOffsetTZ(536 tzoff, results.group(0))537 input_data = input_data[:-6]538 if len(input_data.split('.')) > 1:539 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')540 else:541 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')542 dt = dt.replace(tzinfo=tz)543 return dt.time()544 def gds_check_cardinality_(545 self, value, input_name,546 min_occurs=0, max_occurs=1, required=None):547 if value is None:548 length = 0549 elif isinstance(value, list):550 length = len(value)551 else:552 length = 1553 if required is not None :554 if required and length < 1:555 self.gds_collector_.add_message(556 "Required value {}{} is missing".format(557 input_name, self.gds_get_node_lineno_()))558 if length < min_occurs:559 self.gds_collector_.add_message(560 "Number of values for {}{} is below "561 "the minimum allowed, "562 "expected at least {}, found {}".format(563 input_name, self.gds_get_node_lineno_(),564 min_occurs, length))565 elif length > max_occurs:566 self.gds_collector_.add_message(567 "Number of values for {}{} is above "568 "the maximum allowed, "569 "expected at most {}, found {}".format(570 input_name, self.gds_get_node_lineno_(),571 max_occurs, length))572 def gds_validate_builtin_ST_(573 self, validator, value, input_name,574 min_occurs=None, max_occurs=None, required=None):575 if value is not None:576 try:577 validator(value, input_name=input_name)578 except GDSParseError as parse_error:579 self.gds_collector_.add_message(str(parse_error))580 def gds_validate_defined_ST_(581 self, validator, value, input_name,582 min_occurs=None, max_occurs=None, required=None):583 if value is not None:584 try:585 validator(value)586 except GDSParseError as parse_error:587 self.gds_collector_.add_message(str(parse_error))588 def gds_str_lower(self, instring):589 return instring.lower()590 def get_path_(self, node):591 path_list = []592 self.get_path_list_(node, path_list)593 path_list.reverse()594 path = '/'.join(path_list)595 return path596 Tag_strip_pattern_ = re_.compile(r'\{.*\}')597 def get_path_list_(self, node, path_list):598 if node is None:599 return600 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)601 if tag:602 path_list.append(tag)603 self.get_path_list_(node.getparent(), path_list)604 def get_class_obj_(self, node, default_class=None):605 class_obj1 = default_class606 if 'xsi' in node.nsmap:607 classname = node.get('{%s}type' % node.nsmap['xsi'])608 if classname is not None:609 names = classname.split(':')610 if len(names) == 2:611 classname = names[1]612 class_obj2 = globals().get(classname)613 if class_obj2 is not None:614 class_obj1 = class_obj2615 return class_obj1616 def gds_build_any(self, node, type_name=None):617 # provide default value in case option --disable-xml is used.618 content = ""619 content = etree_.tostring(node, encoding="unicode")620 return content621 @classmethod622 def gds_reverse_node_mapping(cls, mapping):623 return dict(((v, k) for k, v in mapping.items()))624 @staticmethod625 def gds_encode(instring):626 if sys.version_info.major == 2:627 if ExternalEncoding:628 encoding = ExternalEncoding629 else:630 encoding = 'utf-8'631 return instring.encode(encoding)632 else:633 return instring634 @staticmethod635 def convert_unicode(instring):636 if isinstance(instring, str):637 result = quote_xml(instring)638 elif sys.version_info.major == 2 and isinstance(instring, unicode):639 result = quote_xml(instring).encode('utf8')640 else:641 result = GeneratedsSuper.gds_encode(str(instring))642 return result643 def __eq__(self, other):644 def excl_select_objs_(obj):645 return (obj[0] != 'parent_object_' and646 obj[0] != 'gds_collector_')647 if type(self) != type(other):648 return False649 return all(x == y for x, y in zip_longest(650 filter(excl_select_objs_, self.__dict__.items()),651 filter(excl_select_objs_, other.__dict__.items())))652 def __ne__(self, other):653 return not self.__eq__(other)654 # Django ETL transform hooks.655 def gds_djo_etl_transform(self):656 pass657 def gds_djo_etl_transform_db_obj(self, dbobj):658 pass659 # SQLAlchemy ETL transform hooks.660 def gds_sqa_etl_transform(self):661 return 0, None662 def gds_sqa_etl_transform_db_obj(self, dbobj):663 pass664 def gds_get_node_lineno_(self):665 if (hasattr(self, "gds_elementtree_node_") and666 self.gds_elementtree_node_ is not None):667 return ' near line {}'.format(668 self.gds_elementtree_node_.sourceline)669 else:670 return ""671 672 673 def getSubclassFromModule_(module, class_):674 '''Get the subclass of a class from a specific module.'''675 name = class_.__name__ + 'Sub'676 if hasattr(module, name):677 return getattr(module, name)678 else:679 return None680#681# If you have installed IPython you can uncomment and use the following.682# IPython is available from http://ipython.scipy.org/.683#684## from IPython.Shell import IPShellEmbed685## args = ''686## ipshell = IPShellEmbed(args,687## banner = 'Dropping into IPython',688## exit_msg = 'Leaving Interpreter, back to program.')689# Then use the following line where and when you want to drop into the690# IPython shell:691# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')692#693# Globals694#695ExternalEncoding = ''696# Set this to false in order to deactivate during export, the use of697# name space prefixes captured from the input document.698UseCapturedNS_ = True699CapturedNsmap_ = {}700Tag_pattern_ = re_.compile(r'({.*})?(.*)')701String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")702Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')703CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)704# Change this to redirect the generated superclass module to use a705# specific subclass module.706CurrentSubclassModule_ = None707#708# Support/utility functions.709#710def showIndent(outfile, level, pretty_print=True):711 if pretty_print:712 for idx in range(level):713 outfile.write(' ')714def quote_xml(inStr):715 "Escape markup chars, but do not modify CDATA sections."716 if not inStr:717 return ''718 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)719 s2 = ''720 pos = 0721 matchobjects = CDATA_pattern_.finditer(s1)722 for mo in matchobjects:723 s3 = s1[pos:mo.start()]724 s2 += quote_xml_aux(s3)725 s2 += s1[mo.start():mo.end()]726 pos = mo.end()727 s3 = s1[pos:]728 s2 += quote_xml_aux(s3)729 return s2730def quote_xml_aux(inStr):731 s1 = inStr.replace('&', '&amp;')732 s1 = s1.replace('<', '&lt;')733 s1 = s1.replace('>', '&gt;')734 return s1735def quote_attrib(inStr):736 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)737 s1 = s1.replace('&', '&amp;')738 s1 = s1.replace('<', '&lt;')739 s1 = s1.replace('>', '&gt;')740 s1 = s1.replace('\n', '&#10;')741 if '"' in s1:742 if "'" in s1:743 s1 = '"%s"' % s1.replace('"', "&quot;")744 else:745 s1 = "'%s'" % s1746 else:747 s1 = '"%s"' % s1748 return s1749def quote_python(inStr):750 s1 = inStr751 if s1.find("'") == -1:752 if s1.find('\n') == -1:753 return "'%s'" % s1754 else:755 return "'''%s'''" % s1756 else:757 if s1.find('"') != -1:758 s1 = s1.replace('"', '\\"')759 if s1.find('\n') == -1:760 return '"%s"' % s1761 else:762 return '"""%s"""' % s1763def get_all_text_(node):764 if node.text is not None:765 text = node.text766 else:767 text = ''768 for child in node:769 if child.tail is not None:770 text += child.tail771 return text772def find_attr_value_(attr_name, node):773 attrs = node.attrib774 attr_parts = attr_name.split(':')775 value = None776 if len(attr_parts) == 1:777 value = attrs.get(attr_name)778 elif len(attr_parts) == 2:779 prefix, name = attr_parts780 if prefix == 'xml':781 namespace = 'http://www.w3.org/XML/1998/namespace'782 else:783 namespace = node.nsmap.get(prefix)784 if namespace is not None:785 value = attrs.get('{%s}%s' % (namespace, name, ))786 return value787def encode_str_2_3(instr):788 return instr789class GDSParseError(Exception):790 pass791def raise_parse_error(node, msg):792 if node is not None:793 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )794 raise GDSParseError(msg)795class MixedContainer:796 # Constants for category:797 CategoryNone = 0798 CategoryText = 1799 CategorySimple = 2800 CategoryComplex = 3801 # Constants for content_type:802 TypeNone = 0803 TypeText = 1804 TypeString = 2805 TypeInteger = 3806 TypeFloat = 4807 TypeDecimal = 5808 TypeDouble = 6809 TypeBoolean = 7810 TypeBase64 = 8811 def __init__(self, category, content_type, name, value):812 self.category = category813 self.content_type = content_type814 self.name = name815 self.value = value816 def getCategory(self):817 return self.category818 def getContenttype(self, content_type):819 return self.content_type820 def getValue(self):821 return self.value822 def getName(self):823 return self.name824 def export(self, outfile, level, name, namespace,825 pretty_print=True):826 if self.category == MixedContainer.CategoryText:827 # Prevent exporting empty content as empty lines.828 if self.value.strip():829 outfile.write(self.value)830 elif self.category == MixedContainer.CategorySimple:831 self.exportSimple(outfile, level, name)832 else: # category == MixedContainer.CategoryComplex833 self.value.export(834 outfile, level, namespace, name_=name,835 pretty_print=pretty_print)836 def exportSimple(self, outfile, level, name):837 if self.content_type == MixedContainer.TypeString:838 outfile.write('<%s>%s</%s>' % (839 self.name, self.value, self.name))840 elif self.content_type == MixedContainer.TypeInteger or \841 self.content_type == MixedContainer.TypeBoolean:842 outfile.write('<%s>%d</%s>' % (843 self.name, self.value, self.name))844 elif self.content_type == MixedContainer.TypeFloat or \845 self.content_type == MixedContainer.TypeDecimal:846 outfile.write('<%s>%f</%s>' % (847 self.name, self.value, self.name))848 elif self.content_type == MixedContainer.TypeDouble:849 outfile.write('<%s>%g</%s>' % (850 self.name, self.value, self.name))851 elif self.content_type == MixedContainer.TypeBase64:852 outfile.write('<%s>%s</%s>' % (853 self.name,854 base64.b64encode(self.value),855 self.name))856 def to_etree(self, element, mapping_=None, reverse_mapping_=None, nsmap_=None):857 if self.category == MixedContainer.CategoryText:858 # Prevent exporting empty content as empty lines.859 if self.value.strip():860 if len(element) > 0:861 if element[-1].tail is None:862 element[-1].tail = self.value863 else:864 element[-1].tail += self.value865 else:866 if element.text is None:867 element.text = self.value868 else:869 element.text += self.value870 elif self.category == MixedContainer.CategorySimple:871 subelement = etree_.SubElement(872 element, '%s' % self.name)873 subelement.text = self.to_etree_simple()874 else: # category == MixedContainer.CategoryComplex875 self.value.to_etree(element)876 def to_etree_simple(self, mapping_=None, reverse_mapping_=None, nsmap_=None):877 if self.content_type == MixedContainer.TypeString:878 text = self.value879 elif (self.content_type == MixedContainer.TypeInteger or880 self.content_type == MixedContainer.TypeBoolean):881 text = '%d' % self.value882 elif (self.content_type == MixedContainer.TypeFloat or883 self.content_type == MixedContainer.TypeDecimal):884 text = '%f' % self.value885 elif self.content_type == MixedContainer.TypeDouble:886 text = '%g' % self.value887 elif self.content_type == MixedContainer.TypeBase64:888 text = '%s' % base64.b64encode(self.value)889 return text890 def exportLiteral(self, outfile, level, name):891 if self.category == MixedContainer.CategoryText:892 showIndent(outfile, level)893 outfile.write(894 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (895 self.category, self.content_type,896 self.name, self.value))897 elif self.category == MixedContainer.CategorySimple:898 showIndent(outfile, level)899 outfile.write(900 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (901 self.category, self.content_type,902 self.name, self.value))903 else: # category == MixedContainer.CategoryComplex904 showIndent(outfile, level)905 outfile.write(906 'model_.MixedContainer(%d, %d, "%s",\n' % (907 self.category, self.content_type, self.name,))908 self.value.exportLiteral(outfile, level + 1)909 showIndent(outfile, level)910 outfile.write(')\n')911class MemberSpec_(object):912 def __init__(self, name='', data_type='', container=0,913 optional=0, child_attrs=None, choice=None):914 self.name = name915 self.data_type = data_type916 self.container = container917 self.child_attrs = child_attrs918 self.choice = choice919 self.optional = optional920 def set_name(self, name): self.name = name921 def get_name(self): return self.name922 def set_data_type(self, data_type): self.data_type = data_type923 def get_data_type_chain(self): return self.data_type924 def get_data_type(self):925 if isinstance(self.data_type, list):926 if len(self.data_type) > 0:927 return self.data_type[-1]928 else:929 return 'xs:string'930 else:931 return self.data_type932 def set_container(self, container): self.container = container933 def get_container(self): return self.container934 def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs935 def get_child_attrs(self): return self.child_attrs936 def set_choice(self, choice): self.choice = choice937 def get_choice(self): return self.choice938 def set_optional(self, optional): self.optional = optional939 def get_optional(self): return self.optional940def _cast(typ, value):941 if typ is None or value is None:942 return value943 return typ(value)944#945# Data representation classes.946#947class WDSMatrix(GeneratedsSuper):948 __hash__ = GeneratedsSuper.__hash__949 subclass = None950 superclass = None951 def __init__(self, Name=None, NumberOfStates=None, NumberOfAdditionalAxes=None, ProvidesNonZeroCoords=None, AdditionalAxesUpperLimits=None, AdditionalAxesLowerLimits=None, StateLabels=None, NonZeroElements=None, MData=None, Betas=None, FunctionalInputs=None, RedundantFunctionalInputs=None, gds_collector_=None, **kwargs_):952 self.gds_collector_ = gds_collector_953 self.gds_elementtree_node_ = None954 self.original_tagname_ = None955 self.parent_object_ = kwargs_.get('parent_object_')956 self.ns_prefix_ = None957 self.Name = _cast(None, Name)958 self.Name_nsprefix_ = None959 self.NumberOfStates = NumberOfStates960 self.NumberOfStates_nsprefix_ = None961 self.NumberOfAdditionalAxes = NumberOfAdditionalAxes962 self.NumberOfAdditionalAxes_nsprefix_ = None963 self.ProvidesNonZeroCoords = ProvidesNonZeroCoords964 self.ProvidesNonZeroCoords_nsprefix_ = None965 self.AdditionalAxesUpperLimits = AdditionalAxesUpperLimits966 self.AdditionalAxesUpperLimits_nsprefix_ = None967 self.AdditionalAxesLowerLimits = AdditionalAxesLowerLimits968 self.AdditionalAxesLowerLimits_nsprefix_ = None969 self.StateLabels = StateLabels970 self.StateLabels_nsprefix_ = None971 self.NonZeroElements = NonZeroElements972 self.NonZeroElements_nsprefix_ = None973 if MData is None:974 self.MData = []975 else:976 self.MData = MData977 self.MData_nsprefix_ = None978 self.Betas = Betas979 self.Betas_nsprefix_ = None980 self.FunctionalInputs = FunctionalInputs981 self.FunctionalInputs_nsprefix_ = None982 self.RedundantFunctionalInputs = RedundantFunctionalInputs983 self.RedundantFunctionalInputs_nsprefix_ = None984 def factory(*args_, **kwargs_):985 if CurrentSubclassModule_ is not None:986 subclass = getSubclassFromModule_(987 CurrentSubclassModule_, WDSMatrix)988 if subclass is not None:989 return subclass(*args_, **kwargs_)990 if WDSMatrix.subclass:991 return WDSMatrix.subclass(*args_, **kwargs_)992 else:993 return WDSMatrix(*args_, **kwargs_)994 factory = staticmethod(factory)995 def get_ns_prefix_(self):996 return self.ns_prefix_997 def set_ns_prefix_(self, ns_prefix):998 self.ns_prefix_ = ns_prefix999 def get_NumberOfStates(self):1000 return self.NumberOfStates1001 def set_NumberOfStates(self, NumberOfStates):1002 self.NumberOfStates = NumberOfStates1003 def get_NumberOfAdditionalAxes(self):1004 return self.NumberOfAdditionalAxes1005 def set_NumberOfAdditionalAxes(self, NumberOfAdditionalAxes):1006 self.NumberOfAdditionalAxes = NumberOfAdditionalAxes1007 def get_ProvidesNonZeroCoords(self):1008 return self.ProvidesNonZeroCoords1009 def set_ProvidesNonZeroCoords(self, ProvidesNonZeroCoords):1010 self.ProvidesNonZeroCoords = ProvidesNonZeroCoords1011 def get_AdditionalAxesUpperLimits(self):1012 return self.AdditionalAxesUpperLimits1013 def set_AdditionalAxesUpperLimits(self, AdditionalAxesUpperLimits):1014 self.AdditionalAxesUpperLimits = AdditionalAxesUpperLimits1015 def get_AdditionalAxesLowerLimits(self):1016 return self.AdditionalAxesLowerLimits1017 def set_AdditionalAxesLowerLimits(self, AdditionalAxesLowerLimits):1018 self.AdditionalAxesLowerLimits = AdditionalAxesLowerLimits1019 def get_StateLabels(self):1020 return self.StateLabels1021 def set_StateLabels(self, StateLabels):1022 self.StateLabels = StateLabels1023 def get_NonZeroElements(self):1024 return self.NonZeroElements1025 def set_NonZeroElements(self, NonZeroElements):1026 self.NonZeroElements = NonZeroElements1027 def get_MData(self):1028 return self.MData1029 def set_MData(self, MData):1030 self.MData = MData1031 def add_MData(self, value):1032 self.MData.append(value)1033 def insert_MData_at(self, index, value):1034 self.MData.insert(index, value)1035 def replace_MData_at(self, index, value):1036 self.MData[index] = value1037 def get_Betas(self):1038 return self.Betas1039 def set_Betas(self, Betas):1040 self.Betas = Betas1041 def get_FunctionalInputs(self):1042 return self.FunctionalInputs1043 def set_FunctionalInputs(self, FunctionalInputs):1044 self.FunctionalInputs = FunctionalInputs1045 def get_RedundantFunctionalInputs(self):1046 return self.RedundantFunctionalInputs1047 def set_RedundantFunctionalInputs(self, RedundantFunctionalInputs):1048 self.RedundantFunctionalInputs = RedundantFunctionalInputs1049 def get_Name(self):1050 return self.Name1051 def set_Name(self, Name):1052 self.Name = Name1053 def _hasContent(self):1054 if (1055 self.NumberOfStates is not None or1056 self.NumberOfAdditionalAxes is not None or1057 self.ProvidesNonZeroCoords is not None or1058 self.AdditionalAxesUpperLimits is not None or1059 self.AdditionalAxesLowerLimits is not None or1060 self.StateLabels is not None or1061 self.NonZeroElements is not None or1062 self.MData or1063 self.Betas is not None or1064 self.FunctionalInputs is not None or1065 self.RedundantFunctionalInputs is not None1066 ):1067 return True1068 else:1069 return False1070 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='WDSMatrix', pretty_print=True):1071 imported_ns_def_ = GenerateDSNamespaceDefs_.get('WDSMatrix')1072 if imported_ns_def_ is not None:1073 namespacedef_ = imported_ns_def_1074 if pretty_print:1075 eol_ = '\n'1076 else:1077 eol_ = ''1078 if self.original_tagname_ is not None and name_ == 'WDSMatrix':1079 name_ = self.original_tagname_1080 if UseCapturedNS_ and self.ns_prefix_:1081 namespaceprefix_ = self.ns_prefix_ + ':'1082 showIndent(outfile, level, pretty_print)1083 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1084 already_processed = set()1085 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='WDSMatrix')1086 if self._hasContent():1087 outfile.write('>%s' % (eol_, ))1088 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='WDSMatrix', pretty_print=pretty_print)1089 showIndent(outfile, level, pretty_print)1090 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1091 else:1092 outfile.write('/>%s' % (eol_, ))1093 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='WDSMatrix'):1094 if self.Name is not None and 'Name' not in already_processed:1095 already_processed.add('Name')1096 outfile.write(' Name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Name), input_name='Name')), ))1097 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='WDSMatrix', fromsubclass_=False, pretty_print=True):1098 if pretty_print:1099 eol_ = '\n'1100 else:1101 eol_ = ''1102 if self.NumberOfStates is not None:1103 namespaceprefix_ = self.NumberOfStates_nsprefix_ + ':' if (UseCapturedNS_ and self.NumberOfStates_nsprefix_) else ''1104 showIndent(outfile, level, pretty_print)1105 outfile.write('<%sNumberOfStates>%s</%sNumberOfStates>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumberOfStates, input_name='NumberOfStates'), namespaceprefix_ , eol_))1106 if self.NumberOfAdditionalAxes is not None:1107 namespaceprefix_ = self.NumberOfAdditionalAxes_nsprefix_ + ':' if (UseCapturedNS_ and self.NumberOfAdditionalAxes_nsprefix_) else ''1108 showIndent(outfile, level, pretty_print)1109 outfile.write('<%sNumberOfAdditionalAxes>%s</%sNumberOfAdditionalAxes>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumberOfAdditionalAxes, input_name='NumberOfAdditionalAxes'), namespaceprefix_ , eol_))1110 if self.ProvidesNonZeroCoords is not None:1111 namespaceprefix_ = self.ProvidesNonZeroCoords_nsprefix_ + ':' if (UseCapturedNS_ and self.ProvidesNonZeroCoords_nsprefix_) else ''1112 showIndent(outfile, level, pretty_print)1113 outfile.write('<%sProvidesNonZeroCoords>%s</%sProvidesNonZeroCoords>%s' % (namespaceprefix_ , self.gds_format_integer(self.ProvidesNonZeroCoords, input_name='ProvidesNonZeroCoords'), namespaceprefix_ , eol_))1114 if self.AdditionalAxesUpperLimits is not None:1115 namespaceprefix_ = self.AdditionalAxesUpperLimits_nsprefix_ + ':' if (UseCapturedNS_ and self.AdditionalAxesUpperLimits_nsprefix_) else ''1116 self.AdditionalAxesUpperLimits.export(outfile, level, namespaceprefix_, namespacedef_='', name_='AdditionalAxesUpperLimits', pretty_print=pretty_print)1117 if self.AdditionalAxesLowerLimits is not None:1118 namespaceprefix_ = self.AdditionalAxesLowerLimits_nsprefix_ + ':' if (UseCapturedNS_ and self.AdditionalAxesLowerLimits_nsprefix_) else ''1119 self.AdditionalAxesLowerLimits.export(outfile, level, namespaceprefix_, namespacedef_='', name_='AdditionalAxesLowerLimits', pretty_print=pretty_print)1120 if self.StateLabels is not None:1121 namespaceprefix_ = self.StateLabels_nsprefix_ + ':' if (UseCapturedNS_ and self.StateLabels_nsprefix_) else ''1122 self.StateLabels.export(outfile, level, namespaceprefix_, namespacedef_='', name_='StateLabels', pretty_print=pretty_print)1123 if self.NonZeroElements is not None:1124 namespaceprefix_ = self.NonZeroElements_nsprefix_ + ':' if (UseCapturedNS_ and self.NonZeroElements_nsprefix_) else ''1125 self.NonZeroElements.export(outfile, level, namespaceprefix_, namespacedef_='', name_='NonZeroElements', pretty_print=pretty_print)1126 for MData_ in self.MData:1127 namespaceprefix_ = self.MData_nsprefix_ + ':' if (UseCapturedNS_ and self.MData_nsprefix_) else ''1128 MData_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='MData', pretty_print=pretty_print)1129 if self.Betas is not None:1130 namespaceprefix_ = self.Betas_nsprefix_ + ':' if (UseCapturedNS_ and self.Betas_nsprefix_) else ''1131 self.Betas.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Betas', pretty_print=pretty_print)1132 if self.FunctionalInputs is not None:1133 namespaceprefix_ = self.FunctionalInputs_nsprefix_ + ':' if (UseCapturedNS_ and self.FunctionalInputs_nsprefix_) else ''1134 self.FunctionalInputs.export(outfile, level, namespaceprefix_, namespacedef_='', name_='FunctionalInputs', pretty_print=pretty_print)1135 if self.RedundantFunctionalInputs is not None:1136 namespaceprefix_ = self.RedundantFunctionalInputs_nsprefix_ + ':' if (UseCapturedNS_ and self.RedundantFunctionalInputs_nsprefix_) else ''1137 self.RedundantFunctionalInputs.export(outfile, level, namespaceprefix_, namespacedef_='', name_='RedundantFunctionalInputs', pretty_print=pretty_print)1138 def exportLiteral(self, outfile, level, name_='WDSMatrix'):1139 level += 11140 already_processed = set()1141 self._exportLiteralAttributes(outfile, level, already_processed, name_)1142 if self._hasContent():1143 self._exportLiteralChildren(outfile, level, name_)1144 def _exportLiteralAttributes(self, outfile, level, already_processed, name_):1145 if self.Name is not None and 'Name' not in already_processed:1146 already_processed.add('Name')1147 showIndent(outfile, level)1148 outfile.write('Name="%s",\n' % (self.Name,))1149 def _exportLiteralChildren(self, outfile, level, name_):1150 if self.NumberOfStates is not None:1151 showIndent(outfile, level)1152 outfile.write('NumberOfStates=%d,\n' % self.NumberOfStates)1153 if self.NumberOfAdditionalAxes is not None:1154 showIndent(outfile, level)1155 outfile.write('NumberOfAdditionalAxes=%d,\n' % self.NumberOfAdditionalAxes)1156 if self.ProvidesNonZeroCoords is not None:1157 showIndent(outfile, level)1158 outfile.write('ProvidesNonZeroCoords=%d,\n' % self.ProvidesNonZeroCoords)1159 if self.AdditionalAxesUpperLimits is not None:1160 showIndent(outfile, level)1161 outfile.write('AdditionalAxesUpperLimits=model_.AdditionalAxesUpperLimitsType(\n')1162 self.AdditionalAxesUpperLimits.exportLiteral(outfile, level, name_='AdditionalAxesUpperLimits')1163 showIndent(outfile, level)1164 outfile.write('),\n')1165 if self.AdditionalAxesLowerLimits is not None:1166 showIndent(outfile, level)1167 outfile.write('AdditionalAxesLowerLimits=model_.AdditionalAxesLowerLimitsType(\n')1168 self.AdditionalAxesLowerLimits.exportLiteral(outfile, level, name_='AdditionalAxesLowerLimits')1169 showIndent(outfile, level)1170 outfile.write('),\n')1171 if self.StateLabels is not None:1172 showIndent(outfile, level)1173 outfile.write('StateLabels=model_.StateLabelsType(\n')1174 self.StateLabels.exportLiteral(outfile, level, name_='StateLabels')1175 showIndent(outfile, level)1176 outfile.write('),\n')1177 if self.NonZeroElements is not None:1178 showIndent(outfile, level)1179 outfile.write('NonZeroElements=model_.NonZeroElementsType(\n')1180 self.NonZeroElements.exportLiteral(outfile, level, name_='NonZeroElements')1181 showIndent(outfile, level)1182 outfile.write('),\n')1183 showIndent(outfile, level)1184 outfile.write('MData=[\n')1185 level += 11186 for MData_ in self.MData:1187 showIndent(outfile, level)1188 outfile.write('model_.MDataType(\n')1189 MData_.exportLiteral(outfile, level, name_='MDataType')1190 showIndent(outfile, level)1191 outfile.write('),\n')1192 level -= 11193 showIndent(outfile, level)1194 outfile.write('],\n')1195 if self.Betas is not None:1196 showIndent(outfile, level)1197 outfile.write('Betas=model_.BetasType(\n')1198 self.Betas.exportLiteral(outfile, level, name_='Betas')1199 showIndent(outfile, level)1200 outfile.write('),\n')1201 if self.FunctionalInputs is not None:1202 showIndent(outfile, level)1203 outfile.write('FunctionalInputs=model_.FunctionalInputsType(\n')1204 self.FunctionalInputs.exportLiteral(outfile, level, name_='FunctionalInputs')1205 showIndent(outfile, level)1206 outfile.write('),\n')1207 if self.RedundantFunctionalInputs is not None:1208 showIndent(outfile, level)1209 outfile.write('RedundantFunctionalInputs=model_.RedundantFunctionalInputsType(\n')1210 self.RedundantFunctionalInputs.exportLiteral(outfile, level, name_='RedundantFunctionalInputs')1211 showIndent(outfile, level)1212 outfile.write('),\n')1213 def build(self, node, gds_collector_=None):1214 self.gds_collector_ = gds_collector_1215 if SaveElementTreeNode:1216 self.gds_elementtree_node_ = node1217 already_processed = set()1218 self.ns_prefix_ = node.prefix1219 self._buildAttributes(node, node.attrib, already_processed)1220 for child in node:1221 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1222 self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)1223 return self1224 def _buildAttributes(self, node, attrs, already_processed):1225 value = find_attr_value_('Name', node)1226 if value is not None and 'Name' not in already_processed:1227 already_processed.add('Name')1228 self.Name = value1229 def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):1230 if nodeName_ == 'NumberOfStates' and child_.text:1231 sval_ = child_.text1232 ival_ = self.gds_parse_integer(sval_, node, 'NumberOfStates')1233 ival_ = self.gds_validate_integer(ival_, node, 'NumberOfStates')1234 self.NumberOfStates = ival_1235 self.NumberOfStates_nsprefix_ = child_.prefix1236 elif nodeName_ == 'NumberOfAdditionalAxes' and child_.text:1237 sval_ = child_.text1238 ival_ = self.gds_parse_integer(sval_, node, 'NumberOfAdditionalAxes')1239 ival_ = self.gds_validate_integer(ival_, node, 'NumberOfAdditionalAxes')1240 self.NumberOfAdditionalAxes = ival_1241 self.NumberOfAdditionalAxes_nsprefix_ = child_.prefix1242 elif nodeName_ == 'ProvidesNonZeroCoords' and child_.text:1243 sval_ = child_.text1244 ival_ = self.gds_parse_integer(sval_, node, 'ProvidesNonZeroCoords')1245 ival_ = self.gds_validate_integer(ival_, node, 'ProvidesNonZeroCoords')1246 self.ProvidesNonZeroCoords = ival_1247 self.ProvidesNonZeroCoords_nsprefix_ = child_.prefix1248 elif nodeName_ == 'AdditionalAxesUpperLimits':1249 obj_ = AdditionalAxesUpperLimitsType.factory(parent_object_=self)1250 obj_.build(child_, gds_collector_=gds_collector_)1251 self.AdditionalAxesUpperLimits = obj_1252 obj_.original_tagname_ = 'AdditionalAxesUpperLimits'1253 elif nodeName_ == 'AdditionalAxesLowerLimits':1254 obj_ = AdditionalAxesLowerLimitsType.factory(parent_object_=self)1255 obj_.build(child_, gds_collector_=gds_collector_)1256 self.AdditionalAxesLowerLimits = obj_1257 obj_.original_tagname_ = 'AdditionalAxesLowerLimits'1258 elif nodeName_ == 'StateLabels':1259 obj_ = StateLabelsType.factory(parent_object_=self)1260 obj_.build(child_, gds_collector_=gds_collector_)1261 self.StateLabels = obj_1262 obj_.original_tagname_ = 'StateLabels'1263 elif nodeName_ == 'NonZeroElements':1264 obj_ = NonZeroElementsType.factory(parent_object_=self)1265 obj_.build(child_, gds_collector_=gds_collector_)1266 self.NonZeroElements = obj_1267 obj_.original_tagname_ = 'NonZeroElements'1268 elif nodeName_ == 'MData':1269 obj_ = MDataType.factory(parent_object_=self)1270 obj_.build(child_, gds_collector_=gds_collector_)1271 self.MData.append(obj_)1272 obj_.original_tagname_ = 'MData'1273 elif nodeName_ == 'Betas':1274 obj_ = BetasType.factory(parent_object_=self)1275 obj_.build(child_, gds_collector_=gds_collector_)1276 self.Betas = obj_1277 obj_.original_tagname_ = 'Betas'1278 elif nodeName_ == 'FunctionalInputs':1279 obj_ = FunctionalInputsType.factory(parent_object_=self)1280 obj_.build(child_, gds_collector_=gds_collector_)1281 self.FunctionalInputs = obj_1282 obj_.original_tagname_ = 'FunctionalInputs'1283 elif nodeName_ == 'RedundantFunctionalInputs':1284 obj_ = RedundantFunctionalInputsType.factory(parent_object_=self)1285 obj_.build(child_, gds_collector_=gds_collector_)1286 self.RedundantFunctionalInputs = obj_1287 obj_.original_tagname_ = 'RedundantFunctionalInputs'1288# end class WDSMatrix1289class AdditionalAxesUpperLimitsType(GeneratedsSuper):1290 __hash__ = GeneratedsSuper.__hash__1291 subclass = None1292 superclass = None1293 def __init__(self, Axis1=None, Axis2=None, Axis3=None, Axis4=None, gds_collector_=None, **kwargs_):1294 self.gds_collector_ = gds_collector_1295 self.gds_elementtree_node_ = None1296 self.original_tagname_ = None1297 self.parent_object_ = kwargs_.get('parent_object_')1298 self.ns_prefix_ = None1299 self.Axis1 = Axis11300 self.Axis1_nsprefix_ = None1301 self.Axis2 = Axis21302 self.Axis2_nsprefix_ = None1303 self.Axis3 = Axis31304 self.Axis3_nsprefix_ = None1305 self.Axis4 = Axis41306 self.Axis4_nsprefix_ = None1307 def factory(*args_, **kwargs_):1308 if CurrentSubclassModule_ is not None:1309 subclass = getSubclassFromModule_(1310 CurrentSubclassModule_, AdditionalAxesUpperLimitsType)1311 if subclass is not None:1312 return subclass(*args_, **kwargs_)1313 if AdditionalAxesUpperLimitsType.subclass:1314 return AdditionalAxesUpperLimitsType.subclass(*args_, **kwargs_)1315 else:1316 return AdditionalAxesUpperLimitsType(*args_, **kwargs_)1317 factory = staticmethod(factory)1318 def get_ns_prefix_(self):1319 return self.ns_prefix_1320 def set_ns_prefix_(self, ns_prefix):1321 self.ns_prefix_ = ns_prefix1322 def get_Axis1(self):1323 return self.Axis11324 def set_Axis1(self, Axis1):1325 self.Axis1 = Axis11326 def get_Axis2(self):1327 return self.Axis21328 def set_Axis2(self, Axis2):1329 self.Axis2 = Axis21330 def get_Axis3(self):1331 return self.Axis31332 def set_Axis3(self, Axis3):1333 self.Axis3 = Axis31334 def get_Axis4(self):1335 return self.Axis41336 def set_Axis4(self, Axis4):1337 self.Axis4 = Axis41338 def _hasContent(self):1339 if (1340 self.Axis1 is not None or1341 self.Axis2 is not None or1342 self.Axis3 is not None or1343 self.Axis4 is not None1344 ):1345 return True1346 else:1347 return False1348 def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesUpperLimitsType', pretty_print=True):1349 imported_ns_def_ = GenerateDSNamespaceDefs_.get('AdditionalAxesUpperLimitsType')1350 if imported_ns_def_ is not None:1351 namespacedef_ = imported_ns_def_1352 if pretty_print:1353 eol_ = '\n'1354 else:1355 eol_ = ''1356 if self.original_tagname_ is not None and name_ == 'AdditionalAxesUpperLimitsType':1357 name_ = self.original_tagname_1358 if UseCapturedNS_ and self.ns_prefix_:1359 namespaceprefix_ = self.ns_prefix_ + ':'1360 showIndent(outfile, level, pretty_print)1361 outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1362 already_processed = set()1363 self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='AdditionalAxesUpperLimitsType')1364 if self._hasContent():1365 outfile.write('>%s' % (eol_, ))1366 self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='AdditionalAxesUpperLimitsType', pretty_print=pretty_print)1367 showIndent(outfile, level, pretty_print)1368 outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))1369 else:1370 outfile.write('/>%s' % (eol_, ))1371 def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='AdditionalAxesUpperLimitsType'):1372 pass1373 def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:wds="https://github.com/wdatasci/WDS-ModelSpec"', name_='AdditionalAxesUpperLimitsType', fromsubclass_=False, pretty_print=True):1374 if pretty_print:1375 eol_ = '\n'1376 else:1377 eol_ = ''1378 if self.Axis1 is not None:1379 namespaceprefix_ = self.Axis1_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis1_nsprefix_) else ''1380 showIndent(outfile, level, pretty_print)1381 outfile.write('<%sAxis1>%s</%sAxis1>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis1, input_name='Axis1'), namespaceprefix_ , eol_))1382 if self.Axis2 is not None:1383 namespaceprefix_ = self.Axis2_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis2_nsprefix_) else ''1384 showIndent(outfile, level, pretty_print)1385 outfile.write('<%sAxis2>%s</%sAxis2>%s' % (namespaceprefix_ , self.gds_format_integer(self.Axis2, input_name='Axis2'), namespaceprefix_ , eol_))1386 if self.Axis3 is not None:1387 namespaceprefix_ = self.Axis3_nsprefix_ + ':' if (UseCapturedNS_ and self.Axis3_nsprefix_) else ''1388 showIndent(outfile, level, pretty_print)1389