#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Fri Dec 11 16:55:58 2015 by generateDS.py version 2.17a.
#
# Command line options:
# ('--user-methods', 'emdb_user_methods')
# ('--external-encoding', 'utf-8')
# ('-f', '')
# ('-o', 'emdb_da.py')
#
# Command line arguments:
# ../schema/emdb_da.xsd
#
# Command line:
# ../generateDS-2.17a0/build/scripts-2.7/generateDS.py --user-methods="emdb_user_methods" --external-encoding="utf-8" -f -o "emdb_da.py" ../schema/emdb_da.xsd
#
# Current working directory (os.getcwd()):
# emdbXMLTranslator
#
import sys
import re as re_
import base64
import datetime as datetime_
import warnings as warnings_
from lxml import etree as etree_
Validate_simpletypes_ = True
def parsexml_(infile, parser=None, **kwargs):
if parser is None:
# Use the lxml ElementTree compatible parser so that, e.g.,
# we ignore comments.
parser = etree_.ETCompatXMLParser()
doc = etree_.parse(infile, parser=parser, **kwargs)
return doc
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError as exp:
class GeneratedsSuper(object):
tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
class _FixedOffsetTZ(datetime_.tzinfo):
def __init__(self, offset, name):
self.__offset = datetime_.timedelta(minutes=offset)
self.__name = name
def utcoffset(self, dt):
return self.__offset
def tzname(self, dt):
return self.__name
def dst(self, dt):
return None
def gds_format_string(self, input_data, input_name=''):
return input_data
def gds_validate_string(self, input_data, node=None, input_name=''):
if not input_data:
return ''
else:
return input_data
def gds_format_base64(self, input_data, input_name=''):
return base64.b64encode(input_data)
def gds_validate_base64(self, input_data, node=None, input_name=''):
return input_data
def gds_format_integer(self, input_data, input_name=''):
return '%d' % input_data
def gds_validate_integer(self, input_data, node=None, input_name=''):
return input_data
def gds_format_integer_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_integer_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
int(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of integers')
return values
def gds_format_float(self, input_data, input_name=''):
return ('%.15f' % input_data).rstrip('0')
def gds_validate_float(self, input_data, node=None, input_name=''):
return input_data
def gds_format_float_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_float_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of floats')
return values
def gds_format_double(self, input_data, input_name=''):
return '%e' % input_data
def gds_validate_double(self, input_data, node=None, input_name=''):
return input_data
def gds_format_double_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_double_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of doubles')
return values
def gds_format_boolean(self, input_data, input_name=''):
return ('%s' % input_data).lower()
def gds_validate_boolean(self, input_data, node=None, input_name=''):
return input_data
def gds_format_boolean_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_boolean_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
if value not in ('true', '1', 'false', '0', ):
raise_parse_error(
node,
'Requires sequence of booleans '
'("true", "1", "false", "0")')
return values
def gds_validate_datetime(self, input_data, node=None, input_name=''):
return input_data
def gds_format_datetime(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
@classmethod
def gds_parse_datetime(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
time_parts = input_data.split('.')
if len(time_parts) > 1:
micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
input_data = '%s.%s' % (time_parts[0], micro_seconds, )
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt
def gds_validate_date(self, input_data, node=None, input_name=''):
return input_data
def gds_format_date(self, input_data, input_name=''):
_svalue = '%04d-%02d-%02d' % (
input_data.year,
input_data.month,
input_data.day,
)
try:
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
except AttributeError:
pass
return _svalue
@classmethod
def gds_parse_date(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
dt = dt.replace(tzinfo=tz)
return dt.date()
def gds_validate_time(self, input_data, node=None, input_name=''):
return input_data
def gds_format_time(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%02d:%02d:%02d' % (
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%02d:%02d:%02d.%s' % (
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
def gds_validate_simple_patterns(self, patterns, target):
# pat is a list of lists of strings/patterns. We should:
# - AND the outer elements
# - OR the inner elements
found1 = True
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
if re_.search(patterns2, target) is not None:
found2 = True
break
if not found2:
found1 = False
break
return found1
@classmethod
def gds_parse_time(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
if len(input_data.split('.')) > 1:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt.time()
def gds_str_lower(self, instring):
return instring.lower()
def get_path_(self, node):
path_list = []
self.get_path_list_(node, path_list)
path_list.reverse()
path = '/'.join(path_list)
return path
Tag_strip_pattern_ = re_.compile(r'\{.*\}')
def get_path_list_(self, node, path_list):
if node is None:
return
tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
if tag:
path_list.append(tag)
self.get_path_list_(node.getparent(), path_list)
def get_class_obj_(self, node, default_class=None):
class_obj1 = default_class
if 'xsi' in node.nsmap:
classname = node.get('{%s}type' % node.nsmap['xsi'])
if classname is not None:
names = classname.split(':')
if len(names) == 2:
classname = names[1]
class_obj2 = globals().get(classname)
if class_obj2 is not None:
class_obj1 = class_obj2
return class_obj1
def gds_build_any(self, node, type_name=None):
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = 'utf-8'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
#
# Support/utility functions.
#
def showIndent(outfile, level, pretty_print=True):
if pretty_print:
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
"Escape markup chars, but do not modify CDATA sections."
if not inStr:
return ''
s1 = (isinstance(inStr, basestring) and inStr or
'%s' % inStr)
s2 = ''
pos = 0
matchobjects = CDATA_pattern_.finditer(s1)
for mo in matchobjects:
s3 = s1[pos:mo.start()]
s2 += quote_xml_aux(s3)
s2 += s1[mo.start():mo.end()]
pos = mo.end()
s3 = s1[pos:]
s2 += quote_xml_aux(s3)
return s2
def quote_xml_aux(inStr):
s1 = inStr.replace('&', '&')
s1 = s1.replace('<', '<')
s1 = s1.replace('>', '>')
return s1
def quote_attrib(inStr):
s1 = (isinstance(inStr, basestring) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&')
s1 = s1.replace('<', '<')
s1 = s1.replace('>', '>')
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', """)
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
def get_all_text_(node):
if node.text is not None:
text = node.text
else:
text = ''
for child in node:
if child.tail is not None:
text += child.tail
return text
def find_attr_value_(attr_name, node):
attrs = node.attrib
attr_parts = attr_name.split(':')
value = None
if len(attr_parts) == 1:
value = attrs.get(attr_name)
elif len(attr_parts) == 2:
prefix, name = attr_parts
namespace = node.nsmap.get(prefix)
if namespace is not None:
value = attrs.get('{%s}%s' % (namespace, name, ))
return value
class GDSParseError(Exception):
pass
def raise_parse_error(node, msg):
msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
raise GDSParseError(msg)
class MixedContainer:
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
TypeBase64 = 8
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
def export(self, outfile, level, name, namespace, pretty_print=True):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
outfile.write(self.value)
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
self.value.export(outfile, level, namespace, name, pretty_print)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeInteger or \
self.content_type == MixedContainer.TypeBoolean:
outfile.write('<%s>%d</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeFloat or \
self.content_type == MixedContainer.TypeDecimal:
outfile.write('<%s>%f</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeDouble:
outfile.write('<%s>%g</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeBase64:
outfile.write('<%s>%s</%s>' % (
self.name, base64.b64encode(self.value), self.name))
def to_etree(self, element):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
if len(element) > 0:
if element[-1].tail is None:
element[-1].tail = self.value
else:
element[-1].tail += self.value
else:
if element.text is None:
element.text = self.value
else:
element.text += self.value
elif self.category == MixedContainer.CategorySimple:
subelement = etree_.SubElement(element, '%s' % self.name)
subelement.text = self.to_etree_simple()
else: # category == MixedContainer.CategoryComplex
self.value.to_etree(element)
def to_etree_simple(self):
if self.content_type == MixedContainer.TypeString:
text = self.value
elif (self.content_type == MixedContainer.TypeInteger or
self.content_type == MixedContainer.TypeBoolean):
text = '%d' % self.value
elif (self.content_type == MixedContainer.TypeFloat or
self.content_type == MixedContainer.TypeDecimal):
text = '%f' % self.value
elif self.content_type == MixedContainer.TypeDouble:
text = '%g' % self.value
elif self.content_type == MixedContainer.TypeBase64:
text = '%s' % base64.b64encode(self.value)
return text
def exportLiteral(self, outfile, level, name):
if self.category == MixedContainer.CategoryText:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type, self.name, self.value))
elif self.category == MixedContainer.CategorySimple:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type, self.name, self.value))
else: # category == MixedContainer.CategoryComplex
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s",\n' % (
self.category, self.content_type, self.name,))
self.value.exportLiteral(outfile, level + 1)
showIndent(outfile, level)
outfile.write(')\n')
class MemberSpec_(object):
def __init__(self, name='', data_type='', container=0):
self.name = name
self.data_type = data_type
self.container = container
def set_name(self, name): self.name = name
def get_name(self): return self.name
def set_data_type(self, data_type): self.data_type = data_type
def get_data_type_chain(self): return self.data_type
def get_data_type(self):
if isinstance(self.data_type, list):
if len(self.data_type) > 0:
return self.data_type[-1]
else:
return 'xs:string'
else:
return self.data_type
def set_container(self, container): self.container = container
def get_container(self): return self.container
def _cast(typ, value):
if typ is None or value is None:
return value
return typ(value)
#
# Data representation classes.
#
[docs]class entry_type(GeneratedsSuper):
"""For example: EMD-1001The XML schema version that validates the
header file. This attribute should contain a default value: the
current schema version."""
member_data_items_ = [
MemberSpec_('emdb_id', 'emdb_id_type', 0),
MemberSpec_('version', 'xs:token', 0),
MemberSpec_('admin', 'admin_type', 0),
MemberSpec_('crossreferences', 'crossreferences_type', 0),
MemberSpec_('sample', 'sample', 0),
MemberSpec_('structure_determination_list', 'structure_determination_listType', 0),
MemberSpec_('map', 'map_type', 0),
MemberSpec_('interpretation', 'interpretation_type', 0),
MemberSpec_('validation', 'validationType', 0),
]
subclass = None
superclass = None
def __init__(self, emdb_id=None, version=None, admin=None, crossreferences=None, sample=None, structure_determination_list=None, map=None, interpretation=None, validation=None):
self.original_tagname_ = None
self.emdb_id = _cast(None, emdb_id)
self.version = _cast(None, version)
self.admin = admin
self.crossreferences = crossreferences
self.sample = sample
self.structure_determination_list = structure_determination_list
self.map = map
self.interpretation = interpretation
self.validation = validation
[docs] def factory(*args_, **kwargs_):
if entry_type.subclass:
return entry_type.subclass(*args_, **kwargs_)
else:
return entry_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_admin(self): return self.admin
[docs] def set_admin(self, admin): self.admin = admin
[docs] def get_crossreferences(self): return self.crossreferences
[docs] def set_crossreferences(self, crossreferences): self.crossreferences = crossreferences
[docs] def get_sample(self): return self.sample
[docs] def set_sample(self, sample): self.sample = sample
[docs] def get_structure_determination_list(self): return self.structure_determination_list
[docs] def set_structure_determination_list(self, structure_determination_list): self.structure_determination_list = structure_determination_list
[docs] def get_map(self): return self.map
[docs] def set_map(self, map): self.map = map
[docs] def get_interpretation(self): return self.interpretation
[docs] def set_interpretation(self, interpretation): self.interpretation = interpretation
[docs] def get_validation(self): return self.validation
[docs] def set_validation(self, validation): self.validation = validation
[docs] def get_emdb_id(self): return self.emdb_id
[docs] def set_emdb_id(self, emdb_id): self.emdb_id = emdb_id
[docs] def get_version(self): return self.version
[docs] def set_version(self, version): self.version = version
[docs] def validate_emdb_id_type(self, value):
# Validate type emdb_id_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_emdb_id_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_emdb_id_type_patterns_, ))
validate_emdb_id_type_patterns_ = [['^EMD-\\d{4,}$']]
[docs] def hasContent_(self):
if (
self.admin is not None or
self.crossreferences is not None or
self.sample is not None or
self.structure_determination_list is not None or
self.map is not None or
self.interpretation is not None or
self.validation is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='entry_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='entry_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='entry_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='entry_type'):
if self.emdb_id is not None and 'emdb_id' not in already_processed:
already_processed.add('emdb_id')
outfile.write(' emdb_id=%s' % (quote_attrib(self.emdb_id), ))
if self.version is not None and 'version' not in already_processed:
already_processed.add('version')
outfile.write(' version=%s' % (self.gds_format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='entry_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.admin is not None:
self.admin.export(outfile, level, namespace_, name_='admin', pretty_print=pretty_print)
if self.crossreferences is not None:
self.crossreferences.export(outfile, level, namespace_, name_='crossreferences', pretty_print=pretty_print)
if self.sample is not None:
self.sample.export(outfile, level, namespace_, name_='sample', pretty_print=pretty_print)
if self.structure_determination_list is not None:
self.structure_determination_list.export(outfile, level, namespace_, name_='structure_determination_list', pretty_print=pretty_print)
if self.map is not None:
self.map.export(outfile, level, namespace_, name_='map', pretty_print=pretty_print)
if self.interpretation is not None:
self.interpretation.export(outfile, level, namespace_, name_='interpretation', pretty_print=pretty_print)
if self.validation is not None:
self.validation.export(outfile, level, namespace_, name_='validation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('emdb_id', node)
if value is not None and 'emdb_id' not in already_processed:
already_processed.add('emdb_id')
self.emdb_id = value
self.emdb_id = ' '.join(self.emdb_id.split())
self.validate_emdb_id_type(self.emdb_id) # validate type emdb_id_type
value = find_attr_value_('version', node)
if value is not None and 'version' not in already_processed:
already_processed.add('version')
self.version = value
self.version = ' '.join(self.version.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'admin':
obj_ = admin_type.factory()
obj_.build(child_)
self.admin = obj_
obj_.original_tagname_ = 'admin'
elif nodeName_ == 'crossreferences':
obj_ = crossreferences_type.factory()
obj_.build(child_)
self.crossreferences = obj_
obj_.original_tagname_ = 'crossreferences'
elif nodeName_ == 'sample':
obj_ = sample_type.factory()
obj_.build(child_)
self.sample = obj_
obj_.original_tagname_ = 'sample'
elif nodeName_ == 'structure_determination_list':
obj_ = structure_determination_listType.factory()
obj_.build(child_)
self.structure_determination_list = obj_
obj_.original_tagname_ = 'structure_determination_list'
elif nodeName_ == 'map':
obj_ = map_type.factory()
obj_.build(child_)
self.map = obj_
obj_.original_tagname_ = 'map'
elif nodeName_ == 'interpretation':
obj_ = interpretation_type.factory()
obj_.build(child_)
self.interpretation = obj_
obj_.original_tagname_ = 'interpretation'
elif nodeName_ == 'validation':
obj_ = validationType.factory()
obj_.build(child_)
self.validation = obj_
obj_.original_tagname_ = 'validation'
# end class entry_type
[docs]class admin_type(GeneratedsSuper):
"""for pdbx categories with "PDB" in name, we should request duplicate
categories with "EMDB" substituted"""
member_data_items_ = [
MemberSpec_('status_history_list', 'version_list_type', 0),
MemberSpec_('current_status', 'version_type', 0),
MemberSpec_('sites', 'sitesType', 0),
MemberSpec_('key_dates', 'key_datesType', 0),
MemberSpec_('obsolete_list', 'obsolete_listType', 0),
MemberSpec_('superseded_by_list', 'superseded_by_listType', 0),
MemberSpec_('grant_support', 'grant_supportType', 0),
MemberSpec_('contact_author', 'contact_authorType', 1),
MemberSpec_('title', 'xs:token', 0),
MemberSpec_('authors_list', 'authors_listType', 0),
MemberSpec_('details', 'xs:token', 0),
MemberSpec_('keywords', 'xs:string', 0),
MemberSpec_('replace_existing_entry', 'xs:boolean', 0),
]
subclass = None
superclass = None
def __init__(self, status_history_list=None, current_status=None, sites=None, key_dates=None, obsolete_list=None, superseded_by_list=None, grant_support=None, contact_author=None, title=None, authors_list=None, details=None, keywords=None, replace_existing_entry=None):
self.original_tagname_ = None
self.status_history_list = status_history_list
self.current_status = current_status
self.sites = sites
self.key_dates = key_dates
self.obsolete_list = obsolete_list
self.superseded_by_list = superseded_by_list
self.grant_support = grant_support
if contact_author is None:
self.contact_author = []
else:
self.contact_author = contact_author
self.title = title
self.authors_list = authors_list
self.details = details
self.keywords = keywords
self.replace_existing_entry = replace_existing_entry
[docs] def factory(*args_, **kwargs_):
if admin_type.subclass:
return admin_type.subclass(*args_, **kwargs_)
else:
return admin_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_status_history_list(self): return self.status_history_list
[docs] def set_status_history_list(self, status_history_list): self.status_history_list = status_history_list
[docs] def get_current_status(self): return self.current_status
[docs] def set_current_status(self, current_status): self.current_status = current_status
[docs] def get_sites(self): return self.sites
[docs] def set_sites(self, sites): self.sites = sites
[docs] def get_key_dates(self): return self.key_dates
[docs] def set_key_dates(self, key_dates): self.key_dates = key_dates
[docs] def get_obsolete_list(self): return self.obsolete_list
[docs] def set_obsolete_list(self, obsolete_list): self.obsolete_list = obsolete_list
[docs] def get_superseded_by_list(self): return self.superseded_by_list
[docs] def set_superseded_by_list(self, superseded_by_list): self.superseded_by_list = superseded_by_list
[docs] def get_grant_support(self): return self.grant_support
[docs] def set_grant_support(self, grant_support): self.grant_support = grant_support
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_authors_list(self): return self.authors_list
[docs] def set_authors_list(self, authors_list): self.authors_list = authors_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_keywords(self): return self.keywords
[docs] def set_keywords(self, keywords): self.keywords = keywords
[docs] def get_replace_existing_entry(self): return self.replace_existing_entry
[docs] def set_replace_existing_entry(self, replace_existing_entry): self.replace_existing_entry = replace_existing_entry
[docs] def hasContent_(self):
if (
self.status_history_list is not None or
self.current_status is not None or
self.sites is not None or
self.key_dates is not None or
self.obsolete_list is not None or
self.superseded_by_list is not None or
self.grant_support is not None or
self.contact_author or
self.title is not None or
self.authors_list is not None or
self.details is not None or
self.keywords is not None or
self.replace_existing_entry is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='admin_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='admin_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='admin_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='admin_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='admin_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.status_history_list is not None:
self.status_history_list.export(outfile, level, namespace_, name_='status_history_list', pretty_print=pretty_print)
if self.current_status is not None:
self.current_status.export(outfile, level, namespace_, name_='current_status', pretty_print=pretty_print)
if self.sites is not None:
self.sites.export(outfile, level, namespace_, name_='sites', pretty_print=pretty_print)
if self.key_dates is not None:
self.key_dates.export(outfile, level, namespace_, name_='key_dates', pretty_print=pretty_print)
if self.obsolete_list is not None:
self.obsolete_list.export(outfile, level, namespace_, name_='obsolete_list', pretty_print=pretty_print)
if self.superseded_by_list is not None:
self.superseded_by_list.export(outfile, level, namespace_, name_='superseded_by_list', pretty_print=pretty_print)
if self.grant_support is not None:
self.grant_support.export(outfile, level, namespace_, name_='grant_support', pretty_print=pretty_print)
for contact_author_ in self.contact_author:
contact_author_.export(outfile, level, namespace_, name_='contact_author', pretty_print=pretty_print)
if self.title is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stitle>%s</%stitle>%s' % (namespace_, self.gds_format_string(quote_xml(self.title).encode(ExternalEncoding), input_name='title'), namespace_, eol_))
if self.authors_list is not None:
self.authors_list.export(outfile, level, namespace_, name_='authors_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.keywords is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%skeywords>%s</%skeywords>%s' % (namespace_, self.gds_format_string(quote_xml(self.keywords).encode(ExternalEncoding), input_name='keywords'), namespace_, eol_))
if self.replace_existing_entry is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sreplace_existing_entry>%s</%sreplace_existing_entry>%s' % (namespace_, self.gds_format_boolean(self.replace_existing_entry, input_name='replace_existing_entry'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'status_history_list':
obj_ = version_list_type.factory()
obj_.build(child_)
self.status_history_list = obj_
obj_.original_tagname_ = 'status_history_list'
elif nodeName_ == 'current_status':
class_obj_ = self.get_class_obj_(child_, version_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.current_status = obj_
obj_.original_tagname_ = 'current_status'
elif nodeName_ == 'sites':
obj_ = sitesType.factory()
obj_.build(child_)
self.sites = obj_
obj_.original_tagname_ = 'sites'
elif nodeName_ == 'key_dates':
obj_ = key_datesType.factory()
obj_.build(child_)
self.key_dates = obj_
obj_.original_tagname_ = 'key_dates'
elif nodeName_ == 'obsolete_list':
obj_ = obsolete_listType.factory()
obj_.build(child_)
self.obsolete_list = obj_
obj_.original_tagname_ = 'obsolete_list'
elif nodeName_ == 'superseded_by_list':
obj_ = superseded_by_listType.factory()
obj_.build(child_)
self.superseded_by_list = obj_
obj_.original_tagname_ = 'superseded_by_list'
elif nodeName_ == 'grant_support':
obj_ = grant_supportType.factory()
obj_.build(child_)
self.grant_support = obj_
obj_.original_tagname_ = 'grant_support'
elif nodeName_ == 'contact_author':
obj_ = contact_authorType.factory()
obj_.build(child_)
self.contact_author.append(obj_)
obj_.original_tagname_ = 'contact_author'
elif nodeName_ == 'title':
title_ = child_.text
title_ = re_.sub(String_cleanup_pat_, " ", title_).strip()
title_ = self.gds_validate_string(title_, node, 'title')
self.title = title_
elif nodeName_ == 'authors_list':
obj_ = authors_listType.factory()
obj_.build(child_)
self.authors_list = obj_
obj_.original_tagname_ = 'authors_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = re_.sub(String_cleanup_pat_, " ", details_).strip()
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'keywords':
keywords_ = child_.text
keywords_ = self.gds_validate_string(keywords_, node, 'keywords')
self.keywords = keywords_
elif nodeName_ == 'replace_existing_entry':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'replace_existing_entry')
self.replace_existing_entry = ival_
# end class admin_type
[docs]class version_list_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('status', 'statusType', 1),
]
subclass = None
superclass = None
def __init__(self, status=None):
self.original_tagname_ = None
if status is None:
self.status = []
else:
self.status = status
[docs] def factory(*args_, **kwargs_):
if version_list_type.subclass:
return version_list_type.subclass(*args_, **kwargs_)
else:
return version_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_status(self): return self.status
[docs] def set_status(self, status): self.status = status
[docs] def add_status(self, value): self.status.append(value)
[docs] def insert_status_at(self, index, value): self.status.insert(index, value)
[docs] def replace_status_at(self, index, value): self.status[index] = value
[docs] def hasContent_(self):
if (
self.status
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='version_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='version_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='version_list_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='version_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='version_list_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for status_ in self.status:
status_.export(outfile, level, namespace_, name_='status', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'status':
obj_ = statusType.factory()
obj_.build(child_)
self.status.append(obj_)
obj_.original_tagname_ = 'status'
# end class version_list_type
[docs]class version_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('date', ['dateType', 'xs:date'], 0),
MemberSpec_('code', 'code_type', 0),
MemberSpec_('processing_site', ['processing_siteType', 'xs:token'], 0),
MemberSpec_('annotator', 'annotatorType', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, date=None, code=None, processing_site=None, annotator=None, details=None, extensiontype_=None):
self.original_tagname_ = None
if isinstance(date, basestring):
initvalue_ = datetime_.datetime.strptime(date, '%Y-%m-%d').date()
else:
initvalue_ = date
self.date = initvalue_
self.code = code
self.processing_site = processing_site
self.validate_processing_siteType(self.processing_site)
self.annotator = annotator
self.details = details
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if version_type.subclass:
return version_type.subclass(*args_, **kwargs_)
else:
return version_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_date(self): return self.date
[docs] def set_date(self, date): self.date = date
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_processing_site(self): return self.processing_site
[docs] def set_processing_site(self, processing_site): self.processing_site = processing_site
[docs] def get_annotator(self): return self.annotator
[docs] def set_annotator(self, annotator): self.annotator = annotator
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_dateType(self, value):
# Validate type dateType, a restriction on xs:date.
if value is not None and Validate_simpletypes_:
if value < 2002-01-01:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on dateType' % {"value" : value} )
[docs] def validate_processing_siteType(self, value):
# Validate type processing_siteType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['PDBe', 'RCSB', 'PDBj']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on processing_siteType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.date is not None or
self.code is not None or
self.processing_site is not None or
self.annotator is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='version_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='version_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='version_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='version_type'):
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='version_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.date is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdate>%s</%sdate>%s' % (namespace_, self.gds_format_date(self.date, input_name='date'), namespace_, eol_))
if self.code is not None:
self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
if self.processing_site is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sprocessing_site>%s</%sprocessing_site>%s' % (namespace_, self.gds_format_string(quote_xml(self.processing_site).encode(ExternalEncoding), input_name='processing_site'), namespace_, eol_))
if self.annotator is not None:
self.annotator.export(outfile, level, namespace_, name_='annotator', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'date':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.date = dval_
# validate type dateType
self.validate_dateType(self.date)
elif nodeName_ == 'code':
obj_ = code_type.factory()
obj_.build(child_)
self.code = obj_
obj_.original_tagname_ = 'code'
elif nodeName_ == 'processing_site':
processing_site_ = child_.text
processing_site_ = re_.sub(String_cleanup_pat_, " ", processing_site_).strip()
processing_site_ = self.gds_validate_string(processing_site_, node, 'processing_site')
self.processing_site = processing_site_
# validate type processing_siteType
self.validate_processing_siteType(self.processing_site)
elif nodeName_ == 'annotator':
obj_ = annotatorType.factory()
obj_.build(child_)
self.annotator = obj_
obj_.original_tagname_ = 'annotator'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class version_type
[docs]class status_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('date', 'xs:date', 0),
MemberSpec_('code', 'code_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, date=None, code=None, details=None):
self.original_tagname_ = None
if isinstance(date, basestring):
initvalue_ = datetime_.datetime.strptime(date, '%Y-%m-%d').date()
else:
initvalue_ = date
self.date = initvalue_
self.code = code
self.details = details
[docs] def factory(*args_, **kwargs_):
if status_type.subclass:
return status_type.subclass(*args_, **kwargs_)
else:
return status_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_date(self): return self.date
[docs] def set_date(self, date): self.date = date
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.date is not None or
self.code is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='status_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='status_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='status_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='status_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='status_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.date is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdate>%s</%sdate>%s' % (namespace_, self.gds_format_date(self.date, input_name='date'), namespace_, eol_))
if self.code is not None:
self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'date':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.date = dval_
elif nodeName_ == 'code':
obj_ = code_type.factory()
obj_.build(child_)
self.code = obj_
obj_.original_tagname_ = 'code'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class status_type
[docs]class supersedes_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('date', 'xs:date', 0),
MemberSpec_('entry', ['emdb_id_type', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, date=None, entry=None, details=None):
self.original_tagname_ = None
if isinstance(date, basestring):
initvalue_ = datetime_.datetime.strptime(date, '%Y-%m-%d').date()
else:
initvalue_ = date
self.date = initvalue_
self.entry = entry
self.validate_emdb_id_type(self.entry)
self.details = details
[docs] def factory(*args_, **kwargs_):
if supersedes_type.subclass:
return supersedes_type.subclass(*args_, **kwargs_)
else:
return supersedes_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_date(self): return self.date
[docs] def set_date(self, date): self.date = date
[docs] def get_entry(self): return self.entry
[docs] def set_entry(self, entry): self.entry = entry
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_emdb_id_type(self, value):
# Validate type emdb_id_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_emdb_id_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_emdb_id_type_patterns_, ))
validate_emdb_id_type_patterns_ = [['^EMD-\\d{4,}$']]
[docs] def hasContent_(self):
if (
self.date is not None or
self.entry is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='supersedes_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='supersedes_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='supersedes_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='supersedes_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='supersedes_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.date is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdate>%s</%sdate>%s' % (namespace_, self.gds_format_date(self.date, input_name='date'), namespace_, eol_))
if self.entry is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sentry>%s</%sentry>%s' % (namespace_, self.gds_format_string(quote_xml(self.entry).encode(ExternalEncoding), input_name='entry'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'date':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.date = dval_
elif nodeName_ == 'entry':
entry_ = child_.text
entry_ = re_.sub(String_cleanup_pat_, " ", entry_).strip()
entry_ = self.gds_validate_string(entry_, node, 'entry')
self.entry = entry_
# validate type emdb_id_type
self.validate_emdb_id_type(self.entry)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class supersedes_type
[docs]class name_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if name_type.subclass:
return name_type.subclass(*args_, **kwargs_)
else:
return name_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='name_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='name_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='name_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='name_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='name_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class name_type
[docs]class address_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if address_type.subclass:
return address_type.subclass(*args_, **kwargs_)
else:
return address_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='address_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='address_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='address_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='address_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='address_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class address_type
[docs]class crossreferences_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('citation_list', 'citation_listType', 0),
MemberSpec_('emdb_list', 'emdb_cross_reference_list_type', 0),
MemberSpec_('pdb_list', 'pdb_cross_reference_list_type', 0),
MemberSpec_('auxiliary_link_list', 'auxiliary_link_listType', 0),
]
subclass = None
superclass = None
def __init__(self, citation_list=None, emdb_list=None, pdb_list=None, auxiliary_link_list=None):
self.original_tagname_ = None
self.citation_list = citation_list
self.emdb_list = emdb_list
self.pdb_list = pdb_list
self.auxiliary_link_list = auxiliary_link_list
[docs] def factory(*args_, **kwargs_):
if crossreferences_type.subclass:
return crossreferences_type.subclass(*args_, **kwargs_)
else:
return crossreferences_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_citation_list(self): return self.citation_list
[docs] def set_citation_list(self, citation_list): self.citation_list = citation_list
[docs] def get_emdb_list(self): return self.emdb_list
[docs] def set_emdb_list(self, emdb_list): self.emdb_list = emdb_list
[docs] def get_pdb_list(self): return self.pdb_list
[docs] def set_pdb_list(self, pdb_list): self.pdb_list = pdb_list
[docs] def get_auxiliary_link_list(self): return self.auxiliary_link_list
[docs] def set_auxiliary_link_list(self, auxiliary_link_list): self.auxiliary_link_list = auxiliary_link_list
[docs] def hasContent_(self):
if (
self.citation_list is not None or
self.emdb_list is not None or
self.pdb_list is not None or
self.auxiliary_link_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crossreferences_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crossreferences_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crossreferences_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crossreferences_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crossreferences_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.citation_list is not None:
self.citation_list.export(outfile, level, namespace_, name_='citation_list', pretty_print=pretty_print)
if self.emdb_list is not None:
self.emdb_list.export(outfile, level, namespace_, name_='emdb_list', pretty_print=pretty_print)
if self.pdb_list is not None:
self.pdb_list.export(outfile, level, namespace_, name_='pdb_list', pretty_print=pretty_print)
if self.auxiliary_link_list is not None:
self.auxiliary_link_list.export(outfile, level, namespace_, name_='auxiliary_link_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'citation_list':
obj_ = citation_listType.factory()
obj_.build(child_)
self.citation_list = obj_
obj_.original_tagname_ = 'citation_list'
elif nodeName_ == 'emdb_list':
obj_ = emdb_cross_reference_list_type.factory()
obj_.build(child_)
self.emdb_list = obj_
obj_.original_tagname_ = 'emdb_list'
elif nodeName_ == 'pdb_list':
obj_ = pdb_cross_reference_list_type.factory()
obj_.build(child_)
self.pdb_list = obj_
obj_.original_tagname_ = 'pdb_list'
elif nodeName_ == 'auxiliary_link_list':
obj_ = auxiliary_link_listType.factory()
obj_.build(child_)
self.auxiliary_link_list = obj_
obj_.original_tagname_ = 'auxiliary_link_list'
# end class crossreferences_type
[docs]class citation_list_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if citation_list_type.subclass:
return citation_list_type.subclass(*args_, **kwargs_)
else:
return citation_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='citation_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='citation_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='citation_list_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='citation_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='citation_list_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class citation_list_type
[docs]class emdb_cross_reference_type(GeneratedsSuper):
"""EMDB entries related to this entry"""
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('emdb_id', ['emdb_id_type', 'xs:token'], 0),
MemberSpec_('relationship', 'relationshipType', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, emdb_id=None, relationship=None, details=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.emdb_id = emdb_id
self.validate_emdb_id_type(self.emdb_id)
self.relationship = relationship
self.details = details
[docs] def factory(*args_, **kwargs_):
if emdb_cross_reference_type.subclass:
return emdb_cross_reference_type.subclass(*args_, **kwargs_)
else:
return emdb_cross_reference_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_emdb_id(self): return self.emdb_id
[docs] def set_emdb_id(self, emdb_id): self.emdb_id = emdb_id
[docs] def get_relationship(self): return self.relationship
[docs] def set_relationship(self, relationship): self.relationship = relationship
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def validate_emdb_id_type(self, value):
# Validate type emdb_id_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_emdb_id_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_emdb_id_type_patterns_, ))
validate_emdb_id_type_patterns_ = [['^EMD-\\d{4,}$']]
[docs] def hasContent_(self):
if (
self.emdb_id is not None or
self.relationship is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='emdb_cross_reference_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='emdb_cross_reference_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='emdb_cross_reference_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='emdb_cross_reference_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='emdb_cross_reference_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.emdb_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%semdb_id>%s</%semdb_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.emdb_id).encode(ExternalEncoding), input_name='emdb_id'), namespace_, eol_))
if self.relationship is not None:
self.relationship.export(outfile, level, namespace_, name_='relationship', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'emdb_id':
emdb_id_ = child_.text
emdb_id_ = re_.sub(String_cleanup_pat_, " ", emdb_id_).strip()
emdb_id_ = self.gds_validate_string(emdb_id_, node, 'emdb_id')
self.emdb_id = emdb_id_
# validate type emdb_id_type
self.validate_emdb_id_type(self.emdb_id)
elif nodeName_ == 'relationship':
obj_ = relationshipType.factory()
obj_.build(child_)
self.relationship = obj_
obj_.original_tagname_ = 'relationship'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class emdb_cross_reference_type
[docs]class emdb_cross_reference_list_type(GeneratedsSuper):
"""List of related EMDB entries Maybe it can be combined with
pdbReference into one datatype."""
member_data_items_ = [
MemberSpec_('emdb_reference', 'emdb_cross_reference_type', 1),
]
subclass = None
superclass = None
def __init__(self, emdb_reference=None):
self.original_tagname_ = None
if emdb_reference is None:
self.emdb_reference = []
else:
self.emdb_reference = emdb_reference
[docs] def factory(*args_, **kwargs_):
if emdb_cross_reference_list_type.subclass:
return emdb_cross_reference_list_type.subclass(*args_, **kwargs_)
else:
return emdb_cross_reference_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_emdb_reference(self): return self.emdb_reference
[docs] def set_emdb_reference(self, emdb_reference): self.emdb_reference = emdb_reference
[docs] def add_emdb_reference(self, value): self.emdb_reference.append(value)
[docs] def insert_emdb_reference_at(self, index, value): self.emdb_reference.insert(index, value)
[docs] def replace_emdb_reference_at(self, index, value): self.emdb_reference[index] = value
[docs] def hasContent_(self):
if (
self.emdb_reference
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='emdb_cross_reference_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='emdb_cross_reference_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='emdb_cross_reference_list_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='emdb_cross_reference_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='emdb_cross_reference_list_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for emdb_reference_ in self.emdb_reference:
emdb_reference_.export(outfile, level, namespace_, name_='emdb_reference', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'emdb_reference':
obj_ = emdb_cross_reference_type.factory()
obj_.build(child_)
self.emdb_reference.append(obj_)
obj_.original_tagname_ = 'emdb_reference'
# end class emdb_cross_reference_list_type
[docs]class pdb_cross_reference_type(GeneratedsSuper):
"""PDB entries related to this entry. The chainID list can be used to
specify which specific chains are related to this map."""
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('pdb_id', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('relationship', 'relationshipType1', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, pdb_id=None, relationship=None, details=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.pdb_id = pdb_id
self.validate_pdb_code_type(self.pdb_id)
self.relationship = relationship
self.details = details
[docs] def factory(*args_, **kwargs_):
if pdb_cross_reference_type.subclass:
return pdb_cross_reference_type.subclass(*args_, **kwargs_)
else:
return pdb_cross_reference_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_pdb_id(self): return self.pdb_id
[docs] def set_pdb_id(self, pdb_id): self.pdb_id = pdb_id
[docs] def get_relationship(self): return self.relationship
[docs] def set_relationship(self, relationship): self.relationship = relationship
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.pdb_id is not None or
self.relationship is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pdb_cross_reference_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pdb_cross_reference_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='pdb_cross_reference_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pdb_cross_reference_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pdb_cross_reference_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.pdb_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%spdb_id>%s</%spdb_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.pdb_id).encode(ExternalEncoding), input_name='pdb_id'), namespace_, eol_))
if self.relationship is not None:
self.relationship.export(outfile, level, namespace_, name_='relationship', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'pdb_id':
pdb_id_ = child_.text
pdb_id_ = re_.sub(String_cleanup_pat_, " ", pdb_id_).strip()
pdb_id_ = self.gds_validate_string(pdb_id_, node, 'pdb_id')
self.pdb_id = pdb_id_
# validate type pdb_code_type
self.validate_pdb_code_type(self.pdb_id)
elif nodeName_ == 'relationship':
obj_ = relationshipType1.factory()
obj_.build(child_)
self.relationship = obj_
obj_.original_tagname_ = 'relationship'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class pdb_cross_reference_type
[docs]class pdb_cross_reference_list_type(GeneratedsSuper):
"""List of related PDB entries"""
member_data_items_ = [
MemberSpec_('pdb_reference', 'pdb_cross_reference_type', 1),
]
subclass = None
superclass = None
def __init__(self, pdb_reference=None):
self.original_tagname_ = None
if pdb_reference is None:
self.pdb_reference = []
else:
self.pdb_reference = pdb_reference
[docs] def factory(*args_, **kwargs_):
if pdb_cross_reference_list_type.subclass:
return pdb_cross_reference_list_type.subclass(*args_, **kwargs_)
else:
return pdb_cross_reference_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_pdb_reference(self): return self.pdb_reference
[docs] def set_pdb_reference(self, pdb_reference): self.pdb_reference = pdb_reference
[docs] def add_pdb_reference(self, value): self.pdb_reference.append(value)
[docs] def insert_pdb_reference_at(self, index, value): self.pdb_reference.insert(index, value)
[docs] def replace_pdb_reference_at(self, index, value): self.pdb_reference[index] = value
[docs] def hasContent_(self):
if (
self.pdb_reference
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pdb_cross_reference_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pdb_cross_reference_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='pdb_cross_reference_list_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pdb_cross_reference_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pdb_cross_reference_list_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for pdb_reference_ in self.pdb_reference:
pdb_reference_.export(outfile, level, namespace_, name_='pdb_reference', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'pdb_reference':
obj_ = pdb_cross_reference_type.factory()
obj_.build(child_)
self.pdb_reference.append(obj_)
obj_.original_tagname_ = 'pdb_reference'
# end class pdb_cross_reference_list_type
[docs]class structure_determination_type(GeneratedsSuper):
"""Unique identifier that will allow the DA system to be refactored in
terms of experiments rather than maps. Can be autogenerated
unless user wants to specify a previously existing one."""
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('method', ['methodType', 'xs:token'], 0),
MemberSpec_('aggregation_state', ['aggregation_stateType', 'xs:token'], 0),
MemberSpec_('macromolecules_and_complexes', 'macromolecules_and_complexes_type', 0),
MemberSpec_('specimen_preparation_list', 'specimen_preparation_listType', 0),
MemberSpec_('microscopy_list', 'microscopy_listType', 0),
MemberSpec_('image_processing', 'base_processing_type', 1),
]
subclass = None
superclass = None
def __init__(self, id=None, method=None, aggregation_state=None, macromolecules_and_complexes=None, specimen_preparation_list=None, microscopy_list=None, image_processing=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.method = method
self.validate_methodType(self.method)
self.aggregation_state = aggregation_state
self.validate_aggregation_stateType(self.aggregation_state)
self.macromolecules_and_complexes = macromolecules_and_complexes
self.specimen_preparation_list = specimen_preparation_list
self.microscopy_list = microscopy_list
if image_processing is None:
self.image_processing = []
else:
self.image_processing = image_processing
[docs] def factory(*args_, **kwargs_):
if structure_determination_type.subclass:
return structure_determination_type.subclass(*args_, **kwargs_)
else:
return structure_determination_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_method(self): return self.method
[docs] def set_method(self, method): self.method = method
[docs] def get_aggregation_state(self): return self.aggregation_state
[docs] def set_aggregation_state(self, aggregation_state): self.aggregation_state = aggregation_state
[docs] def get_macromolecules_and_complexes(self): return self.macromolecules_and_complexes
[docs] def set_macromolecules_and_complexes(self, macromolecules_and_complexes): self.macromolecules_and_complexes = macromolecules_and_complexes
[docs] def get_specimen_preparation_list(self): return self.specimen_preparation_list
[docs] def set_specimen_preparation_list(self, specimen_preparation_list): self.specimen_preparation_list = specimen_preparation_list
[docs] def get_microscopy_list(self): return self.microscopy_list
[docs] def set_microscopy_list(self, microscopy_list): self.microscopy_list = microscopy_list
[docs] def get_image_processing(self): return self.image_processing
[docs] def set_image_processing(self, image_processing): self.image_processing = image_processing
[docs] def add_image_processing(self, value): self.image_processing.append(value)
[docs] def insert_image_processing_at(self, index, value): self.image_processing.insert(index, value)
[docs] def replace_image_processing_at(self, index, value): self.image_processing[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def validate_methodType(self, value):
# Validate type methodType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['singleParticle', 'subtomogramAveraging', 'tomography', 'electronCrystallography', 'helical']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on methodType' % {"value" : value.encode("utf-8")} )
[docs] def validate_aggregation_stateType(self, value):
# Validate type aggregation_stateType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['particle', 'filament', 'twoDArray', 'threeDArray', 'helicalArray', 'cell', 'tissue']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on aggregation_stateType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.method is not None or
self.aggregation_state is not None or
self.macromolecules_and_complexes is not None or
self.specimen_preparation_list is not None or
self.microscopy_list is not None or
self.image_processing
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='structure_determination_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='structure_determination_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='structure_determination_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='structure_determination_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='structure_determination_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smethod>%s</%smethod>%s' % (namespace_, self.gds_format_string(quote_xml(self.method).encode(ExternalEncoding), input_name='method'), namespace_, eol_))
if self.aggregation_state is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saggregation_state>%s</%saggregation_state>%s' % (namespace_, self.gds_format_string(quote_xml(self.aggregation_state).encode(ExternalEncoding), input_name='aggregation_state'), namespace_, eol_))
if self.macromolecules_and_complexes is not None:
self.macromolecules_and_complexes.export(outfile, level, namespace_, name_='macromolecules_and_complexes', pretty_print=pretty_print)
if self.specimen_preparation_list is not None:
self.specimen_preparation_list.export(outfile, level, namespace_, name_='specimen_preparation_list', pretty_print=pretty_print)
if self.microscopy_list is not None:
self.microscopy_list.export(outfile, level, namespace_, name_='microscopy_list', pretty_print=pretty_print)
for image_processing_ in self.image_processing:
image_processing_.export(outfile, level, namespace_, name_='image_processing', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'method':
method_ = child_.text
method_ = re_.sub(String_cleanup_pat_, " ", method_).strip()
method_ = self.gds_validate_string(method_, node, 'method')
self.method = method_
# validate type methodType
self.validate_methodType(self.method)
elif nodeName_ == 'aggregation_state':
aggregation_state_ = child_.text
aggregation_state_ = re_.sub(String_cleanup_pat_, " ", aggregation_state_).strip()
aggregation_state_ = self.gds_validate_string(aggregation_state_, node, 'aggregation_state')
self.aggregation_state = aggregation_state_
# validate type aggregation_stateType
self.validate_aggregation_stateType(self.aggregation_state)
elif nodeName_ == 'macromolecules_and_complexes':
obj_ = macromolecules_and_complexes_type.factory()
obj_.build(child_)
self.macromolecules_and_complexes = obj_
obj_.original_tagname_ = 'macromolecules_and_complexes'
elif nodeName_ == 'specimen_preparation_list':
obj_ = specimen_preparation_listType.factory()
obj_.build(child_)
self.specimen_preparation_list = obj_
obj_.original_tagname_ = 'specimen_preparation_list'
elif nodeName_ == 'microscopy_list':
obj_ = microscopy_listType.factory()
obj_.build(child_)
self.microscopy_list = obj_
obj_.original_tagname_ = 'microscopy_list'
elif nodeName_ == 'image_processing':
type_name_ = child_.attrib.get(
'{http://www.w3.org/2001/XMLSchema-instance}type')
if type_name_ is None:
type_name_ = child_.attrib.get('type')
if type_name_ is not None:
type_names_ = type_name_.split(':')
if len(type_names_) == 1:
type_name_ = type_names_[0]
else:
type_name_ = type_names_[1]
class_ = globals()[type_name_]
obj_ = class_.factory()
obj_.build(child_)
else:
raise NotImplementedError(
'Class not implemented for <image_processing> element')
self.image_processing.append(obj_)
obj_.original_tagname_ = 'image_processing'
elif nodeName_ == 'singleparticle_processing':
obj_ = singleparticle_processing_type.factory()
obj_.build(child_)
self.image_processing.append(obj_)
obj_.original_tagname_ = 'singleparticle_processing'
elif nodeName_ == 'subtomogram_averaging_processing':
obj_ = subtomogram_averaging_processing_type.factory()
obj_.build(child_)
self.image_processing.append(obj_)
obj_.original_tagname_ = 'subtomogram_averaging_processing'
elif nodeName_ == 'tomography_processing':
obj_ = tomography_processing_type.factory()
obj_.build(child_)
self.image_processing.append(obj_)
obj_.original_tagname_ = 'tomography_processing'
elif nodeName_ == 'crystallography_processing':
obj_ = crystallography_processing_type.factory()
obj_.build(child_)
self.image_processing.append(obj_)
obj_.original_tagname_ = 'crystallography_processing'
elif nodeName_ == 'helical_processing':
obj_ = helical_processing_type.factory()
obj_.build(child_)
self.image_processing.append(obj_)
obj_.original_tagname_ = 'helical_processing'
# end class structure_determination_type
[docs]class sample_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('supramolecule_list', 'supramolecule_listType', 0),
MemberSpec_('macromolecule_list', 'macromolecule_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, name=None, supramolecule_list=None, macromolecule_list=None):
self.original_tagname_ = None
self.name = name
self.supramolecule_list = supramolecule_list
self.macromolecule_list = macromolecule_list
[docs] def factory(*args_, **kwargs_):
if sample_type.subclass:
return sample_type.subclass(*args_, **kwargs_)
else:
return sample_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_supramolecule_list(self): return self.supramolecule_list
[docs] def set_supramolecule_list(self, supramolecule_list): self.supramolecule_list = supramolecule_list
[docs] def get_macromolecule_list(self): return self.macromolecule_list
[docs] def set_macromolecule_list(self, macromolecule_list): self.macromolecule_list = macromolecule_list
[docs] def hasContent_(self):
if (
self.name is not None or
self.supramolecule_list is not None or
self.macromolecule_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sample_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sample_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sample_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sample_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sample_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.supramolecule_list is not None:
self.supramolecule_list.export(outfile, level, namespace_, name_='supramolecule_list', pretty_print=pretty_print)
if self.macromolecule_list is not None:
self.macromolecule_list.export(outfile, level, namespace_, name_='macromolecule_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'supramolecule_list':
obj_ = supramolecule_listType.factory()
obj_.build(child_)
self.supramolecule_list = obj_
obj_.original_tagname_ = 'supramolecule_list'
elif nodeName_ == 'macromolecule_list':
obj_ = macromolecule_list_type.factory()
obj_.build(child_)
self.macromolecule_list = obj_
obj_.original_tagname_ = 'macromolecule_list'
# end class sample_type
[docs]class particle_selection_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_particles_selected', 'xs:positiveInteger', 0),
MemberSpec_('reference_model', 'xs:token', 0),
MemberSpec_('method', 'xs:string', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_particles_selected=None, reference_model=None, method=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_particles_selected = number_particles_selected
self.reference_model = reference_model
self.method = method
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if particle_selection_type.subclass:
return particle_selection_type.subclass(*args_, **kwargs_)
else:
return particle_selection_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_particles_selected(self): return self.number_particles_selected
[docs] def set_number_particles_selected(self, number_particles_selected): self.number_particles_selected = number_particles_selected
[docs] def get_reference_model(self): return self.reference_model
[docs] def set_reference_model(self, reference_model): self.reference_model = reference_model
[docs] def get_method(self): return self.method
[docs] def set_method(self, method): self.method = method
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_particles_selected is not None or
self.reference_model is not None or
self.method is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='particle_selection_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='particle_selection_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='particle_selection_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='particle_selection_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='particle_selection_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_particles_selected is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_particles_selected>%s</%snumber_particles_selected>%s' % (namespace_, self.gds_format_integer(self.number_particles_selected, input_name='number_particles_selected'), namespace_, eol_))
if self.reference_model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sreference_model>%s</%sreference_model>%s' % (namespace_, self.gds_format_string(quote_xml(self.reference_model).encode(ExternalEncoding), input_name='reference_model'), namespace_, eol_))
if self.method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smethod>%s</%smethod>%s' % (namespace_, self.gds_format_string(quote_xml(self.method).encode(ExternalEncoding), input_name='method'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_particles_selected':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_particles_selected')
self.number_particles_selected = ival_
elif nodeName_ == 'reference_model':
reference_model_ = child_.text
reference_model_ = re_.sub(String_cleanup_pat_, " ", reference_model_).strip()
reference_model_ = self.gds_validate_string(reference_model_, node, 'reference_model')
self.reference_model = reference_model_
elif nodeName_ == 'method':
method_ = child_.text
method_ = self.gds_validate_string(method_, node, 'method')
self.method = method_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class particle_selection_type
[docs]class grid_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('model', ['modelType', 'xs:token'], 0),
MemberSpec_('material', ['materialType', 'xs:token'], 0),
MemberSpec_('mesh', 'xs:positiveInteger', 0),
MemberSpec_('support_film', 'film_type', 1),
MemberSpec_('glow_discharge', 'glow_dischargeType', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, model=None, material=None, mesh=None, support_film=None, glow_discharge=None, details=None):
self.original_tagname_ = None
self.model = model
self.validate_modelType(self.model)
self.material = material
self.validate_materialType(self.material)
self.mesh = mesh
if support_film is None:
self.support_film = []
else:
self.support_film = support_film
self.glow_discharge = glow_discharge
self.details = details
[docs] def factory(*args_, **kwargs_):
if grid_type.subclass:
return grid_type.subclass(*args_, **kwargs_)
else:
return grid_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_model(self): return self.model
[docs] def set_model(self, model): self.model = model
[docs] def get_material(self): return self.material
[docs] def set_material(self, material): self.material = material
[docs] def get_mesh(self): return self.mesh
[docs] def set_mesh(self, mesh): self.mesh = mesh
[docs] def get_support_film(self): return self.support_film
[docs] def set_support_film(self, support_film): self.support_film = support_film
[docs] def add_support_film(self, value): self.support_film.append(value)
[docs] def insert_support_film_at(self, index, value): self.support_film.insert(index, value)
[docs] def replace_support_film_at(self, index, value): self.support_film[index] = value
[docs] def get_glow_discharge(self): return self.glow_discharge
[docs] def set_glow_discharge(self, glow_discharge): self.glow_discharge = glow_discharge
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_modelType(self, value):
# Validate type modelType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
pass
[docs] def validate_materialType(self, value):
# Validate type materialType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['GOLD', 'COPPER', 'MOLYBDENUM']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on materialType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.model is not None or
self.material is not None or
self.mesh is not None or
self.support_film or
self.glow_discharge is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='grid_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='grid_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='grid_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='grid_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='grid_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smodel>%s</%smodel>%s' % (namespace_, self.gds_format_string(quote_xml(self.model).encode(ExternalEncoding), input_name='model'), namespace_, eol_))
if self.material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smaterial>%s</%smaterial>%s' % (namespace_, self.gds_format_string(quote_xml(self.material).encode(ExternalEncoding), input_name='material'), namespace_, eol_))
if self.mesh is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smesh>%s</%smesh>%s' % (namespace_, self.gds_format_integer(self.mesh, input_name='mesh'), namespace_, eol_))
for support_film_ in self.support_film:
support_film_.export(outfile, level, namespace_, name_='support_film', pretty_print=pretty_print)
if self.glow_discharge is not None:
self.glow_discharge.export(outfile, level, namespace_, name_='glow_discharge', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'model':
model_ = child_.text
model_ = re_.sub(String_cleanup_pat_, " ", model_).strip()
model_ = self.gds_validate_string(model_, node, 'model')
self.model = model_
# validate type modelType
self.validate_modelType(self.model)
elif nodeName_ == 'material':
material_ = child_.text
material_ = re_.sub(String_cleanup_pat_, " ", material_).strip()
material_ = self.gds_validate_string(material_, node, 'material')
self.material = material_
# validate type materialType
self.validate_materialType(self.material)
elif nodeName_ == 'mesh':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'mesh')
self.mesh = ival_
elif nodeName_ == 'support_film':
obj_ = film_type.factory()
obj_.build(child_)
self.support_film.append(obj_)
obj_.original_tagname_ = 'support_film'
elif nodeName_ == 'glow_discharge':
obj_ = glow_dischargeType.factory()
obj_.build(child_)
self.glow_discharge = obj_
obj_.original_tagname_ = 'glow_discharge'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class grid_type
[docs]class glow_discharge_params_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('time', 'timeType', 0),
MemberSpec_('atmosphere', ['atmosphereType', 'xs:token'], 0),
MemberSpec_('pressure', 'pressureType', 0),
]
subclass = None
superclass = None
def __init__(self, time=None, atmosphere=None, pressure=None):
self.original_tagname_ = None
self.time = time
self.atmosphere = atmosphere
self.validate_atmosphereType(self.atmosphere)
self.pressure = pressure
[docs] def factory(*args_, **kwargs_):
if glow_discharge_params_type.subclass:
return glow_discharge_params_type.subclass(*args_, **kwargs_)
else:
return glow_discharge_params_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_atmosphere(self): return self.atmosphere
[docs] def set_atmosphere(self, atmosphere): self.atmosphere = atmosphere
[docs] def get_pressure(self): return self.pressure
[docs] def set_pressure(self, pressure): self.pressure = pressure
[docs] def validate_atmosphereType(self, value):
# Validate type atmosphereType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['AIR', 'AMYLAMINE']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on atmosphereType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.time is not None or
self.atmosphere is not None or
self.pressure is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='glow_discharge_params_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='glow_discharge_params_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='glow_discharge_params_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='glow_discharge_params_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='glow_discharge_params_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.time is not None:
self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print)
if self.atmosphere is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%satmosphere>%s</%satmosphere>%s' % (namespace_, self.gds_format_string(quote_xml(self.atmosphere).encode(ExternalEncoding), input_name='atmosphere'), namespace_, eol_))
if self.pressure is not None:
self.pressure.export(outfile, level, namespace_, name_='pressure', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'time':
obj_ = timeType.factory()
obj_.build(child_)
self.time = obj_
obj_.original_tagname_ = 'time'
elif nodeName_ == 'atmosphere':
atmosphere_ = child_.text
atmosphere_ = re_.sub(String_cleanup_pat_, " ", atmosphere_).strip()
atmosphere_ = self.gds_validate_string(atmosphere_, node, 'atmosphere')
self.atmosphere = atmosphere_
# validate type atmosphereType
self.validate_atmosphereType(self.atmosphere)
elif nodeName_ == 'pressure':
obj_ = pressureType.factory()
obj_.build(child_)
self.pressure = obj_
obj_.original_tagname_ = 'pressure'
# end class glow_discharge_params_type
[docs]class stain_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('ammonium_molybdate', 'xs:string', 0),
MemberSpec_('uranyl_acetate', 'xs:string', 0),
MemberSpec_('uranyl_formate', 'xs:string', 0),
MemberSpec_('phophotungstic_acid', 'xs:string', 0),
MemberSpec_('osmium_tetroxide', 'xs:string', 0),
MemberSpec_('osmium_ferricyanide', 'xs:string', 0),
MemberSpec_('auro_glucothionate', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, ammonium_molybdate=None, uranyl_acetate=None, uranyl_formate=None, phophotungstic_acid=None, osmium_tetroxide=None, osmium_ferricyanide=None, auro_glucothionate=None):
self.original_tagname_ = None
self.ammonium_molybdate = ammonium_molybdate
self.uranyl_acetate = uranyl_acetate
self.uranyl_formate = uranyl_formate
self.phophotungstic_acid = phophotungstic_acid
self.osmium_tetroxide = osmium_tetroxide
self.osmium_ferricyanide = osmium_ferricyanide
self.auro_glucothionate = auro_glucothionate
[docs] def factory(*args_, **kwargs_):
if stain_type.subclass:
return stain_type.subclass(*args_, **kwargs_)
else:
return stain_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ammonium_molybdate(self): return self.ammonium_molybdate
[docs] def set_ammonium_molybdate(self, ammonium_molybdate): self.ammonium_molybdate = ammonium_molybdate
[docs] def get_uranyl_acetate(self): return self.uranyl_acetate
[docs] def set_uranyl_acetate(self, uranyl_acetate): self.uranyl_acetate = uranyl_acetate
[docs] def get_phophotungstic_acid(self): return self.phophotungstic_acid
[docs] def set_phophotungstic_acid(self, phophotungstic_acid): self.phophotungstic_acid = phophotungstic_acid
[docs] def get_osmium_tetroxide(self): return self.osmium_tetroxide
[docs] def set_osmium_tetroxide(self, osmium_tetroxide): self.osmium_tetroxide = osmium_tetroxide
[docs] def get_osmium_ferricyanide(self): return self.osmium_ferricyanide
[docs] def set_osmium_ferricyanide(self, osmium_ferricyanide): self.osmium_ferricyanide = osmium_ferricyanide
[docs] def get_auro_glucothionate(self): return self.auro_glucothionate
[docs] def set_auro_glucothionate(self, auro_glucothionate): self.auro_glucothionate = auro_glucothionate
[docs] def hasContent_(self):
if (
self.ammonium_molybdate is not None or
self.uranyl_acetate is not None or
self.uranyl_formate is not None or
self.phophotungstic_acid is not None or
self.osmium_tetroxide is not None or
self.osmium_ferricyanide is not None or
self.auro_glucothionate is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='stain_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='stain_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='stain_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='stain_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='stain_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.ammonium_molybdate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sammonium_molybdate>%s</%sammonium_molybdate>%s' % (namespace_, self.gds_format_string(quote_xml(self.ammonium_molybdate).encode(ExternalEncoding), input_name='ammonium_molybdate'), namespace_, eol_))
if self.uranyl_acetate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%suranyl_acetate>%s</%suranyl_acetate>%s' % (namespace_, self.gds_format_string(quote_xml(self.uranyl_acetate).encode(ExternalEncoding), input_name='uranyl_acetate'), namespace_, eol_))
if self.uranyl_formate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%suranyl_formate>%s</%suranyl_formate>%s' % (namespace_, self.gds_format_string(quote_xml(self.uranyl_formate).encode(ExternalEncoding), input_name='uranyl_formate'), namespace_, eol_))
if self.phophotungstic_acid is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sphophotungstic_acid>%s</%sphophotungstic_acid>%s' % (namespace_, self.gds_format_string(quote_xml(self.phophotungstic_acid).encode(ExternalEncoding), input_name='phophotungstic_acid'), namespace_, eol_))
if self.osmium_tetroxide is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sosmium_tetroxide>%s</%sosmium_tetroxide>%s' % (namespace_, self.gds_format_string(quote_xml(self.osmium_tetroxide).encode(ExternalEncoding), input_name='osmium_tetroxide'), namespace_, eol_))
if self.osmium_ferricyanide is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sosmium_ferricyanide>%s</%sosmium_ferricyanide>%s' % (namespace_, self.gds_format_string(quote_xml(self.osmium_ferricyanide).encode(ExternalEncoding), input_name='osmium_ferricyanide'), namespace_, eol_))
if self.auro_glucothionate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sauro_glucothionate>%s</%sauro_glucothionate>%s' % (namespace_, self.gds_format_string(quote_xml(self.auro_glucothionate).encode(ExternalEncoding), input_name='auro_glucothionate'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'ammonium_molybdate':
ammonium_molybdate_ = child_.text
ammonium_molybdate_ = self.gds_validate_string(ammonium_molybdate_, node, 'ammonium_molybdate')
self.ammonium_molybdate = ammonium_molybdate_
elif nodeName_ == 'uranyl_acetate':
uranyl_acetate_ = child_.text
uranyl_acetate_ = self.gds_validate_string(uranyl_acetate_, node, 'uranyl_acetate')
self.uranyl_acetate = uranyl_acetate_
elif nodeName_ == 'uranyl_formate':
uranyl_formate_ = child_.text
uranyl_formate_ = self.gds_validate_string(uranyl_formate_, node, 'uranyl_formate')
self.uranyl_formate = uranyl_formate_
elif nodeName_ == 'phophotungstic_acid':
phophotungstic_acid_ = child_.text
phophotungstic_acid_ = self.gds_validate_string(phophotungstic_acid_, node, 'phophotungstic_acid')
self.phophotungstic_acid = phophotungstic_acid_
elif nodeName_ == 'osmium_tetroxide':
osmium_tetroxide_ = child_.text
osmium_tetroxide_ = self.gds_validate_string(osmium_tetroxide_, node, 'osmium_tetroxide')
self.osmium_tetroxide = osmium_tetroxide_
elif nodeName_ == 'osmium_ferricyanide':
osmium_ferricyanide_ = child_.text
osmium_ferricyanide_ = self.gds_validate_string(osmium_ferricyanide_, node, 'osmium_ferricyanide')
self.osmium_ferricyanide = osmium_ferricyanide_
elif nodeName_ == 'auro_glucothionate':
auro_glucothionate_ = child_.text
auro_glucothionate_ = self.gds_validate_string(auro_glucothionate_, node, 'auro_glucothionate')
self.auro_glucothionate = auro_glucothionate_
# end class stain_type
[docs]class ammonium_molybdate(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if ammonium_molybdate.subclass:
return ammonium_molybdate.subclass(*args_, **kwargs_)
else:
return ammonium_molybdate(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='ammonium_molybdate', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='ammonium_molybdate')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='ammonium_molybdate', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ammonium_molybdate'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ammonium_molybdate', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class ammonium_molybdate
[docs]class uranyl_acetate(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if uranyl_acetate.subclass:
return uranyl_acetate.subclass(*args_, **kwargs_)
else:
return uranyl_acetate(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='uranyl_acetate', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='uranyl_acetate')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='uranyl_acetate', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='uranyl_acetate'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='uranyl_acetate', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class uranyl_acetate
[docs]class phophotungstic_acid(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if phophotungstic_acid.subclass:
return phophotungstic_acid.subclass(*args_, **kwargs_)
else:
return phophotungstic_acid(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='phophotungstic_acid', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='phophotungstic_acid')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='phophotungstic_acid', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='phophotungstic_acid'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='phophotungstic_acid', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class phophotungstic_acid
[docs]class osmium_tetroxide(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if osmium_tetroxide.subclass:
return osmium_tetroxide.subclass(*args_, **kwargs_)
else:
return osmium_tetroxide(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='osmium_tetroxide', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='osmium_tetroxide')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='osmium_tetroxide', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='osmium_tetroxide'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='osmium_tetroxide', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class osmium_tetroxide
[docs]class osmium_ferricyanide(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if osmium_ferricyanide.subclass:
return osmium_ferricyanide.subclass(*args_, **kwargs_)
else:
return osmium_ferricyanide(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='osmium_ferricyanide', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='osmium_ferricyanide')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='osmium_ferricyanide', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='osmium_ferricyanide'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='osmium_ferricyanide', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class osmium_ferricyanide
[docs]class auro_glucothionate(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if auro_glucothionate.subclass:
return auro_glucothionate.subclass(*args_, **kwargs_)
else:
return auro_glucothionate(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='auro_glucothionate', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='auro_glucothionate')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='auro_glucothionate', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='auro_glucothionate'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='auro_glucothionate', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class auro_glucothionate
[docs]class specialist_optics_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('phase_plate', 'xs:token', 0),
MemberSpec_('sph_aberration_corrector', 'xs:token', 0),
MemberSpec_('chr_aberration_corrector', 'xs:token', 0),
MemberSpec_('energy_filter', 'energy_filterType', 0),
]
subclass = None
superclass = None
def __init__(self, phase_plate=None, sph_aberration_corrector=None, chr_aberration_corrector=None, energy_filter=None):
self.original_tagname_ = None
self.phase_plate = phase_plate
self.sph_aberration_corrector = sph_aberration_corrector
self.chr_aberration_corrector = chr_aberration_corrector
self.energy_filter = energy_filter
[docs] def factory(*args_, **kwargs_):
if specialist_optics_type.subclass:
return specialist_optics_type.subclass(*args_, **kwargs_)
else:
return specialist_optics_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_phase_plate(self): return self.phase_plate
[docs] def set_phase_plate(self, phase_plate): self.phase_plate = phase_plate
[docs] def get_sph_aberration_corrector(self): return self.sph_aberration_corrector
[docs] def set_sph_aberration_corrector(self, sph_aberration_corrector): self.sph_aberration_corrector = sph_aberration_corrector
[docs] def get_chr_aberration_corrector(self): return self.chr_aberration_corrector
[docs] def set_chr_aberration_corrector(self, chr_aberration_corrector): self.chr_aberration_corrector = chr_aberration_corrector
[docs] def get_energy_filter(self): return self.energy_filter
[docs] def set_energy_filter(self, energy_filter): self.energy_filter = energy_filter
[docs] def hasContent_(self):
if (
self.phase_plate is not None or
self.sph_aberration_corrector is not None or
self.chr_aberration_corrector is not None or
self.energy_filter is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='specialist_optics_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='specialist_optics_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='specialist_optics_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='specialist_optics_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='specialist_optics_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.phase_plate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sphase_plate>%s</%sphase_plate>%s' % (namespace_, self.gds_format_string(quote_xml(self.phase_plate).encode(ExternalEncoding), input_name='phase_plate'), namespace_, eol_))
if self.sph_aberration_corrector is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssph_aberration_corrector>%s</%ssph_aberration_corrector>%s' % (namespace_, self.gds_format_string(quote_xml(self.sph_aberration_corrector).encode(ExternalEncoding), input_name='sph_aberration_corrector'), namespace_, eol_))
if self.chr_aberration_corrector is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%schr_aberration_corrector>%s</%schr_aberration_corrector>%s' % (namespace_, self.gds_format_string(quote_xml(self.chr_aberration_corrector).encode(ExternalEncoding), input_name='chr_aberration_corrector'), namespace_, eol_))
if self.energy_filter is not None:
self.energy_filter.export(outfile, level, namespace_, name_='energy_filter', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'phase_plate':
phase_plate_ = child_.text
phase_plate_ = re_.sub(String_cleanup_pat_, " ", phase_plate_).strip()
phase_plate_ = self.gds_validate_string(phase_plate_, node, 'phase_plate')
self.phase_plate = phase_plate_
elif nodeName_ == 'sph_aberration_corrector':
sph_aberration_corrector_ = child_.text
sph_aberration_corrector_ = re_.sub(String_cleanup_pat_, " ", sph_aberration_corrector_).strip()
sph_aberration_corrector_ = self.gds_validate_string(sph_aberration_corrector_, node, 'sph_aberration_corrector')
self.sph_aberration_corrector = sph_aberration_corrector_
elif nodeName_ == 'chr_aberration_corrector':
chr_aberration_corrector_ = child_.text
chr_aberration_corrector_ = re_.sub(String_cleanup_pat_, " ", chr_aberration_corrector_).strip()
chr_aberration_corrector_ = self.gds_validate_string(chr_aberration_corrector_, node, 'chr_aberration_corrector')
self.chr_aberration_corrector = chr_aberration_corrector_
elif nodeName_ == 'energy_filter':
obj_ = energy_filterType.factory()
obj_.build(child_)
self.energy_filter = obj_
obj_.original_tagname_ = 'energy_filter'
# end class specialist_optics_type
[docs]class results_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if results_type.subclass:
return results_type.subclass(*args_, **kwargs_)
else:
return results_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='results_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='results_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='results_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='results_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='results_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class results_type
[docs]class regexp_string(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('help_text', 'xs:string', 0),
MemberSpec_('string', 'xs:string', 0),
MemberSpec_('validation_list', 'validation_listType', 0),
]
subclass = None
superclass = None
def __init__(self, help_text=None, string=None, validation_list=None):
self.original_tagname_ = None
self.help_text = help_text
self.string = string
self.validation_list = validation_list
[docs] def factory(*args_, **kwargs_):
if regexp_string.subclass:
return regexp_string.subclass(*args_, **kwargs_)
else:
return regexp_string(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_help_text(self): return self.help_text
[docs] def set_help_text(self, help_text): self.help_text = help_text
[docs] def get_string(self): return self.string
[docs] def set_string(self, string): self.string = string
[docs] def get_validation_list(self): return self.validation_list
[docs] def set_validation_list(self, validation_list): self.validation_list = validation_list
[docs] def hasContent_(self):
if (
self.help_text is not None or
self.string is not None or
self.validation_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='regexp_string', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='regexp_string')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='regexp_string', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='regexp_string'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='regexp_string', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.help_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%shelp_text>%s</%shelp_text>%s' % (namespace_, self.gds_format_string(quote_xml(self.help_text).encode(ExternalEncoding), input_name='help_text'), namespace_, eol_))
if self.string is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstring>%s</%sstring>%s' % (namespace_, self.gds_format_string(quote_xml(self.string).encode(ExternalEncoding), input_name='string'), namespace_, eol_))
if self.validation_list is not None:
self.validation_list.export(outfile, level, namespace_, name_='validation_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'help_text':
help_text_ = child_.text
help_text_ = self.gds_validate_string(help_text_, node, 'help_text')
self.help_text = help_text_
elif nodeName_ == 'string':
string_ = child_.text
string_ = self.gds_validate_string(string_, node, 'string')
self.string = string_
elif nodeName_ == 'validation_list':
obj_ = validation_listType.factory()
obj_.build(child_)
self.validation_list = obj_
obj_.original_tagname_ = 'validation_list'
# end class regexp_string
[docs]class string_validation_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('regular_expression', 'xs:string', 0),
MemberSpec_('enum', 'xs:string', 1),
MemberSpec_('controlled_vocabulary_link', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, regular_expression=None, enum=None, controlled_vocabulary_link=None):
self.original_tagname_ = None
self.regular_expression = regular_expression
if enum is None:
self.enum = []
else:
self.enum = enum
self.controlled_vocabulary_link = controlled_vocabulary_link
[docs] def factory(*args_, **kwargs_):
if string_validation_type.subclass:
return string_validation_type.subclass(*args_, **kwargs_)
else:
return string_validation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_regular_expression(self): return self.regular_expression
[docs] def set_regular_expression(self, regular_expression): self.regular_expression = regular_expression
[docs] def get_enum(self): return self.enum
[docs] def set_enum(self, enum): self.enum = enum
[docs] def add_enum(self, value): self.enum.append(value)
[docs] def insert_enum_at(self, index, value): self.enum.insert(index, value)
[docs] def replace_enum_at(self, index, value): self.enum[index] = value
[docs] def get_controlled_vocabulary_link(self): return self.controlled_vocabulary_link
[docs] def set_controlled_vocabulary_link(self, controlled_vocabulary_link): self.controlled_vocabulary_link = controlled_vocabulary_link
[docs] def hasContent_(self):
if (
self.regular_expression is not None or
self.enum or
self.controlled_vocabulary_link is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='string_validation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='string_validation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='string_validation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='string_validation_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='string_validation_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.regular_expression is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sregular_expression>%s</%sregular_expression>%s' % (namespace_, self.gds_format_string(quote_xml(self.regular_expression).encode(ExternalEncoding), input_name='regular_expression'), namespace_, eol_))
for enum_ in self.enum:
showIndent(outfile, level, pretty_print)
outfile.write('<%senum>%s</%senum>%s' % (namespace_, self.gds_format_string(quote_xml(enum_).encode(ExternalEncoding), input_name='enum'), namespace_, eol_))
if self.controlled_vocabulary_link is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scontrolled_vocabulary_link>%s</%scontrolled_vocabulary_link>%s' % (namespace_, self.gds_format_string(quote_xml(self.controlled_vocabulary_link).encode(ExternalEncoding), input_name='controlled_vocabulary_link'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'regular_expression':
regular_expression_ = child_.text
regular_expression_ = self.gds_validate_string(regular_expression_, node, 'regular_expression')
self.regular_expression = regular_expression_
elif nodeName_ == 'enum':
enum_ = child_.text
enum_ = self.gds_validate_string(enum_, node, 'enum')
self.enum.append(enum_)
elif nodeName_ == 'controlled_vocabulary_link':
controlled_vocabulary_link_ = child_.text
controlled_vocabulary_link_ = self.gds_validate_string(controlled_vocabulary_link_, node, 'controlled_vocabulary_link')
self.controlled_vocabulary_link = controlled_vocabulary_link_
# end class string_validation_type
[docs]class base_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('help_text', 'xs:string', 0),
MemberSpec_('warning_text', 'xs:string', 0),
MemberSpec_('error_text', 'xs:string', 0),
MemberSpec_('validation_rules', 'string_validation_type', 1),
MemberSpec_('label', 'xs:string', 0),
MemberSpec_('value', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, help_text=None, warning_text=None, error_text=None, validation_rules=None, label=None, value=None, extensiontype_=None):
self.original_tagname_ = None
self.help_text = help_text
self.warning_text = warning_text
self.error_text = error_text
if validation_rules is None:
self.validation_rules = []
else:
self.validation_rules = validation_rules
self.label = label
self.value = value
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_type.subclass:
return base_type.subclass(*args_, **kwargs_)
else:
return base_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_help_text(self): return self.help_text
[docs] def set_help_text(self, help_text): self.help_text = help_text
[docs] def get_warning_text(self): return self.warning_text
[docs] def set_warning_text(self, warning_text): self.warning_text = warning_text
[docs] def get_error_text(self): return self.error_text
[docs] def set_error_text(self, error_text): self.error_text = error_text
[docs] def get_validation_rules(self): return self.validation_rules
[docs] def set_validation_rules(self, validation_rules): self.validation_rules = validation_rules
[docs] def add_validation_rules(self, value): self.validation_rules.append(value)
[docs] def insert_validation_rules_at(self, index, value): self.validation_rules.insert(index, value)
[docs] def replace_validation_rules_at(self, index, value): self.validation_rules[index] = value
[docs] def get_label(self): return self.label
[docs] def set_label(self, label): self.label = label
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
self.help_text is not None or
self.warning_text is not None or
self.error_text is not None or
self.validation_rules or
self.label is not None or
self.value is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_type'):
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.help_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%shelp_text>%s</%shelp_text>%s' % (namespace_, self.gds_format_string(quote_xml(self.help_text).encode(ExternalEncoding), input_name='help_text'), namespace_, eol_))
if self.warning_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%swarning_text>%s</%swarning_text>%s' % (namespace_, self.gds_format_string(quote_xml(self.warning_text).encode(ExternalEncoding), input_name='warning_text'), namespace_, eol_))
if self.error_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%serror_text>%s</%serror_text>%s' % (namespace_, self.gds_format_string(quote_xml(self.error_text).encode(ExternalEncoding), input_name='error_text'), namespace_, eol_))
for validation_rules_ in self.validation_rules:
validation_rules_.export(outfile, level, namespace_, name_='validation_rules', pretty_print=pretty_print)
if self.label is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slabel>%s</%slabel>%s' % (namespace_, self.gds_format_string(quote_xml(self.label).encode(ExternalEncoding), input_name='label'), namespace_, eol_))
if self.value is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svalue>%s</%svalue>%s' % (namespace_, self.gds_format_string(quote_xml(self.value).encode(ExternalEncoding), input_name='value'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'help_text':
help_text_ = child_.text
help_text_ = self.gds_validate_string(help_text_, node, 'help_text')
self.help_text = help_text_
elif nodeName_ == 'warning_text':
warning_text_ = child_.text
warning_text_ = self.gds_validate_string(warning_text_, node, 'warning_text')
self.warning_text = warning_text_
elif nodeName_ == 'error_text':
error_text_ = child_.text
error_text_ = self.gds_validate_string(error_text_, node, 'error_text')
self.error_text = error_text_
elif nodeName_ == 'validation_rules':
obj_ = string_validation_type.factory()
obj_.build(child_)
self.validation_rules.append(obj_)
obj_.original_tagname_ = 'validation_rules'
elif nodeName_ == 'label':
label_ = child_.text
label_ = self.gds_validate_string(label_, node, 'label')
self.label = label_
elif nodeName_ == 'value':
value_ = child_.text
value_ = self.gds_validate_string(value_, node, 'value')
self.value = value_
# end class base_type
[docs]class buffer_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('ph', ['phType', 'xs:float'], 0),
MemberSpec_('component', 'componentType', 1),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, ph=None, component=None, details=None):
self.original_tagname_ = None
self.ph = ph
self.validate_phType(self.ph)
if component is None:
self.component = []
else:
self.component = component
self.details = details
[docs] def factory(*args_, **kwargs_):
if buffer_type.subclass:
return buffer_type.subclass(*args_, **kwargs_)
else:
return buffer_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ph(self): return self.ph
[docs] def set_ph(self, ph): self.ph = ph
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_phType(self, value):
# Validate type phType, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value < 0:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on phType' % {"value" : value} )
if value > 14:
warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on phType' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.ph is not None or
self.component or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='buffer_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='buffer_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='buffer_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='buffer_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='buffer_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.ph is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sph>%s</%sph>%s' % (namespace_, self.gds_format_float(self.ph, input_name='ph'), namespace_, eol_))
for component_ in self.component:
component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'ph':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'ph')
self.ph = fval_
# validate type phType
self.validate_phType(self.ph)
elif nodeName_ == 'component':
obj_ = componentType.factory()
obj_.build(child_)
self.component.append(obj_)
obj_.original_tagname_ = 'component'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class buffer_type
[docs]class vitrification_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('cryogen_name', ['cryogen_nameType', 'xs:token'], 0),
MemberSpec_('chamber_humidity', 'chamber_humidityType', 0),
MemberSpec_('chamber_temperature', 'chamber_temperatureType', 0),
MemberSpec_('instrument', ['instrumentType', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('timed_resolved_state', 'xs:token', 0),
MemberSpec_('method', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, cryogen_name=None, chamber_humidity=None, chamber_temperature=None, instrument=None, details=None, timed_resolved_state=None, method=None):
self.original_tagname_ = None
self.cryogen_name = cryogen_name
self.validate_cryogen_nameType(self.cryogen_name)
self.chamber_humidity = chamber_humidity
self.chamber_temperature = chamber_temperature
self.instrument = instrument
self.validate_instrumentType(self.instrument)
self.details = details
self.timed_resolved_state = timed_resolved_state
self.method = method
[docs] def factory(*args_, **kwargs_):
if vitrification_type.subclass:
return vitrification_type.subclass(*args_, **kwargs_)
else:
return vitrification_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_cryogen_name(self): return self.cryogen_name
[docs] def set_cryogen_name(self, cryogen_name): self.cryogen_name = cryogen_name
[docs] def get_chamber_humidity(self): return self.chamber_humidity
[docs] def set_chamber_humidity(self, chamber_humidity): self.chamber_humidity = chamber_humidity
[docs] def get_chamber_temperature(self): return self.chamber_temperature
[docs] def set_chamber_temperature(self, chamber_temperature): self.chamber_temperature = chamber_temperature
[docs] def get_instrument(self): return self.instrument
[docs] def set_instrument(self, instrument): self.instrument = instrument
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_timed_resolved_state(self): return self.timed_resolved_state
[docs] def set_timed_resolved_state(self, timed_resolved_state): self.timed_resolved_state = timed_resolved_state
[docs] def get_method(self): return self.method
[docs] def set_method(self, method): self.method = method
[docs] def validate_cryogen_nameType(self, value):
# Validate type cryogen_nameType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['ETHANE', 'FREON 12', 'FREON 22', 'HELIUM', 'METHANE', 'NITROGEN', 'PROPANE', 'ETHANE-PROPANE']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cryogen_nameType' % {"value" : value.encode("utf-8")} )
[docs] def validate_instrumentType(self, value):
# Validate type instrumentType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['EMS-002 RAPID IMMERSION FREEZER', 'FEI VITROBOT MARK I', 'FEI VITROBOT MARK II', 'FEI VITROBOT MARK III', 'FEI VITROBOT MARK IV', 'GATAN CRYOPLUNGE 3', 'HOMEMADE PLUNGER', 'LEICA PLUNGER', 'LEICA EM GP', 'LEICA EM CPC', 'LEICA KF80', 'REICHERT-JUNG PLUNGER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on instrumentType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.cryogen_name is not None or
self.chamber_humidity is not None or
self.chamber_temperature is not None or
self.instrument is not None or
self.details is not None or
self.timed_resolved_state is not None or
self.method is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='vitrification_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='vitrification_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='vitrification_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='vitrification_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='vitrification_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.cryogen_name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scryogen_name>%s</%scryogen_name>%s' % (namespace_, self.gds_format_string(quote_xml(self.cryogen_name).encode(ExternalEncoding), input_name='cryogen_name'), namespace_, eol_))
if self.chamber_humidity is not None:
self.chamber_humidity.export(outfile, level, namespace_, name_='chamber_humidity', pretty_print=pretty_print)
if self.chamber_temperature is not None:
self.chamber_temperature.export(outfile, level, namespace_, name_='chamber_temperature', pretty_print=pretty_print)
if self.instrument is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sinstrument>%s</%sinstrument>%s' % (namespace_, self.gds_format_string(quote_xml(self.instrument).encode(ExternalEncoding), input_name='instrument'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.timed_resolved_state is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stimed_resolved_state>%s</%stimed_resolved_state>%s' % (namespace_, self.gds_format_string(quote_xml(self.timed_resolved_state).encode(ExternalEncoding), input_name='timed_resolved_state'), namespace_, eol_))
if self.method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smethod>%s</%smethod>%s' % (namespace_, self.gds_format_string(quote_xml(self.method).encode(ExternalEncoding), input_name='method'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'cryogen_name':
cryogen_name_ = child_.text
cryogen_name_ = re_.sub(String_cleanup_pat_, " ", cryogen_name_).strip()
cryogen_name_ = self.gds_validate_string(cryogen_name_, node, 'cryogen_name')
self.cryogen_name = cryogen_name_
# validate type cryogen_nameType
self.validate_cryogen_nameType(self.cryogen_name)
elif nodeName_ == 'chamber_humidity':
obj_ = chamber_humidityType.factory()
obj_.build(child_)
self.chamber_humidity = obj_
obj_.original_tagname_ = 'chamber_humidity'
elif nodeName_ == 'chamber_temperature':
obj_ = chamber_temperatureType.factory()
obj_.build(child_)
self.chamber_temperature = obj_
obj_.original_tagname_ = 'chamber_temperature'
elif nodeName_ == 'instrument':
instrument_ = child_.text
instrument_ = re_.sub(String_cleanup_pat_, " ", instrument_).strip()
instrument_ = self.gds_validate_string(instrument_, node, 'instrument')
self.instrument = instrument_
# validate type instrumentType
self.validate_instrumentType(self.instrument)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'timed_resolved_state':
timed_resolved_state_ = child_.text
timed_resolved_state_ = re_.sub(String_cleanup_pat_, " ", timed_resolved_state_).strip()
timed_resolved_state_ = self.gds_validate_string(timed_resolved_state_, node, 'timed_resolved_state')
self.timed_resolved_state = timed_resolved_state_
elif nodeName_ == 'method':
method_ = child_.text
method_ = self.gds_validate_string(method_, node, 'method')
self.method = method_
# end class vitrification_type
[docs]class base_preparation_type(GeneratedsSuper):
"""Unique identifier. Autogenerated"""
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('concentration', 'concentrationType3', 0),
MemberSpec_('buffer', 'buffer_type', 0),
MemberSpec_('staining', 'stainingType', 0),
MemberSpec_('sugar_embedding', 'sugar_embeddingType', 0),
MemberSpec_('shadowing', 'shadowingType', 0),
MemberSpec_('grid', 'grid_type', 0),
MemberSpec_('vitrification', 'vitrification_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, concentration=None, buffer=None, staining=None, sugar_embedding=None, shadowing=None, grid=None, vitrification=None, details=None, extensiontype_=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.concentration = concentration
self.buffer = buffer
self.staining = staining
self.sugar_embedding = sugar_embedding
self.shadowing = shadowing
self.grid = grid
self.vitrification = vitrification
self.details = details
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_preparation_type.subclass:
return base_preparation_type.subclass(*args_, **kwargs_)
else:
return base_preparation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_concentration(self): return self.concentration
[docs] def set_concentration(self, concentration): self.concentration = concentration
[docs] def get_buffer(self): return self.buffer
[docs] def set_buffer(self, buffer): self.buffer = buffer
[docs] def get_staining(self): return self.staining
[docs] def set_staining(self, staining): self.staining = staining
[docs] def get_sugar_embedding(self): return self.sugar_embedding
[docs] def set_sugar_embedding(self, sugar_embedding): self.sugar_embedding = sugar_embedding
[docs] def get_shadowing(self): return self.shadowing
[docs] def set_shadowing(self, shadowing): self.shadowing = shadowing
[docs] def get_grid(self): return self.grid
[docs] def set_grid(self, grid): self.grid = grid
[docs] def get_vitrification(self): return self.vitrification
[docs] def set_vitrification(self, vitrification): self.vitrification = vitrification
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
self.concentration is not None or
self.buffer is not None or
self.staining is not None or
self.sugar_embedding is not None or
self.shadowing is not None or
self.grid is not None or
self.vitrification is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_preparation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_preparation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_preparation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_preparation_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_preparation_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.concentration is not None:
self.concentration.export(outfile, level, namespace_, name_='concentration', pretty_print=pretty_print)
if self.buffer is not None:
self.buffer.export(outfile, level, namespace_, name_='buffer', pretty_print=pretty_print)
if self.staining is not None:
self.staining.export(outfile, level, namespace_, name_='staining', pretty_print=pretty_print)
if self.sugar_embedding is not None:
self.sugar_embedding.export(outfile, level, namespace_, name_='sugar_embedding', pretty_print=pretty_print)
if self.shadowing is not None:
self.shadowing.export(outfile, level, namespace_, name_='shadowing', pretty_print=pretty_print)
if self.grid is not None:
self.grid.export(outfile, level, namespace_, name_='grid', pretty_print=pretty_print)
if self.vitrification is not None:
self.vitrification.export(outfile, level, namespace_, name_='vitrification', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'concentration':
obj_ = concentrationType3.factory()
obj_.build(child_)
self.concentration = obj_
obj_.original_tagname_ = 'concentration'
elif nodeName_ == 'buffer':
obj_ = buffer_type.factory()
obj_.build(child_)
self.buffer = obj_
obj_.original_tagname_ = 'buffer'
elif nodeName_ == 'staining':
obj_ = stainingType.factory()
obj_.build(child_)
self.staining = obj_
obj_.original_tagname_ = 'staining'
elif nodeName_ == 'sugar_embedding':
obj_ = sugar_embeddingType.factory()
obj_.build(child_)
self.sugar_embedding = obj_
obj_.original_tagname_ = 'sugar_embedding'
elif nodeName_ == 'shadowing':
obj_ = shadowingType.factory()
obj_.build(child_)
self.shadowing = obj_
obj_.original_tagname_ = 'shadowing'
elif nodeName_ == 'grid':
obj_ = grid_type.factory()
obj_.build(child_)
self.grid = obj_
obj_.original_tagname_ = 'grid'
elif nodeName_ == 'vitrification':
obj_ = vitrification_type.factory()
obj_.build(child_)
self.vitrification = obj_
obj_.original_tagname_ = 'vitrification'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class base_preparation_type
[docs]class tomography_preparation_type(base_preparation_type):
"""TODO: add limits and units."""
member_data_items_ = [
MemberSpec_('fiducial_markers_list', 'fiducial_markers_listType', 0),
MemberSpec_('high_pressure_freezing', 'high_pressure_freezingType', 0),
MemberSpec_('embedding_material', 'xs:token', 0),
MemberSpec_('cryo_protectant', 'xs:token', 0),
MemberSpec_('sectioning', 'sectioningType', 0),
]
subclass = None
superclass = base_preparation_type
def __init__(self, id=None, concentration=None, buffer=None, staining=None, sugar_embedding=None, shadowing=None, grid=None, vitrification=None, details=None, fiducial_markers_list=None, high_pressure_freezing=None, embedding_material=None, cryo_protectant=None, sectioning=None):
self.original_tagname_ = None
super(tomography_preparation_type, self).__init__(id, concentration, buffer, staining, sugar_embedding, shadowing, grid, vitrification, details, )
self.fiducial_markers_list = fiducial_markers_list
self.high_pressure_freezing = high_pressure_freezing
self.embedding_material = embedding_material
self.cryo_protectant = cryo_protectant
self.sectioning = sectioning
[docs] def factory(*args_, **kwargs_):
if tomography_preparation_type.subclass:
return tomography_preparation_type.subclass(*args_, **kwargs_)
else:
return tomography_preparation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_fiducial_markers_list(self): return self.fiducial_markers_list
[docs] def set_fiducial_markers_list(self, fiducial_markers_list): self.fiducial_markers_list = fiducial_markers_list
[docs] def get_high_pressure_freezing(self): return self.high_pressure_freezing
[docs] def set_high_pressure_freezing(self, high_pressure_freezing): self.high_pressure_freezing = high_pressure_freezing
[docs] def get_embedding_material(self): return self.embedding_material
[docs] def set_embedding_material(self, embedding_material): self.embedding_material = embedding_material
[docs] def get_cryo_protectant(self): return self.cryo_protectant
[docs] def set_cryo_protectant(self, cryo_protectant): self.cryo_protectant = cryo_protectant
[docs] def get_sectioning(self): return self.sectioning
[docs] def set_sectioning(self, sectioning): self.sectioning = sectioning
[docs] def hasContent_(self):
if (
self.fiducial_markers_list is not None or
self.high_pressure_freezing is not None or
self.embedding_material is not None or
self.cryo_protectant is not None or
self.sectioning is not None or
super(tomography_preparation_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tomography_preparation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_preparation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tomography_preparation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tomography_preparation_type'):
super(tomography_preparation_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_preparation_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tomography_preparation_type', fromsubclass_=False, pretty_print=True):
super(tomography_preparation_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.fiducial_markers_list is not None:
self.fiducial_markers_list.export(outfile, level, namespace_, name_='fiducial_markers_list', pretty_print=pretty_print)
if self.high_pressure_freezing is not None:
self.high_pressure_freezing.export(outfile, level, namespace_, name_='high_pressure_freezing', pretty_print=pretty_print)
if self.embedding_material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sembedding_material>%s</%sembedding_material>%s' % (namespace_, self.gds_format_string(quote_xml(self.embedding_material).encode(ExternalEncoding), input_name='embedding_material'), namespace_, eol_))
if self.cryo_protectant is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scryo_protectant>%s</%scryo_protectant>%s' % (namespace_, self.gds_format_string(quote_xml(self.cryo_protectant).encode(ExternalEncoding), input_name='cryo_protectant'), namespace_, eol_))
if self.sectioning is not None:
self.sectioning.export(outfile, level, namespace_, name_='sectioning', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(tomography_preparation_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'fiducial_markers_list':
obj_ = fiducial_markers_listType.factory()
obj_.build(child_)
self.fiducial_markers_list = obj_
obj_.original_tagname_ = 'fiducial_markers_list'
elif nodeName_ == 'high_pressure_freezing':
obj_ = high_pressure_freezingType.factory()
obj_.build(child_)
self.high_pressure_freezing = obj_
obj_.original_tagname_ = 'high_pressure_freezing'
elif nodeName_ == 'embedding_material':
embedding_material_ = child_.text
embedding_material_ = re_.sub(String_cleanup_pat_, " ", embedding_material_).strip()
embedding_material_ = self.gds_validate_string(embedding_material_, node, 'embedding_material')
self.embedding_material = embedding_material_
elif nodeName_ == 'cryo_protectant':
cryo_protectant_ = child_.text
cryo_protectant_ = re_.sub(String_cleanup_pat_, " ", cryo_protectant_).strip()
cryo_protectant_ = self.gds_validate_string(cryo_protectant_, node, 'cryo_protectant')
self.cryo_protectant = cryo_protectant_
elif nodeName_ == 'sectioning':
obj_ = sectioningType.factory()
obj_.build(child_)
self.sectioning = obj_
obj_.original_tagname_ = 'sectioning'
super(tomography_preparation_type, self).buildChildren(child_, node, nodeName_, True)
# end class tomography_preparation_type
[docs]class base_microscopy_type(GeneratedsSuper):
"""Auto generated by application"""
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('specimen_preparations', 'specimen_preparationsType', 0),
MemberSpec_('microscope', ['microscopeType', 'xs:token'], 0),
MemberSpec_('illumination_mode', ['illumination_modeType', 'xs:token'], 0),
MemberSpec_('imaging_mode', ['imaging_modeType', 'xs:token'], 0),
MemberSpec_('electron_source', ['electron_sourceType', 'xs:token'], 0),
MemberSpec_('acceleration_voltage', 'acceleration_voltageType', 0),
MemberSpec_('c2_aperture_diameter', 'c2_aperture_diameterType', 0),
MemberSpec_('nominal_cs', 'nominal_csType', 0),
MemberSpec_('nominal_defocus_min', 'nominal_defocus_minType', 0),
MemberSpec_('calibrated_defocus_min', 'calibrated_defocus_minType', 0),
MemberSpec_('nominal_defocus_max', 'nominal_defocus_maxType', 0),
MemberSpec_('calibrated_defocus_max', 'calibrated_defocus_maxType', 0),
MemberSpec_('nominal_magnification', ['allowed_magnification', 'xs:float'], 0),
MemberSpec_('calibrated_magnification', ['allowed_magnification', 'xs:float'], 0),
MemberSpec_('specimen_holder_model', ['specimen_holder_modelType', 'xs:token'], 0),
MemberSpec_('cooling_holder_cryogen', ['cooling_holder_cryogenType', 'xs:token'], 0),
MemberSpec_('temperature', 'temperatureType', 0),
MemberSpec_('alignment_procedure', 'alignment_procedureType', 0),
MemberSpec_('specialist_optics', 'specialist_optics_type', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('date', 'xs:date', 0),
MemberSpec_('image_recording_list', 'image_recording_listType', 0),
MemberSpec_('specimen_holder', 'xs:string', 0),
MemberSpec_('tilt_angle_min', 'xs:string', 0),
MemberSpec_('tilt_angle_max', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, specimen_preparations=None, microscope=None, illumination_mode=None, imaging_mode=None, electron_source=None, acceleration_voltage=None, c2_aperture_diameter=None, nominal_cs=None, nominal_defocus_min=None, calibrated_defocus_min=None, nominal_defocus_max=None, calibrated_defocus_max=None, nominal_magnification=None, calibrated_magnification=None, specimen_holder_model=None, cooling_holder_cryogen=None, temperature=None, alignment_procedure=None, specialist_optics=None, software_list=None, details=None, date=None, image_recording_list=None, specimen_holder=None, tilt_angle_min=None, tilt_angle_max=None, extensiontype_=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.specimen_preparations = specimen_preparations
self.microscope = microscope
self.validate_microscopeType(self.microscope)
self.illumination_mode = illumination_mode
self.validate_illumination_modeType(self.illumination_mode)
self.imaging_mode = imaging_mode
self.validate_imaging_modeType(self.imaging_mode)
self.electron_source = electron_source
self.validate_electron_sourceType(self.electron_source)
self.acceleration_voltage = acceleration_voltage
self.c2_aperture_diameter = c2_aperture_diameter
self.nominal_cs = nominal_cs
self.nominal_defocus_min = nominal_defocus_min
self.calibrated_defocus_min = calibrated_defocus_min
self.nominal_defocus_max = nominal_defocus_max
self.calibrated_defocus_max = calibrated_defocus_max
self.nominal_magnification = nominal_magnification
self.validate_allowed_magnification(self.nominal_magnification)
self.calibrated_magnification = calibrated_magnification
self.validate_allowed_magnification(self.calibrated_magnification)
self.specimen_holder_model = specimen_holder_model
self.validate_specimen_holder_modelType(self.specimen_holder_model)
self.cooling_holder_cryogen = cooling_holder_cryogen
self.validate_cooling_holder_cryogenType(self.cooling_holder_cryogen)
self.temperature = temperature
self.alignment_procedure = alignment_procedure
self.specialist_optics = specialist_optics
self.software_list = software_list
self.details = details
if isinstance(date, basestring):
initvalue_ = datetime_.datetime.strptime(date, '%Y-%m-%d').date()
else:
initvalue_ = date
self.date = initvalue_
self.image_recording_list = image_recording_list
self.specimen_holder = specimen_holder
self.tilt_angle_min = tilt_angle_min
self.tilt_angle_max = tilt_angle_max
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_microscopy_type.subclass:
return base_microscopy_type.subclass(*args_, **kwargs_)
else:
return base_microscopy_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_specimen_preparations(self): return self.specimen_preparations
[docs] def set_specimen_preparations(self, specimen_preparations): self.specimen_preparations = specimen_preparations
[docs] def get_microscope(self): return self.microscope
[docs] def set_microscope(self, microscope): self.microscope = microscope
[docs] def get_illumination_mode(self): return self.illumination_mode
[docs] def set_illumination_mode(self, illumination_mode): self.illumination_mode = illumination_mode
[docs] def get_imaging_mode(self): return self.imaging_mode
[docs] def set_imaging_mode(self, imaging_mode): self.imaging_mode = imaging_mode
[docs] def get_electron_source(self): return self.electron_source
[docs] def set_electron_source(self, electron_source): self.electron_source = electron_source
[docs] def get_acceleration_voltage(self): return self.acceleration_voltage
[docs] def set_acceleration_voltage(self, acceleration_voltage): self.acceleration_voltage = acceleration_voltage
[docs] def get_c2_aperture_diameter(self): return self.c2_aperture_diameter
[docs] def set_c2_aperture_diameter(self, c2_aperture_diameter): self.c2_aperture_diameter = c2_aperture_diameter
[docs] def get_nominal_cs(self): return self.nominal_cs
[docs] def set_nominal_cs(self, nominal_cs): self.nominal_cs = nominal_cs
[docs] def get_nominal_defocus_min(self): return self.nominal_defocus_min
[docs] def set_nominal_defocus_min(self, nominal_defocus_min): self.nominal_defocus_min = nominal_defocus_min
[docs] def get_calibrated_defocus_min(self): return self.calibrated_defocus_min
[docs] def set_calibrated_defocus_min(self, calibrated_defocus_min): self.calibrated_defocus_min = calibrated_defocus_min
[docs] def get_nominal_defocus_max(self): return self.nominal_defocus_max
[docs] def set_nominal_defocus_max(self, nominal_defocus_max): self.nominal_defocus_max = nominal_defocus_max
[docs] def get_calibrated_defocus_max(self): return self.calibrated_defocus_max
[docs] def set_calibrated_defocus_max(self, calibrated_defocus_max): self.calibrated_defocus_max = calibrated_defocus_max
[docs] def get_nominal_magnification(self): return self.nominal_magnification
[docs] def set_nominal_magnification(self, nominal_magnification): self.nominal_magnification = nominal_magnification
[docs] def get_calibrated_magnification(self): return self.calibrated_magnification
[docs] def set_calibrated_magnification(self, calibrated_magnification): self.calibrated_magnification = calibrated_magnification
[docs] def get_specimen_holder_model(self): return self.specimen_holder_model
[docs] def set_specimen_holder_model(self, specimen_holder_model): self.specimen_holder_model = specimen_holder_model
[docs] def get_cooling_holder_cryogen(self): return self.cooling_holder_cryogen
[docs] def set_cooling_holder_cryogen(self, cooling_holder_cryogen): self.cooling_holder_cryogen = cooling_holder_cryogen
[docs] def get_temperature(self): return self.temperature
[docs] def set_temperature(self, temperature): self.temperature = temperature
[docs] def get_alignment_procedure(self): return self.alignment_procedure
[docs] def set_alignment_procedure(self, alignment_procedure): self.alignment_procedure = alignment_procedure
[docs] def get_specialist_optics(self): return self.specialist_optics
[docs] def set_specialist_optics(self, specialist_optics): self.specialist_optics = specialist_optics
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_date(self): return self.date
[docs] def set_date(self, date): self.date = date
[docs] def get_image_recording_list(self): return self.image_recording_list
[docs] def set_image_recording_list(self, image_recording_list): self.image_recording_list = image_recording_list
[docs] def get_specimen_holder(self): return self.specimen_holder
[docs] def set_specimen_holder(self, specimen_holder): self.specimen_holder = specimen_holder
[docs] def get_tilt_angle_min(self): return self.tilt_angle_min
[docs] def set_tilt_angle_min(self, tilt_angle_min): self.tilt_angle_min = tilt_angle_min
[docs] def get_tilt_angle_max(self): return self.tilt_angle_max
[docs] def set_tilt_angle_max(self, tilt_angle_max): self.tilt_angle_max = tilt_angle_max
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_microscopeType(self, value):
# Validate type microscopeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['FEI MORGAGNI', 'FEI POLARA 300', 'FEI TECNAI 12', 'FEI TECNAI 20', 'FEI TECNAI F20', 'FEI TECNAI F30', 'FEI TECNAI SPHERA', 'FEI TITAN KRIOS', 'FEI/PHILIPS CM120T', 'FEI/PHILIPS CM200FEG', 'FEI/PHILIPS CM2000FEG/SOPHIE', 'FEI/PHILIPS CM200FEG/ST', 'FEI/PHILIPS CM200FEG/UT', 'FEI/PHILIPS CM200T', 'FEI/PHILIPS CM300FEG/HE', 'FEI/PHIILIPS CM300FEG/ST', 'FEI/PHILIPS CM300FEG/T', 'FEI/PHILIPS EM400', 'FEI/PHILIPS EM420', 'HITACHI EF2000', 'HITACHI HF2000', 'HITACHI HF3000', 'HITACHI H-95000SD', 'JEOL100CX', 'JEOL 1010', 'JEOL 1200', 'JEOL 1200EX', 'JEOL 1200EXII', 'JEOL 1230', 'JEOL 2000EX', 'JEOL 2000EXII', 'JEOL 2010F', 'JEOL 2010HT', 'JEOL 2010UHR', 'JEOL 2100', 'JEOL 2100F', 'JEOL 2200FS', 'JEOL 2200FSC', 'JEOL 3000SFF', 'JEOL KYOTO-3000SFF', 'JEOL 3200FSC', 'JEOL 4000EX']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on microscopeType' % {"value" : value.encode("utf-8")} )
[docs] def validate_illumination_modeType(self, value):
# Validate type illumination_modeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['FLOOD BEAM', 'SPOT SCAN', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on illumination_modeType' % {"value" : value.encode("utf-8")} )
[docs] def validate_imaging_modeType(self, value):
# Validate type imaging_modeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['BRIGHT FIELD', 'DARK FIELD', 'DIFFRACTION', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on imaging_modeType' % {"value" : value.encode("utf-8")} )
[docs] def validate_electron_sourceType(self, value):
# Validate type electron_sourceType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['TUNGSTEN HAIRPIN', 'LAB6', 'FIELD EMISSION GUN']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on electron_sourceType' % {"value" : value.encode("utf-8")} )
[docs] def validate_allowed_magnification(self, value):
# Validate type allowed_magnification, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value < 100:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on allowed_magnification' % {"value" : value} )
if value > 100000:
warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on allowed_magnification' % {"value" : value} )
[docs] def validate_specimen_holder_modelType(self, value):
# Validate type specimen_holder_modelType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['GATAN HELIUM', 'GATAN LIQUID NITROGEN', 'HOME BUILD', 'JEM3400FSC CRYOHOLDER', 'JEOL', 'PHILIPS ROTATION HOLDER', 'SIDE ENTRY, EUCENTRIC', 'GATAN 626 SINGLE TILT LIQUID NITROGEN CRYO TRANSFER HOLDER', 'GATAN CT3500 SINGLE TILT LIQUID NITROGEN CRYO TRANSFER HOLDER', 'GATAN CT3500TR SINGLE TILT ROTATION LIQUID NITROGEN CRYO TRANSFER HOLDER', 'GATAN 910 MULTI-SPECIMEN SINGLE TILT CRYO TRANSFER HOLDER', 'GATAN 914 HIGH TILT LIQUID NITROGEN CRYO TRANSFER TOMOGRAPHY HOLDER', 'GATAN 915 DOUBLE TILT LIQUID NITROGEN CRYO TRANSFER HOLDER', 'GATAN UHRST 3500 SINGLE TILT ULTRA HIGH RESOLUTION NITROGEN COOLING HOLDER', 'GATAN CHDT 3504 DOUBLE TILT HIGH RESOLUTION NITROGEN COOLING HOLDER', 'GATAN HC 3500 SINGLE TILT HEATING/NITROGEN COOLING HOLDER', 'GATAN HCHST 3008 SINGLE TILT HIGH RESOLUTION HELIUM COOLING HOLDER', 'GATAN ULTST ULTRA LOW TEMPERATURE SINGLE TILT HELIUM COOLING HOLDER', 'GATAN HCHDT 3010 DOUBLE TILT HIGH RESOLUTION HELIUM COOLING HOLDER', 'GATAN ULTDT ULTRA LOW TEMPERATURE DOUBLE TILT HELIUM COOLING HOLDER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on specimen_holder_modelType' % {"value" : value.encode("utf-8")} )
[docs] def validate_cooling_holder_cryogenType(self, value):
# Validate type cooling_holder_cryogenType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['HELIUM', 'NITROGEN']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on cooling_holder_cryogenType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.specimen_preparations is not None or
self.microscope is not None or
self.illumination_mode is not None or
self.imaging_mode is not None or
self.electron_source is not None or
self.acceleration_voltage is not None or
self.c2_aperture_diameter is not None or
self.nominal_cs is not None or
self.nominal_defocus_min is not None or
self.calibrated_defocus_min is not None or
self.nominal_defocus_max is not None or
self.calibrated_defocus_max is not None or
self.nominal_magnification is not None or
self.calibrated_magnification is not None or
self.specimen_holder_model is not None or
self.cooling_holder_cryogen is not None or
self.temperature is not None or
self.alignment_procedure is not None or
self.specialist_optics is not None or
self.software_list is not None or
self.details is not None or
self.date is not None or
self.image_recording_list is not None or
self.specimen_holder is not None or
self.tilt_angle_min is not None or
self.tilt_angle_max is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_microscopy_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_microscopy_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_microscopy_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_microscopy_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_microscopy_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.specimen_preparations is not None:
self.specimen_preparations.export(outfile, level, namespace_, name_='specimen_preparations', pretty_print=pretty_print)
if self.microscope is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smicroscope>%s</%smicroscope>%s' % (namespace_, self.gds_format_string(quote_xml(self.microscope).encode(ExternalEncoding), input_name='microscope'), namespace_, eol_))
if self.illumination_mode is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sillumination_mode>%s</%sillumination_mode>%s' % (namespace_, self.gds_format_string(quote_xml(self.illumination_mode).encode(ExternalEncoding), input_name='illumination_mode'), namespace_, eol_))
if self.imaging_mode is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%simaging_mode>%s</%simaging_mode>%s' % (namespace_, self.gds_format_string(quote_xml(self.imaging_mode).encode(ExternalEncoding), input_name='imaging_mode'), namespace_, eol_))
if self.electron_source is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%selectron_source>%s</%selectron_source>%s' % (namespace_, self.gds_format_string(quote_xml(self.electron_source).encode(ExternalEncoding), input_name='electron_source'), namespace_, eol_))
if self.acceleration_voltage is not None:
self.acceleration_voltage.export(outfile, level, namespace_, name_='acceleration_voltage', pretty_print=pretty_print)
if self.c2_aperture_diameter is not None:
self.c2_aperture_diameter.export(outfile, level, namespace_, name_='c2_aperture_diameter', pretty_print=pretty_print)
if self.nominal_cs is not None:
self.nominal_cs.export(outfile, level, namespace_, name_='nominal_cs', pretty_print=pretty_print)
if self.nominal_defocus_min is not None:
self.nominal_defocus_min.export(outfile, level, namespace_, name_='nominal_defocus_min', pretty_print=pretty_print)
if self.calibrated_defocus_min is not None:
self.calibrated_defocus_min.export(outfile, level, namespace_, name_='calibrated_defocus_min', pretty_print=pretty_print)
if self.nominal_defocus_max is not None:
self.nominal_defocus_max.export(outfile, level, namespace_, name_='nominal_defocus_max', pretty_print=pretty_print)
if self.calibrated_defocus_max is not None:
self.calibrated_defocus_max.export(outfile, level, namespace_, name_='calibrated_defocus_max', pretty_print=pretty_print)
if self.nominal_magnification is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snominal_magnification>%s</%snominal_magnification>%s' % (namespace_, self.gds_format_float(self.nominal_magnification, input_name='nominal_magnification'), namespace_, eol_))
if self.calibrated_magnification is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scalibrated_magnification>%s</%scalibrated_magnification>%s' % (namespace_, self.gds_format_float(self.calibrated_magnification, input_name='calibrated_magnification'), namespace_, eol_))
if self.specimen_holder_model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sspecimen_holder_model>%s</%sspecimen_holder_model>%s' % (namespace_, self.gds_format_string(quote_xml(self.specimen_holder_model).encode(ExternalEncoding), input_name='specimen_holder_model'), namespace_, eol_))
if self.cooling_holder_cryogen is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scooling_holder_cryogen>%s</%scooling_holder_cryogen>%s' % (namespace_, self.gds_format_string(quote_xml(self.cooling_holder_cryogen).encode(ExternalEncoding), input_name='cooling_holder_cryogen'), namespace_, eol_))
if self.temperature is not None:
self.temperature.export(outfile, level, namespace_, name_='temperature', pretty_print=pretty_print)
if self.alignment_procedure is not None:
self.alignment_procedure.export(outfile, level, namespace_, name_='alignment_procedure', pretty_print=pretty_print)
if self.specialist_optics is not None:
self.specialist_optics.export(outfile, level, namespace_, name_='specialist_optics', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.date is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdate>%s</%sdate>%s' % (namespace_, self.gds_format_date(self.date, input_name='date'), namespace_, eol_))
if self.image_recording_list is not None:
self.image_recording_list.export(outfile, level, namespace_, name_='image_recording_list', pretty_print=pretty_print)
if self.specimen_holder is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sspecimen_holder>%s</%sspecimen_holder>%s' % (namespace_, self.gds_format_string(quote_xml(self.specimen_holder).encode(ExternalEncoding), input_name='specimen_holder'), namespace_, eol_))
if self.tilt_angle_min is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stilt_angle_min>%s</%stilt_angle_min>%s' % (namespace_, self.gds_format_string(quote_xml(self.tilt_angle_min).encode(ExternalEncoding), input_name='tilt_angle_min'), namespace_, eol_))
if self.tilt_angle_max is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stilt_angle_max>%s</%stilt_angle_max>%s' % (namespace_, self.gds_format_string(quote_xml(self.tilt_angle_max).encode(ExternalEncoding), input_name='tilt_angle_max'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'specimen_preparations':
obj_ = specimen_preparationsType.factory()
obj_.build(child_)
self.specimen_preparations = obj_
obj_.original_tagname_ = 'specimen_preparations'
elif nodeName_ == 'microscope':
microscope_ = child_.text
microscope_ = re_.sub(String_cleanup_pat_, " ", microscope_).strip()
microscope_ = self.gds_validate_string(microscope_, node, 'microscope')
self.microscope = microscope_
# validate type microscopeType
self.validate_microscopeType(self.microscope)
elif nodeName_ == 'illumination_mode':
illumination_mode_ = child_.text
illumination_mode_ = re_.sub(String_cleanup_pat_, " ", illumination_mode_).strip()
illumination_mode_ = self.gds_validate_string(illumination_mode_, node, 'illumination_mode')
self.illumination_mode = illumination_mode_
# validate type illumination_modeType
self.validate_illumination_modeType(self.illumination_mode)
elif nodeName_ == 'imaging_mode':
imaging_mode_ = child_.text
imaging_mode_ = re_.sub(String_cleanup_pat_, " ", imaging_mode_).strip()
imaging_mode_ = self.gds_validate_string(imaging_mode_, node, 'imaging_mode')
self.imaging_mode = imaging_mode_
# validate type imaging_modeType
self.validate_imaging_modeType(self.imaging_mode)
elif nodeName_ == 'electron_source':
electron_source_ = child_.text
electron_source_ = re_.sub(String_cleanup_pat_, " ", electron_source_).strip()
electron_source_ = self.gds_validate_string(electron_source_, node, 'electron_source')
self.electron_source = electron_source_
# validate type electron_sourceType
self.validate_electron_sourceType(self.electron_source)
elif nodeName_ == 'acceleration_voltage':
obj_ = acceleration_voltageType.factory()
obj_.build(child_)
self.acceleration_voltage = obj_
obj_.original_tagname_ = 'acceleration_voltage'
elif nodeName_ == 'c2_aperture_diameter':
obj_ = c2_aperture_diameterType.factory()
obj_.build(child_)
self.c2_aperture_diameter = obj_
obj_.original_tagname_ = 'c2_aperture_diameter'
elif nodeName_ == 'nominal_cs':
obj_ = nominal_csType.factory()
obj_.build(child_)
self.nominal_cs = obj_
obj_.original_tagname_ = 'nominal_cs'
elif nodeName_ == 'nominal_defocus_min':
obj_ = nominal_defocus_minType.factory()
obj_.build(child_)
self.nominal_defocus_min = obj_
obj_.original_tagname_ = 'nominal_defocus_min'
elif nodeName_ == 'calibrated_defocus_min':
obj_ = calibrated_defocus_minType.factory()
obj_.build(child_)
self.calibrated_defocus_min = obj_
obj_.original_tagname_ = 'calibrated_defocus_min'
elif nodeName_ == 'nominal_defocus_max':
obj_ = nominal_defocus_maxType.factory()
obj_.build(child_)
self.nominal_defocus_max = obj_
obj_.original_tagname_ = 'nominal_defocus_max'
elif nodeName_ == 'calibrated_defocus_max':
obj_ = calibrated_defocus_maxType.factory()
obj_.build(child_)
self.calibrated_defocus_max = obj_
obj_.original_tagname_ = 'calibrated_defocus_max'
elif nodeName_ == 'nominal_magnification':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'nominal_magnification')
self.nominal_magnification = fval_
# validate type allowed_magnification
self.validate_allowed_magnification(self.nominal_magnification)
elif nodeName_ == 'calibrated_magnification':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'calibrated_magnification')
self.calibrated_magnification = fval_
# validate type allowed_magnification
self.validate_allowed_magnification(self.calibrated_magnification)
elif nodeName_ == 'specimen_holder_model':
specimen_holder_model_ = child_.text
specimen_holder_model_ = re_.sub(String_cleanup_pat_, " ", specimen_holder_model_).strip()
specimen_holder_model_ = self.gds_validate_string(specimen_holder_model_, node, 'specimen_holder_model')
self.specimen_holder_model = specimen_holder_model_
# validate type specimen_holder_modelType
self.validate_specimen_holder_modelType(self.specimen_holder_model)
elif nodeName_ == 'cooling_holder_cryogen':
cooling_holder_cryogen_ = child_.text
cooling_holder_cryogen_ = re_.sub(String_cleanup_pat_, " ", cooling_holder_cryogen_).strip()
cooling_holder_cryogen_ = self.gds_validate_string(cooling_holder_cryogen_, node, 'cooling_holder_cryogen')
self.cooling_holder_cryogen = cooling_holder_cryogen_
# validate type cooling_holder_cryogenType
self.validate_cooling_holder_cryogenType(self.cooling_holder_cryogen)
elif nodeName_ == 'temperature':
obj_ = temperatureType.factory()
obj_.build(child_)
self.temperature = obj_
obj_.original_tagname_ = 'temperature'
elif nodeName_ == 'alignment_procedure':
obj_ = alignment_procedureType.factory()
obj_.build(child_)
self.alignment_procedure = obj_
obj_.original_tagname_ = 'alignment_procedure'
elif nodeName_ == 'specialist_optics':
obj_ = specialist_optics_type.factory()
obj_.build(child_)
self.specialist_optics = obj_
obj_.original_tagname_ = 'specialist_optics'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'date':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.date = dval_
elif nodeName_ == 'image_recording_list':
obj_ = image_recording_listType.factory()
obj_.build(child_)
self.image_recording_list = obj_
obj_.original_tagname_ = 'image_recording_list'
elif nodeName_ == 'specimen_holder':
specimen_holder_ = child_.text
specimen_holder_ = self.gds_validate_string(specimen_holder_, node, 'specimen_holder')
self.specimen_holder = specimen_holder_
elif nodeName_ == 'tilt_angle_min':
tilt_angle_min_ = child_.text
tilt_angle_min_ = self.gds_validate_string(tilt_angle_min_, node, 'tilt_angle_min')
self.tilt_angle_min = tilt_angle_min_
elif nodeName_ == 'tilt_angle_max':
tilt_angle_max_ = child_.text
tilt_angle_max_ = self.gds_validate_string(tilt_angle_max_, node, 'tilt_angle_max')
self.tilt_angle_max = tilt_angle_max_
# end class base_microscopy_type
[docs]class tilt_angle_min(GeneratedsSuper):
"""Deprecated (2014/11/14)SHOULD NOT BE USED FOR TOMOGRAPHY - only for
compatibility purposes with v1.9!! Use tomography microscopy
instead. Angle is assumed in degrees"""
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if tilt_angle_min.subclass:
return tilt_angle_min.subclass(*args_, **kwargs_)
else:
return tilt_angle_min(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_angle_min', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_angle_min')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_angle_min', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_angle_min'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_angle_min', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class tilt_angle_min
[docs]class tilt_angle_max(GeneratedsSuper):
"""Deprecated (2014/11/14)SHOULD NOT BE USED FOR TOMOGRAPHY - only for
compatibility purposes with v1.9!! Use tomography microscopy
instead. Angle is assumed in degrees"""
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if tilt_angle_max.subclass:
return tilt_angle_max.subclass(*args_, **kwargs_)
else:
return tilt_angle_max(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_angle_max', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_angle_max')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_angle_max', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_angle_max'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_angle_max', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class tilt_angle_max
[docs]class tomography_microscopy_type(base_microscopy_type):
member_data_items_ = [
MemberSpec_('tilt_series', 'tilt_series_type', 1),
]
subclass = None
superclass = base_microscopy_type
def __init__(self, id=None, specimen_preparations=None, microscope=None, illumination_mode=None, imaging_mode=None, electron_source=None, acceleration_voltage=None, c2_aperture_diameter=None, nominal_cs=None, nominal_defocus_min=None, calibrated_defocus_min=None, nominal_defocus_max=None, calibrated_defocus_max=None, nominal_magnification=None, calibrated_magnification=None, specimen_holder_model=None, cooling_holder_cryogen=None, temperature=None, alignment_procedure=None, specialist_optics=None, software_list=None, details=None, date=None, image_recording_list=None, specimen_holder=None, tilt_angle_min=None, tilt_angle_max=None, tilt_series=None):
self.original_tagname_ = None
super(tomography_microscopy_type, self).__init__(id, specimen_preparations, microscope, illumination_mode, imaging_mode, electron_source, acceleration_voltage, c2_aperture_diameter, nominal_cs, nominal_defocus_min, calibrated_defocus_min, nominal_defocus_max, calibrated_defocus_max, nominal_magnification, calibrated_magnification, specimen_holder_model, cooling_holder_cryogen, temperature, alignment_procedure, specialist_optics, software_list, details, date, image_recording_list, specimen_holder, tilt_angle_min, tilt_angle_max, )
if tilt_series is None:
self.tilt_series = []
else:
self.tilt_series = tilt_series
[docs] def factory(*args_, **kwargs_):
if tomography_microscopy_type.subclass:
return tomography_microscopy_type.subclass(*args_, **kwargs_)
else:
return tomography_microscopy_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_tilt_series(self): return self.tilt_series
[docs] def set_tilt_series(self, tilt_series): self.tilt_series = tilt_series
[docs] def add_tilt_series(self, value): self.tilt_series.append(value)
[docs] def insert_tilt_series_at(self, index, value): self.tilt_series.insert(index, value)
[docs] def replace_tilt_series_at(self, index, value): self.tilt_series[index] = value
[docs] def hasContent_(self):
if (
self.tilt_series or
super(tomography_microscopy_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tomography_microscopy_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_microscopy_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tomography_microscopy_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tomography_microscopy_type'):
super(tomography_microscopy_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_microscopy_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tomography_microscopy_type', fromsubclass_=False, pretty_print=True):
super(tomography_microscopy_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for tilt_series_ in self.tilt_series:
tilt_series_.export(outfile, level, namespace_, name_='tilt_series', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(tomography_microscopy_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'tilt_series':
obj_ = tilt_series_type.factory()
obj_.build(child_)
self.tilt_series.append(obj_)
obj_.original_tagname_ = 'tilt_series'
super(tomography_microscopy_type, self).buildChildren(child_, node, nodeName_, True)
# end class tomography_microscopy_type
[docs]class axis_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('min_angle', 'min_angleType', 0),
MemberSpec_('max_angle', 'max_angleType', 0),
MemberSpec_('angle_increment', 'angle_incrementType', 0),
]
subclass = None
superclass = None
def __init__(self, min_angle=None, max_angle=None, angle_increment=None, extensiontype_=None):
self.original_tagname_ = None
self.min_angle = min_angle
self.max_angle = max_angle
self.angle_increment = angle_increment
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if axis_type.subclass:
return axis_type.subclass(*args_, **kwargs_)
else:
return axis_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_min_angle(self): return self.min_angle
[docs] def set_min_angle(self, min_angle): self.min_angle = min_angle
[docs] def get_max_angle(self): return self.max_angle
[docs] def set_max_angle(self, max_angle): self.max_angle = max_angle
[docs] def get_angle_increment(self): return self.angle_increment
[docs] def set_angle_increment(self, angle_increment): self.angle_increment = angle_increment
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
self.min_angle is not None or
self.max_angle is not None or
self.angle_increment is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='axis_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='axis_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='axis_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='axis_type'):
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='axis_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.min_angle is not None:
self.min_angle.export(outfile, level, namespace_, name_='min_angle', pretty_print=pretty_print)
if self.max_angle is not None:
self.max_angle.export(outfile, level, namespace_, name_='max_angle', pretty_print=pretty_print)
if self.angle_increment is not None:
self.angle_increment.export(outfile, level, namespace_, name_='angle_increment', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'min_angle':
obj_ = min_angleType.factory()
obj_.build(child_)
self.min_angle = obj_
obj_.original_tagname_ = 'min_angle'
elif nodeName_ == 'max_angle':
obj_ = max_angleType.factory()
obj_.build(child_)
self.max_angle = obj_
obj_.original_tagname_ = 'max_angle'
elif nodeName_ == 'angle_increment':
obj_ = angle_incrementType.factory()
obj_.build(child_)
self.angle_increment = obj_
obj_.original_tagname_ = 'angle_increment'
# end class axis_type
[docs]class tilt_series_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('axis1', 'axis_type', 0),
MemberSpec_('axis2', 'axis2Type', 0),
MemberSpec_('axis_rotation', 'axis_rotationType', 0),
]
subclass = None
superclass = None
def __init__(self, axis1=None, axis2=None, axis_rotation=None):
self.original_tagname_ = None
self.axis1 = axis1
self.axis2 = axis2
self.axis_rotation = axis_rotation
[docs] def factory(*args_, **kwargs_):
if tilt_series_type.subclass:
return tilt_series_type.subclass(*args_, **kwargs_)
else:
return tilt_series_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_axis1(self): return self.axis1
[docs] def set_axis1(self, axis1): self.axis1 = axis1
[docs] def get_axis2(self): return self.axis2
[docs] def set_axis2(self, axis2): self.axis2 = axis2
[docs] def get_axis_rotation(self): return self.axis_rotation
[docs] def set_axis_rotation(self, axis_rotation): self.axis_rotation = axis_rotation
[docs] def hasContent_(self):
if (
self.axis1 is not None or
self.axis2 is not None or
self.axis_rotation is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_series_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_series_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_series_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_series_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_series_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.axis1 is not None:
self.axis1.export(outfile, level, namespace_, name_='axis1', pretty_print=pretty_print)
if self.axis2 is not None:
self.axis2.export(outfile, level, namespace_, name_='axis2', pretty_print=pretty_print)
if self.axis_rotation is not None:
self.axis_rotation.export(outfile, level, namespace_, name_='axis_rotation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'axis1':
class_obj_ = self.get_class_obj_(child_, axis_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.axis1 = obj_
obj_.original_tagname_ = 'axis1'
elif nodeName_ == 'axis2':
obj_ = axis2Type.factory()
obj_.build(child_)
self.axis2 = obj_
obj_.original_tagname_ = 'axis2'
elif nodeName_ == 'axis_rotation':
obj_ = axis_rotationType.factory()
obj_.build(child_)
self.axis_rotation = obj_
obj_.original_tagname_ = 'axis_rotation'
# end class tilt_series_type
[docs]class crystallography_microscopy_type(base_microscopy_type):
member_data_items_ = [
MemberSpec_('camera_length', 'camera_lengthType', 0),
MemberSpec_('tilt_list', 'tilt_listType', 0),
MemberSpec_('tilt_series', 'tilt_series_type', 1),
]
subclass = None
superclass = base_microscopy_type
def __init__(self, id=None, specimen_preparations=None, microscope=None, illumination_mode=None, imaging_mode=None, electron_source=None, acceleration_voltage=None, c2_aperture_diameter=None, nominal_cs=None, nominal_defocus_min=None, calibrated_defocus_min=None, nominal_defocus_max=None, calibrated_defocus_max=None, nominal_magnification=None, calibrated_magnification=None, specimen_holder_model=None, cooling_holder_cryogen=None, temperature=None, alignment_procedure=None, specialist_optics=None, software_list=None, details=None, date=None, image_recording_list=None, specimen_holder=None, tilt_angle_min=None, tilt_angle_max=None, camera_length=None, tilt_list=None, tilt_series=None):
self.original_tagname_ = None
super(crystallography_microscopy_type, self).__init__(id, specimen_preparations, microscope, illumination_mode, imaging_mode, electron_source, acceleration_voltage, c2_aperture_diameter, nominal_cs, nominal_defocus_min, calibrated_defocus_min, nominal_defocus_max, calibrated_defocus_max, nominal_magnification, calibrated_magnification, specimen_holder_model, cooling_holder_cryogen, temperature, alignment_procedure, specialist_optics, software_list, details, date, image_recording_list, specimen_holder, tilt_angle_min, tilt_angle_max, )
self.camera_length = camera_length
self.tilt_list = tilt_list
if tilt_series is None:
self.tilt_series = []
else:
self.tilt_series = tilt_series
[docs] def factory(*args_, **kwargs_):
if crystallography_microscopy_type.subclass:
return crystallography_microscopy_type.subclass(*args_, **kwargs_)
else:
return crystallography_microscopy_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_camera_length(self): return self.camera_length
[docs] def set_camera_length(self, camera_length): self.camera_length = camera_length
[docs] def get_tilt_list(self): return self.tilt_list
[docs] def set_tilt_list(self, tilt_list): self.tilt_list = tilt_list
[docs] def get_tilt_series(self): return self.tilt_series
[docs] def set_tilt_series(self, tilt_series): self.tilt_series = tilt_series
[docs] def add_tilt_series(self, value): self.tilt_series.append(value)
[docs] def insert_tilt_series_at(self, index, value): self.tilt_series.insert(index, value)
[docs] def replace_tilt_series_at(self, index, value): self.tilt_series[index] = value
[docs] def hasContent_(self):
if (
self.camera_length is not None or
self.tilt_list is not None or
self.tilt_series or
super(crystallography_microscopy_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_microscopy_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_microscopy_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_microscopy_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_microscopy_type'):
super(crystallography_microscopy_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_microscopy_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_microscopy_type', fromsubclass_=False, pretty_print=True):
super(crystallography_microscopy_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.camera_length is not None:
self.camera_length.export(outfile, level, namespace_, name_='camera_length', pretty_print=pretty_print)
if self.tilt_list is not None:
self.tilt_list.export(outfile, level, namespace_, name_='tilt_list', pretty_print=pretty_print)
for tilt_series_ in self.tilt_series:
tilt_series_.export(outfile, level, namespace_, name_='tilt_series', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(crystallography_microscopy_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'camera_length':
obj_ = camera_lengthType.factory()
obj_.build(child_)
self.camera_length = obj_
obj_.original_tagname_ = 'camera_length'
elif nodeName_ == 'tilt_list':
obj_ = tilt_listType.factory()
obj_.build(child_)
self.tilt_list = obj_
obj_.original_tagname_ = 'tilt_list'
elif nodeName_ == 'tilt_series':
obj_ = tilt_series_type.factory()
obj_.build(child_)
self.tilt_series.append(obj_)
obj_.original_tagname_ = 'tilt_series'
super(crystallography_microscopy_type, self).buildChildren(child_, node, nodeName_, True)
# end class crystallography_microscopy_type
[docs]class crystallography_tilt_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if crystallography_tilt_type.subclass:
return crystallography_tilt_type.subclass(*args_, **kwargs_)
else:
return crystallography_tilt_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_tilt_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_tilt_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_tilt_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_tilt_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_tilt_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class crystallography_tilt_type
[docs]class image_recording_type(GeneratedsSuper):
"""Images may have been recorded on different detectors"""
member_data_items_ = [
MemberSpec_('film', 'xs:string', 1),
]
subclass = None
superclass = None
def __init__(self, film=None):
self.original_tagname_ = None
if film is None:
self.film = []
else:
self.film = film
[docs] def factory(*args_, **kwargs_):
if image_recording_type.subclass:
return image_recording_type.subclass(*args_, **kwargs_)
else:
return image_recording_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_film(self): return self.film
[docs] def set_film(self, film): self.film = film
[docs] def add_film(self, value): self.film.append(value)
[docs] def insert_film_at(self, index, value): self.film.insert(index, value)
[docs] def replace_film_at(self, index, value): self.film[index] = value
[docs] def hasContent_(self):
if (
self.film
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='image_recording_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='image_recording_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='image_recording_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='image_recording_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='image_recording_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for film_ in self.film:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfilm>%s</%sfilm>%s' % (namespace_, self.gds_format_string(quote_xml(film_).encode(ExternalEncoding), input_name='film'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'film':
film_ = child_.text
film_ = self.gds_validate_string(film_, node, 'film')
self.film.append(film_)
# end class image_recording_type
[docs]class film(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if film.subclass:
return film.subclass(*args_, **kwargs_)
else:
return film(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='film', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='film')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='film', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='film'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='film', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class film
[docs]class reconstruction_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_images_used', 'xs:positiveInteger', 0),
MemberSpec_('number_classes_used', 'xs:positiveInteger', 0),
MemberSpec_('applied_symmetry', 'applied_symmetry_type', 0),
MemberSpec_('algorithm', ['reconstruction_algorithm_type', 'xs:token'], 0),
MemberSpec_('resolution', 'resolutionType', 0),
MemberSpec_('resolution_method', ['resolution_methodType', 'xs:token'], 0),
MemberSpec_('reconstruction_filtering', 'reconstruction_filtering_type', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_images_used=None, number_classes_used=None, applied_symmetry=None, algorithm=None, resolution=None, resolution_method=None, reconstruction_filtering=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_images_used = number_images_used
self.number_classes_used = number_classes_used
self.applied_symmetry = applied_symmetry
self.algorithm = algorithm
self.validate_reconstruction_algorithm_type(self.algorithm)
self.resolution = resolution
self.resolution_method = resolution_method
self.validate_resolution_methodType(self.resolution_method)
self.reconstruction_filtering = reconstruction_filtering
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if reconstruction_type.subclass:
return reconstruction_type.subclass(*args_, **kwargs_)
else:
return reconstruction_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_images_used(self): return self.number_images_used
[docs] def set_number_images_used(self, number_images_used): self.number_images_used = number_images_used
[docs] def get_number_classes_used(self): return self.number_classes_used
[docs] def set_number_classes_used(self, number_classes_used): self.number_classes_used = number_classes_used
[docs] def get_applied_symmetry(self): return self.applied_symmetry
[docs] def set_applied_symmetry(self, applied_symmetry): self.applied_symmetry = applied_symmetry
[docs] def get_algorithm(self): return self.algorithm
[docs] def set_algorithm(self, algorithm): self.algorithm = algorithm
[docs] def get_resolution(self): return self.resolution
[docs] def set_resolution(self, resolution): self.resolution = resolution
[docs] def get_resolution_method(self): return self.resolution_method
[docs] def set_resolution_method(self, resolution_method): self.resolution_method = resolution_method
[docs] def get_reconstruction_filtering(self): return self.reconstruction_filtering
[docs] def set_reconstruction_filtering(self, reconstruction_filtering): self.reconstruction_filtering = reconstruction_filtering
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_reconstruction_algorithm_type(self, value):
# Validate type reconstruction_algorithm_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['ARTS', 'SIRT', 'BACK-PROJECTION RECONSTRUCTION', 'EXACT BACK-PROJECTION RECONSTRUCTION', 'FOURIER SPACE RECONSTRUCTION']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on reconstruction_algorithm_type' % {"value" : value.encode("utf-8")} )
[docs] def validate_resolution_methodType(self, value):
# Validate type resolution_methodType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['FSC 0.5 CUT-OFF', 'FSC 0.33 CUT-OFF', 'FSC 0.143 CUT-OFF', u'3\u03c3']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on resolution_methodType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.number_images_used is not None or
self.number_classes_used is not None or
self.applied_symmetry is not None or
self.algorithm is not None or
self.resolution is not None or
self.resolution_method is not None or
self.reconstruction_filtering is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='reconstruction_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='reconstruction_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='reconstruction_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='reconstruction_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='reconstruction_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_images_used is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_images_used>%s</%snumber_images_used>%s' % (namespace_, self.gds_format_integer(self.number_images_used, input_name='number_images_used'), namespace_, eol_))
if self.number_classes_used is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_classes_used>%s</%snumber_classes_used>%s' % (namespace_, self.gds_format_integer(self.number_classes_used, input_name='number_classes_used'), namespace_, eol_))
if self.applied_symmetry is not None:
self.applied_symmetry.export(outfile, level, namespace_, name_='applied_symmetry', pretty_print=pretty_print)
if self.algorithm is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%salgorithm>%s</%salgorithm>%s' % (namespace_, self.gds_format_string(quote_xml(self.algorithm).encode(ExternalEncoding), input_name='algorithm'), namespace_, eol_))
if self.resolution is not None:
self.resolution.export(outfile, level, namespace_, name_='resolution', pretty_print=pretty_print)
if self.resolution_method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sresolution_method>%s</%sresolution_method>%s' % (namespace_, self.gds_format_string(quote_xml(self.resolution_method).encode(ExternalEncoding), input_name='resolution_method'), namespace_, eol_))
if self.reconstruction_filtering is not None:
self.reconstruction_filtering.export(outfile, level, namespace_, name_='reconstruction_filtering', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_images_used':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_images_used')
self.number_images_used = ival_
elif nodeName_ == 'number_classes_used':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_classes_used')
self.number_classes_used = ival_
elif nodeName_ == 'applied_symmetry':
obj_ = applied_symmetry_type.factory()
obj_.build(child_)
self.applied_symmetry = obj_
obj_.original_tagname_ = 'applied_symmetry'
elif nodeName_ == 'algorithm':
algorithm_ = child_.text
algorithm_ = re_.sub(String_cleanup_pat_, " ", algorithm_).strip()
algorithm_ = self.gds_validate_string(algorithm_, node, 'algorithm')
self.algorithm = algorithm_
# validate type reconstruction_algorithm_type
self.validate_reconstruction_algorithm_type(self.algorithm)
elif nodeName_ == 'resolution':
obj_ = resolutionType.factory()
obj_.build(child_)
self.resolution = obj_
obj_.original_tagname_ = 'resolution'
elif nodeName_ == 'resolution_method':
resolution_method_ = child_.text
resolution_method_ = re_.sub(String_cleanup_pat_, " ", resolution_method_).strip()
resolution_method_ = self.gds_validate_string(resolution_method_, node, 'resolution_method')
self.resolution_method = resolution_method_
# validate type resolution_methodType
self.validate_resolution_methodType(self.resolution_method)
elif nodeName_ == 'reconstruction_filtering':
obj_ = reconstruction_filtering_type.factory()
obj_.build(child_)
self.reconstruction_filtering = obj_
obj_.original_tagname_ = 'reconstruction_filtering'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class reconstruction_type
[docs]class film_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('film_material', 'xs:token', 0),
MemberSpec_('film_topology', ['film_topologyType', 'xs:token'], 0),
MemberSpec_('film_thickness', 'film_thicknessType', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, film_material=None, film_topology=None, film_thickness=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.film_material = film_material
self.film_topology = film_topology
self.validate_film_topologyType(self.film_topology)
self.film_thickness = film_thickness
[docs] def factory(*args_, **kwargs_):
if film_type.subclass:
return film_type.subclass(*args_, **kwargs_)
else:
return film_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_film_material(self): return self.film_material
[docs] def set_film_material(self, film_material): self.film_material = film_material
[docs] def get_film_topology(self): return self.film_topology
[docs] def set_film_topology(self, film_topology): self.film_topology = film_topology
[docs] def get_film_thickness(self): return self.film_thickness
[docs] def set_film_thickness(self, film_thickness): self.film_thickness = film_thickness
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def validate_film_topologyType(self, value):
# Validate type film_topologyType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['CONTINUOUS', 'LACEY', 'HOLEY', 'HOLEARRAY']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on film_topologyType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.film_material is not None or
self.film_topology is not None or
self.film_thickness is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='film_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='film_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='film_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='film_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='film_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.film_material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfilm_material>%s</%sfilm_material>%s' % (namespace_, self.gds_format_string(quote_xml(self.film_material).encode(ExternalEncoding), input_name='film_material'), namespace_, eol_))
if self.film_topology is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfilm_topology>%s</%sfilm_topology>%s' % (namespace_, self.gds_format_string(quote_xml(self.film_topology).encode(ExternalEncoding), input_name='film_topology'), namespace_, eol_))
if self.film_thickness is not None:
self.film_thickness.export(outfile, level, namespace_, name_='film_thickness', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'film_material':
film_material_ = child_.text
film_material_ = re_.sub(String_cleanup_pat_, " ", film_material_).strip()
film_material_ = self.gds_validate_string(film_material_, node, 'film_material')
self.film_material = film_material_
elif nodeName_ == 'film_topology':
film_topology_ = child_.text
film_topology_ = re_.sub(String_cleanup_pat_, " ", film_topology_).strip()
film_topology_ = self.gds_validate_string(film_topology_, node, 'film_topology')
self.film_topology = film_topology_
# validate type film_topologyType
self.validate_film_topologyType(self.film_topology)
elif nodeName_ == 'film_thickness':
obj_ = film_thicknessType.factory()
obj_.build(child_)
self.film_thickness = obj_
obj_.original_tagname_ = 'film_thickness'
# end class film_type
[docs]class coordinate_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('spatial_frequency', 'spatial_frequencyType', 0),
MemberSpec_('y', ['yType', 'xs:float'], 0),
MemberSpec_('y_noise', ['y_noiseType', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, spatial_frequency=None, y=None, y_noise=None):
self.original_tagname_ = None
self.spatial_frequency = spatial_frequency
self.y = y
self.validate_yType(self.y)
self.y_noise = y_noise
self.validate_y_noiseType(self.y_noise)
[docs] def factory(*args_, **kwargs_):
if coordinate_type.subclass:
return coordinate_type.subclass(*args_, **kwargs_)
else:
return coordinate_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_spatial_frequency(self): return self.spatial_frequency
[docs] def set_spatial_frequency(self, spatial_frequency): self.spatial_frequency = spatial_frequency
[docs] def get_y(self): return self.y
[docs] def set_y(self, y): self.y = y
[docs] def get_y_noise(self): return self.y_noise
[docs] def set_y_noise(self, y_noise): self.y_noise = y_noise
[docs] def validate_yType(self, value):
# Validate type yType, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value < 0:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on yType' % {"value" : value} )
[docs] def validate_y_noiseType(self, value):
# Validate type y_noiseType, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value < 0:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on y_noiseType' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.spatial_frequency is not None or
self.y is not None or
self.y_noise is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='coordinate_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='coordinate_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='coordinate_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='coordinate_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='coordinate_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.spatial_frequency is not None:
self.spatial_frequency.export(outfile, level, namespace_, name_='spatial_frequency', pretty_print=pretty_print)
if self.y is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sy>%s</%sy>%s' % (namespace_, self.gds_format_float(self.y, input_name='y'), namespace_, eol_))
if self.y_noise is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sy_noise>%s</%sy_noise>%s' % (namespace_, self.gds_format_float(self.y_noise, input_name='y_noise'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'spatial_frequency':
obj_ = spatial_frequencyType.factory()
obj_.build(child_)
self.spatial_frequency = obj_
obj_.original_tagname_ = 'spatial_frequency'
elif nodeName_ == 'y':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'y')
self.y = fval_
# validate type yType
self.validate_yType(self.y)
elif nodeName_ == 'y_noise':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'y_noise')
self.y_noise = fval_
# validate type y_noiseType
self.validate_y_noiseType(self.y_noise)
# end class coordinate_type
[docs]class ctf_correction_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('phase_reversal', 'phase_reversalType', 0),
MemberSpec_('amplitude_correction', 'amplitude_correctionType', 0),
MemberSpec_('correction_operation', ['correction_operationType', 'xs:string'], 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, phase_reversal=None, amplitude_correction=None, correction_operation=None, software_list=None, details=None):
self.original_tagname_ = None
self.phase_reversal = phase_reversal
self.amplitude_correction = amplitude_correction
self.correction_operation = correction_operation
self.validate_correction_operationType(self.correction_operation)
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if ctf_correction_type.subclass:
return ctf_correction_type.subclass(*args_, **kwargs_)
else:
return ctf_correction_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_phase_reversal(self): return self.phase_reversal
[docs] def set_phase_reversal(self, phase_reversal): self.phase_reversal = phase_reversal
[docs] def get_amplitude_correction(self): return self.amplitude_correction
[docs] def set_amplitude_correction(self, amplitude_correction): self.amplitude_correction = amplitude_correction
[docs] def get_correction_operation(self): return self.correction_operation
[docs] def set_correction_operation(self, correction_operation): self.correction_operation = correction_operation
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_correction_operationType(self, value):
# Validate type correction_operationType, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['MULTIPLICATION', 'DIVISION']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on correction_operationType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.phase_reversal is not None or
self.amplitude_correction is not None or
self.correction_operation is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='ctf_correction_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='ctf_correction_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='ctf_correction_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ctf_correction_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ctf_correction_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.phase_reversal is not None:
self.phase_reversal.export(outfile, level, namespace_, name_='phase_reversal', pretty_print=pretty_print)
if self.amplitude_correction is not None:
self.amplitude_correction.export(outfile, level, namespace_, name_='amplitude_correction', pretty_print=pretty_print)
if self.correction_operation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scorrection_operation>%s</%scorrection_operation>%s' % (namespace_, self.gds_format_string(quote_xml(self.correction_operation).encode(ExternalEncoding), input_name='correction_operation'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'phase_reversal':
obj_ = phase_reversalType.factory()
obj_.build(child_)
self.phase_reversal = obj_
obj_.original_tagname_ = 'phase_reversal'
elif nodeName_ == 'amplitude_correction':
obj_ = amplitude_correctionType.factory()
obj_.build(child_)
self.amplitude_correction = obj_
obj_.original_tagname_ = 'amplitude_correction'
elif nodeName_ == 'correction_operation':
correction_operation_ = child_.text
correction_operation_ = self.gds_validate_string(correction_operation_, node, 'correction_operation')
self.correction_operation = correction_operation_
# validate type correction_operationType
self.validate_correction_operationType(self.correction_operation)
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class ctf_correction_type
[docs]class angle_assignment_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type_', ['typeType8', 'xs:token'], 0),
MemberSpec_('projection_matching_processing', 'projection_matching_processingType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, projection_matching_processing=None, software_list=None, details=None):
self.original_tagname_ = None
self.type_ = type_
self.validate_typeType8(self.type_)
self.projection_matching_processing = projection_matching_processing
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if angle_assignment_type.subclass:
return angle_assignment_type.subclass(*args_, **kwargs_)
else:
return angle_assignment_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_projection_matching_processing(self): return self.projection_matching_processing
[docs] def set_projection_matching_processing(self, projection_matching_processing): self.projection_matching_processing = projection_matching_processing
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_typeType8(self, value):
# Validate type typeType8, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['ANGULAR RECONSTITUTION', 'COMMON LINES', 'PROJECTION MATCHING', 'RANDOM ASSIGNMENT']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on typeType8' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.type_ is not None or
self.projection_matching_processing is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angle_assignment_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angle_assignment_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='angle_assignment_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angle_assignment_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angle_assignment_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.type_ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_))
if self.projection_matching_processing is not None:
self.projection_matching_processing.export(outfile, level, namespace_, name_='projection_matching_processing', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'type':
type_ = child_.text
type_ = re_.sub(String_cleanup_pat_, " ", type_).strip()
type_ = self.gds_validate_string(type_, node, 'type')
self.type_ = type_
# validate type typeType8
self.validate_typeType8(self.type_)
elif nodeName_ == 'projection_matching_processing':
obj_ = projection_matching_processingType.factory()
obj_.build(child_)
self.projection_matching_processing = obj_
obj_.original_tagname_ = 'projection_matching_processing'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class angle_assignment_type
[docs]class modelling_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('initial_model', 'initial_modelType', 1),
MemberSpec_('final_model', 'final_modelType', 0),
MemberSpec_('refinement_protocol', ['refinement_protocolType', 'xs:string'], 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('target_criteria', 'xs:token', 0),
MemberSpec_('refinement_space', 'xs:token', 0),
MemberSpec_('overall_bvalue', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, initial_model=None, final_model=None, refinement_protocol=None, software_list=None, details=None, target_criteria=None, refinement_space=None, overall_bvalue=None):
self.original_tagname_ = None
if initial_model is None:
self.initial_model = []
else:
self.initial_model = initial_model
self.final_model = final_model
self.refinement_protocol = refinement_protocol
self.validate_refinement_protocolType(self.refinement_protocol)
self.software_list = software_list
self.details = details
self.target_criteria = target_criteria
self.refinement_space = refinement_space
self.overall_bvalue = overall_bvalue
[docs] def factory(*args_, **kwargs_):
if modelling_type.subclass:
return modelling_type.subclass(*args_, **kwargs_)
else:
return modelling_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_initial_model(self): return self.initial_model
[docs] def set_initial_model(self, initial_model): self.initial_model = initial_model
[docs] def add_initial_model(self, value): self.initial_model.append(value)
[docs] def insert_initial_model_at(self, index, value): self.initial_model.insert(index, value)
[docs] def replace_initial_model_at(self, index, value): self.initial_model[index] = value
[docs] def get_final_model(self): return self.final_model
[docs] def set_final_model(self, final_model): self.final_model = final_model
[docs] def get_refinement_protocol(self): return self.refinement_protocol
[docs] def set_refinement_protocol(self, refinement_protocol): self.refinement_protocol = refinement_protocol
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_target_criteria(self): return self.target_criteria
[docs] def set_target_criteria(self, target_criteria): self.target_criteria = target_criteria
[docs] def get_refinement_space(self): return self.refinement_space
[docs] def set_refinement_space(self, refinement_space): self.refinement_space = refinement_space
[docs] def get_overall_bvalue(self): return self.overall_bvalue
[docs] def set_overall_bvalue(self, overall_bvalue): self.overall_bvalue = overall_bvalue
[docs] def validate_refinement_protocolType(self, value):
# Validate type refinement_protocolType, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['RIGID BODY FITTING', 'RIGID BODY DOCKING', 'FLEXIBLE FITTING', 'FLEXIBLE DOCKING']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on refinement_protocolType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.initial_model or
self.final_model is not None or
self.refinement_protocol is not None or
self.software_list is not None or
self.details is not None or
self.target_criteria is not None or
self.refinement_space is not None or
self.overall_bvalue is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='modelling_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='modelling_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='modelling_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='modelling_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='modelling_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for initial_model_ in self.initial_model:
initial_model_.export(outfile, level, namespace_, name_='initial_model', pretty_print=pretty_print)
if self.final_model is not None:
self.final_model.export(outfile, level, namespace_, name_='final_model', pretty_print=pretty_print)
if self.refinement_protocol is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srefinement_protocol>%s</%srefinement_protocol>%s' % (namespace_, self.gds_format_string(quote_xml(self.refinement_protocol).encode(ExternalEncoding), input_name='refinement_protocol'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.target_criteria is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%starget_criteria>%s</%starget_criteria>%s' % (namespace_, self.gds_format_string(quote_xml(self.target_criteria).encode(ExternalEncoding), input_name='target_criteria'), namespace_, eol_))
if self.refinement_space is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srefinement_space>%s</%srefinement_space>%s' % (namespace_, self.gds_format_string(quote_xml(self.refinement_space).encode(ExternalEncoding), input_name='refinement_space'), namespace_, eol_))
if self.overall_bvalue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soverall_bvalue>%s</%soverall_bvalue>%s' % (namespace_, self.gds_format_float(self.overall_bvalue, input_name='overall_bvalue'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'initial_model':
obj_ = initial_modelType.factory()
obj_.build(child_)
self.initial_model.append(obj_)
obj_.original_tagname_ = 'initial_model'
elif nodeName_ == 'final_model':
obj_ = final_modelType.factory()
obj_.build(child_)
self.final_model = obj_
obj_.original_tagname_ = 'final_model'
elif nodeName_ == 'refinement_protocol':
refinement_protocol_ = child_.text
refinement_protocol_ = self.gds_validate_string(refinement_protocol_, node, 'refinement_protocol')
self.refinement_protocol = refinement_protocol_
# validate type refinement_protocolType
self.validate_refinement_protocolType(self.refinement_protocol)
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'target_criteria':
target_criteria_ = child_.text
target_criteria_ = re_.sub(String_cleanup_pat_, " ", target_criteria_).strip()
target_criteria_ = self.gds_validate_string(target_criteria_, node, 'target_criteria')
self.target_criteria = target_criteria_
elif nodeName_ == 'refinement_space':
refinement_space_ = child_.text
refinement_space_ = re_.sub(String_cleanup_pat_, " ", refinement_space_).strip()
refinement_space_ = self.gds_validate_string(refinement_space_, node, 'refinement_space')
self.refinement_space = refinement_space_
elif nodeName_ == 'overall_bvalue':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'overall_bvalue')
self.overall_bvalue = fval_
# end class modelling_type
[docs]class maximum_likelihood_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('parameters', 'parametersType', 0),
MemberSpec_('noise_model', 'noise_modelType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, parameters=None, noise_model=None, software_list=None):
self.original_tagname_ = None
self.parameters = parameters
self.noise_model = noise_model
self.software_list = software_list
[docs] def factory(*args_, **kwargs_):
if maximum_likelihood_type.subclass:
return maximum_likelihood_type.subclass(*args_, **kwargs_)
else:
return maximum_likelihood_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_parameters(self): return self.parameters
[docs] def set_parameters(self, parameters): self.parameters = parameters
[docs] def get_noise_model(self): return self.noise_model
[docs] def set_noise_model(self, noise_model): self.noise_model = noise_model
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def hasContent_(self):
if (
self.parameters is not None or
self.noise_model is not None or
self.software_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='maximum_likelihood_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='maximum_likelihood_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='maximum_likelihood_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='maximum_likelihood_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='maximum_likelihood_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.parameters is not None:
self.parameters.export(outfile, level, namespace_, name_='parameters', pretty_print=pretty_print)
if self.noise_model is not None:
self.noise_model.export(outfile, level, namespace_, name_='noise_model', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'parameters':
obj_ = parametersType.factory()
obj_.build(child_)
self.parameters = obj_
obj_.original_tagname_ = 'parameters'
elif nodeName_ == 'noise_model':
obj_ = noise_modelType.factory()
obj_.build(child_)
self.noise_model = obj_
obj_.original_tagname_ = 'noise_model'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
# end class maximum_likelihood_type
[docs]class base_processing_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('image_recording_id', 'xs:positiveInteger', 0),
MemberSpec_('details', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, image_recording_id=None, details=None, extensiontype_=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.image_recording_id = image_recording_id
self.details = details
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_processing_type.subclass:
return base_processing_type.subclass(*args_, **kwargs_)
else:
return base_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_image_recording_id(self): return self.image_recording_id
[docs] def set_image_recording_id(self, image_recording_id): self.image_recording_id = image_recording_id
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
self.image_recording_id is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_processing_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_processing_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.image_recording_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%simage_recording_id>%s</%simage_recording_id>%s' % (namespace_, self.gds_format_integer(self.image_recording_id, input_name='image_recording_id'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'image_recording_id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'image_recording_id')
self.image_recording_id = ival_
elif nodeName_ == 'details':
details_ = child_.text
details_ = re_.sub(String_cleanup_pat_, " ", details_).strip()
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class base_processing_type
[docs]class singleparticle_processing_type(base_processing_type):
member_data_items_ = [
MemberSpec_('particle_selection', 'particle_selection_type', 1),
MemberSpec_('ctf_correction', 'ctf_correction_type', 0),
MemberSpec_('startup_model', 'starting_map_type', 0),
MemberSpec_('initial_angle_assignment', 'angle_assignment_type', 0),
MemberSpec_('final_reconstruction', 'reconstruction_type', 0),
MemberSpec_('final_angle_assignment', 'angle_assignment_type', 0),
MemberSpec_('final_multi_reference_alignment', 'final_multi_reference_alignmentType11', 0),
MemberSpec_('final_two_d_classification', 'classification_type', 0),
MemberSpec_('final_three_d_classification', 'classification_type', 0),
]
subclass = None
superclass = base_processing_type
def __init__(self, id=None, image_recording_id=None, details=None, particle_selection=None, ctf_correction=None, startup_model=None, initial_angle_assignment=None, final_reconstruction=None, final_angle_assignment=None, final_multi_reference_alignment=None, final_two_d_classification=None, final_three_d_classification=None):
self.original_tagname_ = None
super(singleparticle_processing_type, self).__init__(id, image_recording_id, details, )
if particle_selection is None:
self.particle_selection = []
else:
self.particle_selection = particle_selection
self.ctf_correction = ctf_correction
self.startup_model = startup_model
self.initial_angle_assignment = initial_angle_assignment
self.final_reconstruction = final_reconstruction
self.final_angle_assignment = final_angle_assignment
self.final_multi_reference_alignment = final_multi_reference_alignment
self.final_two_d_classification = final_two_d_classification
self.final_three_d_classification = final_three_d_classification
[docs] def factory(*args_, **kwargs_):
if singleparticle_processing_type.subclass:
return singleparticle_processing_type.subclass(*args_, **kwargs_)
else:
return singleparticle_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_particle_selection(self): return self.particle_selection
[docs] def set_particle_selection(self, particle_selection): self.particle_selection = particle_selection
[docs] def add_particle_selection(self, value): self.particle_selection.append(value)
[docs] def insert_particle_selection_at(self, index, value): self.particle_selection.insert(index, value)
[docs] def replace_particle_selection_at(self, index, value): self.particle_selection[index] = value
[docs] def get_ctf_correction(self): return self.ctf_correction
[docs] def set_ctf_correction(self, ctf_correction): self.ctf_correction = ctf_correction
[docs] def get_startup_model(self): return self.startup_model
[docs] def set_startup_model(self, startup_model): self.startup_model = startup_model
[docs] def get_initial_angle_assignment(self): return self.initial_angle_assignment
[docs] def set_initial_angle_assignment(self, initial_angle_assignment): self.initial_angle_assignment = initial_angle_assignment
[docs] def get_final_reconstruction(self): return self.final_reconstruction
[docs] def set_final_reconstruction(self, final_reconstruction): self.final_reconstruction = final_reconstruction
[docs] def get_final_angle_assignment(self): return self.final_angle_assignment
[docs] def set_final_angle_assignment(self, final_angle_assignment): self.final_angle_assignment = final_angle_assignment
[docs] def get_final_multi_reference_alignment(self): return self.final_multi_reference_alignment
[docs] def set_final_multi_reference_alignment(self, final_multi_reference_alignment): self.final_multi_reference_alignment = final_multi_reference_alignment
[docs] def get_final_two_d_classification(self): return self.final_two_d_classification
[docs] def set_final_two_d_classification(self, final_two_d_classification): self.final_two_d_classification = final_two_d_classification
[docs] def get_final_three_d_classification(self): return self.final_three_d_classification
[docs] def set_final_three_d_classification(self, final_three_d_classification): self.final_three_d_classification = final_three_d_classification
[docs] def hasContent_(self):
if (
self.particle_selection or
self.ctf_correction is not None or
self.startup_model is not None or
self.initial_angle_assignment is not None or
self.final_reconstruction is not None or
self.final_angle_assignment is not None or
self.final_multi_reference_alignment is not None or
self.final_two_d_classification is not None or
self.final_three_d_classification is not None or
super(singleparticle_processing_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='singleparticle_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='singleparticle_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='singleparticle_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='singleparticle_processing_type'):
super(singleparticle_processing_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='singleparticle_processing_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='singleparticle_processing_type', fromsubclass_=False, pretty_print=True):
super(singleparticle_processing_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for particle_selection_ in self.particle_selection:
particle_selection_.export(outfile, level, namespace_, name_='particle_selection', pretty_print=pretty_print)
if self.ctf_correction is not None:
self.ctf_correction.export(outfile, level, namespace_, name_='ctf_correction', pretty_print=pretty_print)
if self.startup_model is not None:
self.startup_model.export(outfile, level, namespace_, name_='startup_model', pretty_print=pretty_print)
if self.initial_angle_assignment is not None:
self.initial_angle_assignment.export(outfile, level, namespace_, name_='initial_angle_assignment', pretty_print=pretty_print)
if self.final_reconstruction is not None:
self.final_reconstruction.export(outfile, level, namespace_, name_='final_reconstruction', pretty_print=pretty_print)
if self.final_angle_assignment is not None:
self.final_angle_assignment.export(outfile, level, namespace_, name_='final_angle_assignment', pretty_print=pretty_print)
if self.final_multi_reference_alignment is not None:
self.final_multi_reference_alignment.export(outfile, level, namespace_, name_='final_multi_reference_alignment', pretty_print=pretty_print)
if self.final_two_d_classification is not None:
self.final_two_d_classification.export(outfile, level, namespace_, name_='final_two_d_classification', pretty_print=pretty_print)
if self.final_three_d_classification is not None:
self.final_three_d_classification.export(outfile, level, namespace_, name_='final_three_d_classification', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(singleparticle_processing_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'particle_selection':
obj_ = particle_selection_type.factory()
obj_.build(child_)
self.particle_selection.append(obj_)
obj_.original_tagname_ = 'particle_selection'
elif nodeName_ == 'ctf_correction':
obj_ = ctf_correction_type.factory()
obj_.build(child_)
self.ctf_correction = obj_
obj_.original_tagname_ = 'ctf_correction'
elif nodeName_ == 'startup_model':
obj_ = starting_map_type.factory()
obj_.build(child_)
self.startup_model = obj_
obj_.original_tagname_ = 'startup_model'
elif nodeName_ == 'initial_angle_assignment':
obj_ = angle_assignment_type.factory()
obj_.build(child_)
self.initial_angle_assignment = obj_
obj_.original_tagname_ = 'initial_angle_assignment'
elif nodeName_ == 'final_reconstruction':
obj_ = reconstruction_type.factory()
obj_.build(child_)
self.final_reconstruction = obj_
obj_.original_tagname_ = 'final_reconstruction'
elif nodeName_ == 'final_angle_assignment':
obj_ = angle_assignment_type.factory()
obj_.build(child_)
self.final_angle_assignment = obj_
obj_.original_tagname_ = 'final_angle_assignment'
elif nodeName_ == 'final_multi_reference_alignment':
obj_ = final_multi_reference_alignmentType11.factory()
obj_.build(child_)
self.final_multi_reference_alignment = obj_
obj_.original_tagname_ = 'final_multi_reference_alignment'
elif nodeName_ == 'final_two_d_classification':
obj_ = classification_type.factory()
obj_.build(child_)
self.final_two_d_classification = obj_
obj_.original_tagname_ = 'final_two_d_classification'
elif nodeName_ == 'final_three_d_classification':
obj_ = classification_type.factory()
obj_.build(child_)
self.final_three_d_classification = obj_
obj_.original_tagname_ = 'final_three_d_classification'
super(singleparticle_processing_type, self).buildChildren(child_, node, nodeName_, True)
# end class singleparticle_processing_type
[docs]class subtomogram_averaging_processing_type(base_processing_type):
member_data_items_ = [
MemberSpec_('final_reconstruction', 'subtomogram_reconstruction_type', 0),
MemberSpec_('extraction', 'extractionType13', 0),
MemberSpec_('ctf_correction', 'ctf_correction_type', 0),
MemberSpec_('final_multi_reference_alignment', 'final_multi_reference_alignmentType14', 0),
MemberSpec_('final_three_d_classification', 'classification_type', 0),
MemberSpec_('final_angle_assignment', 'angle_assignment_type', 0),
MemberSpec_('crystal_parameters', 'crystal_parameters_type', 0),
]
subclass = None
superclass = base_processing_type
def __init__(self, id=None, image_recording_id=None, details=None, final_reconstruction=None, extraction=None, ctf_correction=None, final_multi_reference_alignment=None, final_three_d_classification=None, final_angle_assignment=None, crystal_parameters=None):
self.original_tagname_ = None
super(subtomogram_averaging_processing_type, self).__init__(id, image_recording_id, details, )
self.final_reconstruction = final_reconstruction
self.extraction = extraction
self.ctf_correction = ctf_correction
self.final_multi_reference_alignment = final_multi_reference_alignment
self.final_three_d_classification = final_three_d_classification
self.final_angle_assignment = final_angle_assignment
self.crystal_parameters = crystal_parameters
[docs] def factory(*args_, **kwargs_):
if subtomogram_averaging_processing_type.subclass:
return subtomogram_averaging_processing_type.subclass(*args_, **kwargs_)
else:
return subtomogram_averaging_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_final_reconstruction(self): return self.final_reconstruction
[docs] def set_final_reconstruction(self, final_reconstruction): self.final_reconstruction = final_reconstruction
[docs] def get_ctf_correction(self): return self.ctf_correction
[docs] def set_ctf_correction(self, ctf_correction): self.ctf_correction = ctf_correction
[docs] def get_final_multi_reference_alignment(self): return self.final_multi_reference_alignment
[docs] def set_final_multi_reference_alignment(self, final_multi_reference_alignment): self.final_multi_reference_alignment = final_multi_reference_alignment
[docs] def get_final_three_d_classification(self): return self.final_three_d_classification
[docs] def set_final_three_d_classification(self, final_three_d_classification): self.final_three_d_classification = final_three_d_classification
[docs] def get_final_angle_assignment(self): return self.final_angle_assignment
[docs] def set_final_angle_assignment(self, final_angle_assignment): self.final_angle_assignment = final_angle_assignment
[docs] def get_crystal_parameters(self): return self.crystal_parameters
[docs] def set_crystal_parameters(self, crystal_parameters): self.crystal_parameters = crystal_parameters
[docs] def hasContent_(self):
if (
self.final_reconstruction is not None or
self.extraction is not None or
self.ctf_correction is not None or
self.final_multi_reference_alignment is not None or
self.final_three_d_classification is not None or
self.final_angle_assignment is not None or
self.crystal_parameters is not None or
super(subtomogram_averaging_processing_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='subtomogram_averaging_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='subtomogram_averaging_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='subtomogram_averaging_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='subtomogram_averaging_processing_type'):
super(subtomogram_averaging_processing_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='subtomogram_averaging_processing_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='subtomogram_averaging_processing_type', fromsubclass_=False, pretty_print=True):
super(subtomogram_averaging_processing_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.final_reconstruction is not None:
self.final_reconstruction.export(outfile, level, namespace_, name_='final_reconstruction', pretty_print=pretty_print)
if self.extraction is not None:
self.extraction.export(outfile, level, namespace_, name_='extraction', pretty_print=pretty_print)
if self.ctf_correction is not None:
self.ctf_correction.export(outfile, level, namespace_, name_='ctf_correction', pretty_print=pretty_print)
if self.final_multi_reference_alignment is not None:
self.final_multi_reference_alignment.export(outfile, level, namespace_, name_='final_multi_reference_alignment', pretty_print=pretty_print)
if self.final_three_d_classification is not None:
self.final_three_d_classification.export(outfile, level, namespace_, name_='final_three_d_classification', pretty_print=pretty_print)
if self.final_angle_assignment is not None:
self.final_angle_assignment.export(outfile, level, namespace_, name_='final_angle_assignment', pretty_print=pretty_print)
if self.crystal_parameters is not None:
self.crystal_parameters.export(outfile, level, namespace_, name_='crystal_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(subtomogram_averaging_processing_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'final_reconstruction':
obj_ = subtomogram_reconstruction_type.factory()
obj_.build(child_)
self.final_reconstruction = obj_
obj_.original_tagname_ = 'final_reconstruction'
elif nodeName_ == 'extraction':
obj_ = extractionType13.factory()
obj_.build(child_)
self.extraction = obj_
obj_.original_tagname_ = 'extraction'
elif nodeName_ == 'ctf_correction':
obj_ = ctf_correction_type.factory()
obj_.build(child_)
self.ctf_correction = obj_
obj_.original_tagname_ = 'ctf_correction'
elif nodeName_ == 'final_multi_reference_alignment':
obj_ = final_multi_reference_alignmentType14.factory()
obj_.build(child_)
self.final_multi_reference_alignment = obj_
obj_.original_tagname_ = 'final_multi_reference_alignment'
elif nodeName_ == 'final_three_d_classification':
obj_ = classification_type.factory()
obj_.build(child_)
self.final_three_d_classification = obj_
obj_.original_tagname_ = 'final_three_d_classification'
elif nodeName_ == 'final_angle_assignment':
obj_ = angle_assignment_type.factory()
obj_.build(child_)
self.final_angle_assignment = obj_
obj_.original_tagname_ = 'final_angle_assignment'
elif nodeName_ == 'crystal_parameters':
obj_ = crystal_parameters_type.factory()
obj_.build(child_)
self.crystal_parameters = obj_
obj_.original_tagname_ = 'crystal_parameters'
super(subtomogram_averaging_processing_type, self).buildChildren(child_, node, nodeName_, True)
# end class subtomogram_averaging_processing_type
[docs]class tomography_processing_type(base_processing_type):
member_data_items_ = [
MemberSpec_('final_reconstruction', 'reconstruction_type', 0),
MemberSpec_('series_aligment_software_list', 'software_list_type', 0),
MemberSpec_('ctf_correction', 'ctf_correction_type', 0),
MemberSpec_('crystal_parameters', 'crystal_parameters_type', 0),
]
subclass = None
superclass = base_processing_type
def __init__(self, id=None, image_recording_id=None, details=None, final_reconstruction=None, series_aligment_software_list=None, ctf_correction=None, crystal_parameters=None):
self.original_tagname_ = None
super(tomography_processing_type, self).__init__(id, image_recording_id, details, )
self.final_reconstruction = final_reconstruction
self.series_aligment_software_list = series_aligment_software_list
self.ctf_correction = ctf_correction
self.crystal_parameters = crystal_parameters
[docs] def factory(*args_, **kwargs_):
if tomography_processing_type.subclass:
return tomography_processing_type.subclass(*args_, **kwargs_)
else:
return tomography_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_final_reconstruction(self): return self.final_reconstruction
[docs] def set_final_reconstruction(self, final_reconstruction): self.final_reconstruction = final_reconstruction
[docs] def get_series_aligment_software_list(self): return self.series_aligment_software_list
[docs] def set_series_aligment_software_list(self, series_aligment_software_list): self.series_aligment_software_list = series_aligment_software_list
[docs] def get_ctf_correction(self): return self.ctf_correction
[docs] def set_ctf_correction(self, ctf_correction): self.ctf_correction = ctf_correction
[docs] def get_crystal_parameters(self): return self.crystal_parameters
[docs] def set_crystal_parameters(self, crystal_parameters): self.crystal_parameters = crystal_parameters
[docs] def hasContent_(self):
if (
self.final_reconstruction is not None or
self.series_aligment_software_list is not None or
self.ctf_correction is not None or
self.crystal_parameters is not None or
super(tomography_processing_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tomography_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tomography_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tomography_processing_type'):
super(tomography_processing_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='tomography_processing_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tomography_processing_type', fromsubclass_=False, pretty_print=True):
super(tomography_processing_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.final_reconstruction is not None:
self.final_reconstruction.export(outfile, level, namespace_, name_='final_reconstruction', pretty_print=pretty_print)
if self.series_aligment_software_list is not None:
self.series_aligment_software_list.export(outfile, level, namespace_, name_='series_aligment_software_list', pretty_print=pretty_print)
if self.ctf_correction is not None:
self.ctf_correction.export(outfile, level, namespace_, name_='ctf_correction', pretty_print=pretty_print)
if self.crystal_parameters is not None:
self.crystal_parameters.export(outfile, level, namespace_, name_='crystal_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(tomography_processing_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'final_reconstruction':
obj_ = reconstruction_type.factory()
obj_.build(child_)
self.final_reconstruction = obj_
obj_.original_tagname_ = 'final_reconstruction'
elif nodeName_ == 'series_aligment_software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.series_aligment_software_list = obj_
obj_.original_tagname_ = 'series_aligment_software_list'
elif nodeName_ == 'ctf_correction':
obj_ = ctf_correction_type.factory()
obj_.build(child_)
self.ctf_correction = obj_
obj_.original_tagname_ = 'ctf_correction'
elif nodeName_ == 'crystal_parameters':
obj_ = crystal_parameters_type.factory()
obj_.build(child_)
self.crystal_parameters = obj_
obj_.original_tagname_ = 'crystal_parameters'
super(tomography_processing_type, self).buildChildren(child_, node, nodeName_, True)
# end class tomography_processing_type
[docs]class crystallography_processing_type(base_processing_type):
member_data_items_ = [
MemberSpec_('final_reconstruction', 'reconstruction_type', 0),
MemberSpec_('crystal_parameters', 'crystal_parameters_type', 0),
MemberSpec_('startup_model', 'starting_map_type', 1),
MemberSpec_('ctf_correction', 'ctf_correction_type', 0),
MemberSpec_('molecular_replacement', 'molecular_replacementType15', 0),
MemberSpec_('lattice_distortion_correction', 'lattice_distortion_correctionType20', 0),
MemberSpec_('symmetry_determination', 'symmetry_determinationType21', 0),
MemberSpec_('merging', 'mergingType22', 0),
MemberSpec_('crystallography_statistics', 'crystallography_statistics_type', 0),
]
subclass = None
superclass = base_processing_type
def __init__(self, id=None, image_recording_id=None, details=None, final_reconstruction=None, crystal_parameters=None, startup_model=None, ctf_correction=None, molecular_replacement=None, lattice_distortion_correction=None, symmetry_determination=None, merging=None, crystallography_statistics=None):
self.original_tagname_ = None
super(crystallography_processing_type, self).__init__(id, image_recording_id, details, )
self.final_reconstruction = final_reconstruction
self.crystal_parameters = crystal_parameters
if startup_model is None:
self.startup_model = []
else:
self.startup_model = startup_model
self.ctf_correction = ctf_correction
self.molecular_replacement = molecular_replacement
self.lattice_distortion_correction = lattice_distortion_correction
self.symmetry_determination = symmetry_determination
self.merging = merging
self.crystallography_statistics = crystallography_statistics
[docs] def factory(*args_, **kwargs_):
if crystallography_processing_type.subclass:
return crystallography_processing_type.subclass(*args_, **kwargs_)
else:
return crystallography_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_final_reconstruction(self): return self.final_reconstruction
[docs] def set_final_reconstruction(self, final_reconstruction): self.final_reconstruction = final_reconstruction
[docs] def get_crystal_parameters(self): return self.crystal_parameters
[docs] def set_crystal_parameters(self, crystal_parameters): self.crystal_parameters = crystal_parameters
[docs] def get_startup_model(self): return self.startup_model
[docs] def set_startup_model(self, startup_model): self.startup_model = startup_model
[docs] def add_startup_model(self, value): self.startup_model.append(value)
[docs] def insert_startup_model_at(self, index, value): self.startup_model.insert(index, value)
[docs] def replace_startup_model_at(self, index, value): self.startup_model[index] = value
[docs] def get_ctf_correction(self): return self.ctf_correction
[docs] def set_ctf_correction(self, ctf_correction): self.ctf_correction = ctf_correction
[docs] def get_molecular_replacement(self): return self.molecular_replacement
[docs] def set_molecular_replacement(self, molecular_replacement): self.molecular_replacement = molecular_replacement
[docs] def get_lattice_distortion_correction(self): return self.lattice_distortion_correction
[docs] def set_lattice_distortion_correction(self, lattice_distortion_correction): self.lattice_distortion_correction = lattice_distortion_correction
[docs] def get_symmetry_determination(self): return self.symmetry_determination
[docs] def set_symmetry_determination(self, symmetry_determination): self.symmetry_determination = symmetry_determination
[docs] def get_merging(self): return self.merging
[docs] def set_merging(self, merging): self.merging = merging
[docs] def get_crystallography_statistics(self): return self.crystallography_statistics
[docs] def set_crystallography_statistics(self, crystallography_statistics): self.crystallography_statistics = crystallography_statistics
[docs] def hasContent_(self):
if (
self.final_reconstruction is not None or
self.crystal_parameters is not None or
self.startup_model or
self.ctf_correction is not None or
self.molecular_replacement is not None or
self.lattice_distortion_correction is not None or
self.symmetry_determination is not None or
self.merging is not None or
self.crystallography_statistics is not None or
super(crystallography_processing_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_processing_type'):
super(crystallography_processing_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_processing_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_processing_type', fromsubclass_=False, pretty_print=True):
super(crystallography_processing_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.final_reconstruction is not None:
self.final_reconstruction.export(outfile, level, namespace_, name_='final_reconstruction', pretty_print=pretty_print)
if self.crystal_parameters is not None:
self.crystal_parameters.export(outfile, level, namespace_, name_='crystal_parameters', pretty_print=pretty_print)
for startup_model_ in self.startup_model:
startup_model_.export(outfile, level, namespace_, name_='startup_model', pretty_print=pretty_print)
if self.ctf_correction is not None:
self.ctf_correction.export(outfile, level, namespace_, name_='ctf_correction', pretty_print=pretty_print)
if self.molecular_replacement is not None:
self.molecular_replacement.export(outfile, level, namespace_, name_='molecular_replacement', pretty_print=pretty_print)
if self.lattice_distortion_correction is not None:
self.lattice_distortion_correction.export(outfile, level, namespace_, name_='lattice_distortion_correction', pretty_print=pretty_print)
if self.symmetry_determination is not None:
self.symmetry_determination.export(outfile, level, namespace_, name_='symmetry_determination', pretty_print=pretty_print)
if self.merging is not None:
self.merging.export(outfile, level, namespace_, name_='merging', pretty_print=pretty_print)
if self.crystallography_statistics is not None:
self.crystallography_statistics.export(outfile, level, namespace_, name_='crystallography_statistics', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(crystallography_processing_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'final_reconstruction':
obj_ = reconstruction_type.factory()
obj_.build(child_)
self.final_reconstruction = obj_
obj_.original_tagname_ = 'final_reconstruction'
elif nodeName_ == 'crystal_parameters':
obj_ = crystal_parameters_type.factory()
obj_.build(child_)
self.crystal_parameters = obj_
obj_.original_tagname_ = 'crystal_parameters'
elif nodeName_ == 'startup_model':
obj_ = starting_map_type.factory()
obj_.build(child_)
self.startup_model.append(obj_)
obj_.original_tagname_ = 'startup_model'
elif nodeName_ == 'ctf_correction':
obj_ = ctf_correction_type.factory()
obj_.build(child_)
self.ctf_correction = obj_
obj_.original_tagname_ = 'ctf_correction'
elif nodeName_ == 'molecular_replacement':
obj_ = molecular_replacementType15.factory()
obj_.build(child_)
self.molecular_replacement = obj_
obj_.original_tagname_ = 'molecular_replacement'
elif nodeName_ == 'lattice_distortion_correction':
obj_ = lattice_distortion_correctionType20.factory()
obj_.build(child_)
self.lattice_distortion_correction = obj_
obj_.original_tagname_ = 'lattice_distortion_correction'
elif nodeName_ == 'symmetry_determination':
obj_ = symmetry_determinationType21.factory()
obj_.build(child_)
self.symmetry_determination = obj_
obj_.original_tagname_ = 'symmetry_determination'
elif nodeName_ == 'merging':
obj_ = mergingType22.factory()
obj_.build(child_)
self.merging = obj_
obj_.original_tagname_ = 'merging'
elif nodeName_ == 'crystallography_statistics':
obj_ = crystallography_statistics_type.factory()
obj_.build(child_)
self.crystallography_statistics = obj_
obj_.original_tagname_ = 'crystallography_statistics'
super(crystallography_processing_type, self).buildChildren(child_, node, nodeName_, True)
# end class crystallography_processing_type
[docs]class helical_processing_type(base_processing_type):
member_data_items_ = [
MemberSpec_('final_reconstruction', 'reconstruction_type', 0),
MemberSpec_('ctf_correction', 'ctf_correction_type', 0),
MemberSpec_('segment_selection', 'segment_selectionType23', 1),
MemberSpec_('refinement', 'refinementType27', 0),
MemberSpec_('startup_model', 'starting_map_type', 1),
MemberSpec_('layer_lines', 'layer_lines', 0),
MemberSpec_('initial_angle_assignment', 'angle_assignment_type', 0),
MemberSpec_('final_angle_assignment', 'angle_assignment_type', 0),
MemberSpec_('crystal_parameters', 'crystal_parameters_type', 0),
]
subclass = None
superclass = base_processing_type
def __init__(self, id=None, image_recording_id=None, details=None, final_reconstruction=None, ctf_correction=None, segment_selection=None, refinement=None, startup_model=None, layer_lines=None, initial_angle_assignment=None, final_angle_assignment=None, crystal_parameters=None):
self.original_tagname_ = None
super(helical_processing_type, self).__init__(id, image_recording_id, details, )
self.final_reconstruction = final_reconstruction
self.ctf_correction = ctf_correction
if segment_selection is None:
self.segment_selection = []
else:
self.segment_selection = segment_selection
self.refinement = refinement
if startup_model is None:
self.startup_model = []
else:
self.startup_model = startup_model
self.layer_lines = layer_lines
self.initial_angle_assignment = initial_angle_assignment
self.final_angle_assignment = final_angle_assignment
self.crystal_parameters = crystal_parameters
[docs] def factory(*args_, **kwargs_):
if helical_processing_type.subclass:
return helical_processing_type.subclass(*args_, **kwargs_)
else:
return helical_processing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_final_reconstruction(self): return self.final_reconstruction
[docs] def set_final_reconstruction(self, final_reconstruction): self.final_reconstruction = final_reconstruction
[docs] def get_ctf_correction(self): return self.ctf_correction
[docs] def set_ctf_correction(self, ctf_correction): self.ctf_correction = ctf_correction
[docs] def get_segment_selection(self): return self.segment_selection
[docs] def set_segment_selection(self, segment_selection): self.segment_selection = segment_selection
[docs] def add_segment_selection(self, value): self.segment_selection.append(value)
[docs] def insert_segment_selection_at(self, index, value): self.segment_selection.insert(index, value)
[docs] def replace_segment_selection_at(self, index, value): self.segment_selection[index] = value
[docs] def get_refinement(self): return self.refinement
[docs] def set_refinement(self, refinement): self.refinement = refinement
[docs] def get_startup_model(self): return self.startup_model
[docs] def set_startup_model(self, startup_model): self.startup_model = startup_model
[docs] def add_startup_model(self, value): self.startup_model.append(value)
[docs] def insert_startup_model_at(self, index, value): self.startup_model.insert(index, value)
[docs] def replace_startup_model_at(self, index, value): self.startup_model[index] = value
[docs] def get_layer_lines(self): return self.layer_lines
[docs] def set_layer_lines(self, layer_lines): self.layer_lines = layer_lines
[docs] def get_initial_angle_assignment(self): return self.initial_angle_assignment
[docs] def set_initial_angle_assignment(self, initial_angle_assignment): self.initial_angle_assignment = initial_angle_assignment
[docs] def get_final_angle_assignment(self): return self.final_angle_assignment
[docs] def set_final_angle_assignment(self, final_angle_assignment): self.final_angle_assignment = final_angle_assignment
[docs] def get_crystal_parameters(self): return self.crystal_parameters
[docs] def set_crystal_parameters(self, crystal_parameters): self.crystal_parameters = crystal_parameters
[docs] def hasContent_(self):
if (
self.final_reconstruction is not None or
self.ctf_correction is not None or
self.segment_selection or
self.refinement is not None or
self.startup_model or
self.layer_lines is not None or
self.initial_angle_assignment is not None or
self.final_angle_assignment is not None or
self.crystal_parameters is not None or
super(helical_processing_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='helical_processing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='helical_processing_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='helical_processing_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='helical_processing_type'):
super(helical_processing_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='helical_processing_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='helical_processing_type', fromsubclass_=False, pretty_print=True):
super(helical_processing_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.final_reconstruction is not None:
self.final_reconstruction.export(outfile, level, namespace_, name_='final_reconstruction', pretty_print=pretty_print)
if self.ctf_correction is not None:
self.ctf_correction.export(outfile, level, namespace_, name_='ctf_correction', pretty_print=pretty_print)
for segment_selection_ in self.segment_selection:
segment_selection_.export(outfile, level, namespace_, name_='segment_selection', pretty_print=pretty_print)
if self.refinement is not None:
self.refinement.export(outfile, level, namespace_, name_='refinement', pretty_print=pretty_print)
for startup_model_ in self.startup_model:
startup_model_.export(outfile, level, namespace_, name_='startup_model', pretty_print=pretty_print)
if self.layer_lines is not None:
self.layer_lines.export(outfile, level, namespace_, name_='layer_lines', pretty_print=pretty_print)
if self.initial_angle_assignment is not None:
self.initial_angle_assignment.export(outfile, level, namespace_, name_='initial_angle_assignment', pretty_print=pretty_print)
if self.final_angle_assignment is not None:
self.final_angle_assignment.export(outfile, level, namespace_, name_='final_angle_assignment', pretty_print=pretty_print)
if self.crystal_parameters is not None:
self.crystal_parameters.export(outfile, level, namespace_, name_='crystal_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(helical_processing_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'final_reconstruction':
obj_ = reconstruction_type.factory()
obj_.build(child_)
self.final_reconstruction = obj_
obj_.original_tagname_ = 'final_reconstruction'
elif nodeName_ == 'ctf_correction':
obj_ = ctf_correction_type.factory()
obj_.build(child_)
self.ctf_correction = obj_
obj_.original_tagname_ = 'ctf_correction'
elif nodeName_ == 'segment_selection':
obj_ = segment_selectionType23.factory()
obj_.build(child_)
self.segment_selection.append(obj_)
obj_.original_tagname_ = 'segment_selection'
elif nodeName_ == 'refinement':
obj_ = refinementType27.factory()
obj_.build(child_)
self.refinement = obj_
obj_.original_tagname_ = 'refinement'
elif nodeName_ == 'startup_model':
obj_ = starting_map_type.factory()
obj_.build(child_)
self.startup_model.append(obj_)
obj_.original_tagname_ = 'startup_model'
elif nodeName_ == 'layer_lines':
obj_ = layer_linesType29.factory()
obj_.build(child_)
self.layer_lines = obj_
obj_.original_tagname_ = 'layer_lines'
elif nodeName_ == 'initial_angle_assignment':
obj_ = angle_assignment_type.factory()
obj_.build(child_)
self.initial_angle_assignment = obj_
obj_.original_tagname_ = 'initial_angle_assignment'
elif nodeName_ == 'final_angle_assignment':
obj_ = angle_assignment_type.factory()
obj_.build(child_)
self.final_angle_assignment = obj_
obj_.original_tagname_ = 'final_angle_assignment'
elif nodeName_ == 'crystal_parameters':
obj_ = crystal_parameters_type.factory()
obj_.build(child_)
self.crystal_parameters = obj_
obj_.original_tagname_ = 'crystal_parameters'
super(helical_processing_type, self).buildChildren(child_, node, nodeName_, True)
# end class helical_processing_type
[docs]class applied_symmetry_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('space_group', ['plane_and_space_group_type', 'xs:token'], 0),
MemberSpec_('point_group', ['point_groupType', 'point_group_symmetry_type', 'xs:token'], 0),
MemberSpec_('helical_parameters', 'helical_parameters_type', 0),
]
subclass = None
superclass = None
def __init__(self, space_group=None, point_group=None, helical_parameters=None):
self.original_tagname_ = None
self.space_group = space_group
self.validate_plane_and_space_group_type(self.space_group)
self.point_group = point_group
self.validate_point_groupType(self.point_group)
self.helical_parameters = helical_parameters
[docs] def factory(*args_, **kwargs_):
if applied_symmetry_type.subclass:
return applied_symmetry_type.subclass(*args_, **kwargs_)
else:
return applied_symmetry_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_space_group(self): return self.space_group
[docs] def set_space_group(self, space_group): self.space_group = space_group
[docs] def get_point_group(self): return self.point_group
[docs] def set_point_group(self, point_group): self.point_group = point_group
[docs] def get_helical_parameters(self): return self.helical_parameters
[docs] def set_helical_parameters(self, helical_parameters): self.helical_parameters = helical_parameters
[docs] def validate_plane_and_space_group_type(self, value):
# Validate type plane_and_space_group_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['1', 'P 1', 'P 1 2', 'P 1 21', 'P 2', 'P 2 2 2', 'P 2 2 21', 'P 2 21 21', 'P 3', 'P 3 1 2', 'P 3 2 1', 'P 4', 'P 4 2 2', 'P 4 21 2', 'P 6', 'P 6 2 2', 'C 1 2', 'C 2 2']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on plane_and_space_group_type' % {"value" : value.encode("utf-8")} )
[docs] def validate_point_groupType(self, value):
# Validate type point_groupType, a restriction on point_group_symmetry_type.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_point_groupType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_point_groupType_patterns_, ))
validate_point_groupType_patterns_ = [['^C\\d+|D\\d+|O|T|I$'], ['^C\\d+|D\\d+|O|T|I$']]
[docs] def hasContent_(self):
if (
self.space_group is not None or
self.point_group is not None or
self.helical_parameters is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='applied_symmetry_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='applied_symmetry_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='applied_symmetry_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='applied_symmetry_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='applied_symmetry_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.space_group is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sspace_group>%s</%sspace_group>%s' % (namespace_, self.gds_format_string(quote_xml(self.space_group).encode(ExternalEncoding), input_name='space_group'), namespace_, eol_))
if self.point_group is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%spoint_group>%s</%spoint_group>%s' % (namespace_, self.gds_format_string(quote_xml(self.point_group).encode(ExternalEncoding), input_name='point_group'), namespace_, eol_))
if self.helical_parameters is not None:
self.helical_parameters.export(outfile, level, namespace_, name_='helical_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'space_group':
space_group_ = child_.text
space_group_ = re_.sub(String_cleanup_pat_, " ", space_group_).strip()
space_group_ = self.gds_validate_string(space_group_, node, 'space_group')
self.space_group = space_group_
# validate type plane_and_space_group_type
self.validate_plane_and_space_group_type(self.space_group)
elif nodeName_ == 'point_group':
point_group_ = child_.text
point_group_ = re_.sub(String_cleanup_pat_, " ", point_group_).strip()
point_group_ = self.gds_validate_string(point_group_, node, 'point_group')
self.point_group = point_group_
# validate type point_groupType
self.validate_point_groupType(self.point_group)
elif nodeName_ == 'helical_parameters':
obj_ = helical_parameters_type.factory()
obj_.build(child_)
self.helical_parameters = obj_
obj_.original_tagname_ = 'helical_parameters'
# end class applied_symmetry_type
[docs]class starting_map_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('random_conical_tilt', 'random_conical_tiltType', 0),
MemberSpec_('orthogonal_tilt', 'orthogonal_tiltType', 0),
MemberSpec_('emdb_id', ['emdb_id_type', 'xs:token'], 0),
MemberSpec_('pdb_model', 'pdb_model_type', 1),
MemberSpec_('insilico_model', 'xs:token', 0),
MemberSpec_('other', 'xs:string', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, random_conical_tilt=None, orthogonal_tilt=None, emdb_id=None, pdb_model=None, insilico_model=None, other=None, details=None):
self.original_tagname_ = None
self.random_conical_tilt = random_conical_tilt
self.orthogonal_tilt = orthogonal_tilt
self.emdb_id = emdb_id
self.validate_emdb_id_type(self.emdb_id)
if pdb_model is None:
self.pdb_model = []
else:
self.pdb_model = pdb_model
self.insilico_model = insilico_model
self.other = other
self.details = details
[docs] def factory(*args_, **kwargs_):
if starting_map_type.subclass:
return starting_map_type.subclass(*args_, **kwargs_)
else:
return starting_map_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_random_conical_tilt(self): return self.random_conical_tilt
[docs] def set_random_conical_tilt(self, random_conical_tilt): self.random_conical_tilt = random_conical_tilt
[docs] def get_orthogonal_tilt(self): return self.orthogonal_tilt
[docs] def set_orthogonal_tilt(self, orthogonal_tilt): self.orthogonal_tilt = orthogonal_tilt
[docs] def get_emdb_id(self): return self.emdb_id
[docs] def set_emdb_id(self, emdb_id): self.emdb_id = emdb_id
[docs] def get_pdb_model(self): return self.pdb_model
[docs] def set_pdb_model(self, pdb_model): self.pdb_model = pdb_model
[docs] def add_pdb_model(self, value): self.pdb_model.append(value)
[docs] def insert_pdb_model_at(self, index, value): self.pdb_model.insert(index, value)
[docs] def replace_pdb_model_at(self, index, value): self.pdb_model[index] = value
[docs] def get_insilico_model(self): return self.insilico_model
[docs] def set_insilico_model(self, insilico_model): self.insilico_model = insilico_model
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_emdb_id_type(self, value):
# Validate type emdb_id_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_emdb_id_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_emdb_id_type_patterns_, ))
validate_emdb_id_type_patterns_ = [['^EMD-\\d{4,}$']]
[docs] def hasContent_(self):
if (
self.random_conical_tilt is not None or
self.orthogonal_tilt is not None or
self.emdb_id is not None or
self.pdb_model or
self.insilico_model is not None or
self.other is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='starting_map_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='starting_map_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='starting_map_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='starting_map_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='starting_map_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.random_conical_tilt is not None:
self.random_conical_tilt.export(outfile, level, namespace_, name_='random_conical_tilt', pretty_print=pretty_print)
if self.orthogonal_tilt is not None:
self.orthogonal_tilt.export(outfile, level, namespace_, name_='orthogonal_tilt', pretty_print=pretty_print)
if self.emdb_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%semdb_id>%s</%semdb_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.emdb_id).encode(ExternalEncoding), input_name='emdb_id'), namespace_, eol_))
for pdb_model_ in self.pdb_model:
pdb_model_.export(outfile, level, namespace_, name_='pdb_model', pretty_print=pretty_print)
if self.insilico_model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sinsilico_model>%s</%sinsilico_model>%s' % (namespace_, self.gds_format_string(quote_xml(self.insilico_model).encode(ExternalEncoding), input_name='insilico_model'), namespace_, eol_))
if self.other is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother>%s</%sother>%s' % (namespace_, self.gds_format_string(quote_xml(self.other).encode(ExternalEncoding), input_name='other'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'random_conical_tilt':
obj_ = random_conical_tiltType.factory()
obj_.build(child_)
self.random_conical_tilt = obj_
obj_.original_tagname_ = 'random_conical_tilt'
elif nodeName_ == 'orthogonal_tilt':
obj_ = orthogonal_tiltType.factory()
obj_.build(child_)
self.orthogonal_tilt = obj_
obj_.original_tagname_ = 'orthogonal_tilt'
elif nodeName_ == 'emdb_id':
emdb_id_ = child_.text
emdb_id_ = re_.sub(String_cleanup_pat_, " ", emdb_id_).strip()
emdb_id_ = self.gds_validate_string(emdb_id_, node, 'emdb_id')
self.emdb_id = emdb_id_
# validate type emdb_id_type
self.validate_emdb_id_type(self.emdb_id)
elif nodeName_ == 'pdb_model':
obj_ = pdb_model_type.factory()
obj_.build(child_)
self.pdb_model.append(obj_)
obj_.original_tagname_ = 'pdb_model'
elif nodeName_ == 'insilico_model':
insilico_model_ = child_.text
insilico_model_ = re_.sub(String_cleanup_pat_, " ", insilico_model_).strip()
insilico_model_ = self.gds_validate_string(insilico_model_, node, 'insilico_model')
self.insilico_model = insilico_model_
elif nodeName_ == 'other':
other_ = child_.text
other_ = self.gds_validate_string(other_, node, 'other')
self.other = other_
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class starting_map_type
[docs]class map_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('size_kbytes', 'xs:positiveInteger', 0),
MemberSpec_('format', 'xs:string', 0),
MemberSpec_('file', ['fileType32', 'xs:token'], 0),
MemberSpec_('symmetry', 'applied_symmetry_type', 0),
MemberSpec_('data_type', ['map_data_type', 'xs:string'], 0),
MemberSpec_('dimensions', 'integer_vector_map_type', 0),
MemberSpec_('origin', 'originType', 0),
MemberSpec_('spacing', 'spacingType', 0),
MemberSpec_('cell', 'cell', 0),
MemberSpec_('axis_order', 'axis_orderType', 0),
MemberSpec_('statistics', 'map_statistics_type', 0),
MemberSpec_('pixel_spacing', 'pixel_spacingType', 0),
MemberSpec_('contour_list', 'contour_listType', 0),
MemberSpec_('label', 'xs:token', 0),
MemberSpec_('annotation_details', 'xs:string', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, size_kbytes=None, format=None, file=None, symmetry=None, data_type=None, dimensions=None, origin=None, spacing=None, cell=None, axis_order=None, statistics=None, pixel_spacing=None, contour_list=None, label=None, annotation_details=None, details=None):
self.original_tagname_ = None
self.size_kbytes = _cast(int, size_kbytes)
self.format = _cast(None, format)
self.file = file
self.validate_fileType32(self.file)
self.symmetry = symmetry
self.data_type = data_type
self.validate_map_data_type(self.data_type)
self.dimensions = dimensions
self.origin = origin
self.spacing = spacing
self.cell = cell
self.axis_order = axis_order
self.statistics = statistics
self.pixel_spacing = pixel_spacing
self.contour_list = contour_list
self.label = label
self.annotation_details = annotation_details
self.details = details
[docs] def factory(*args_, **kwargs_):
if map_type.subclass:
return map_type.subclass(*args_, **kwargs_)
else:
return map_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_file(self): return self.file
[docs] def set_file(self, file): self.file = file
[docs] def get_symmetry(self): return self.symmetry
[docs] def set_symmetry(self, symmetry): self.symmetry = symmetry
[docs] def get_data_type(self): return self.data_type
[docs] def set_data_type(self, data_type): self.data_type = data_type
[docs] def get_dimensions(self): return self.dimensions
[docs] def set_dimensions(self, dimensions): self.dimensions = dimensions
[docs] def get_origin(self): return self.origin
[docs] def set_origin(self, origin): self.origin = origin
[docs] def get_spacing(self): return self.spacing
[docs] def set_spacing(self, spacing): self.spacing = spacing
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def get_axis_order(self): return self.axis_order
[docs] def set_axis_order(self, axis_order): self.axis_order = axis_order
[docs] def get_statistics(self): return self.statistics
[docs] def set_statistics(self, statistics): self.statistics = statistics
[docs] def get_pixel_spacing(self): return self.pixel_spacing
[docs] def set_pixel_spacing(self, pixel_spacing): self.pixel_spacing = pixel_spacing
[docs] def get_contour_list(self): return self.contour_list
[docs] def set_contour_list(self, contour_list): self.contour_list = contour_list
[docs] def get_label(self): return self.label
[docs] def set_label(self, label): self.label = label
[docs] def get_annotation_details(self): return self.annotation_details
[docs] def set_annotation_details(self, annotation_details): self.annotation_details = annotation_details
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_size_kbytes(self): return self.size_kbytes
[docs] def set_size_kbytes(self, size_kbytes): self.size_kbytes = size_kbytes
[docs] def validate_fileType32(self, value):
# Validate type fileType32, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fileType32_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fileType32_patterns_, ))
validate_fileType32_patterns_ = [['^emd_\\d{4,}([A-Za-z0-9_]*).map(.gz|)$']]
[docs] def validate_map_data_type(self, value):
# Validate type map_data_type, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['IMAGE STORED AS SIGNED BYTE', 'IMAGE STORED AS SIGNED INTEGER (2 BYTES)', 'IMAGE STORED AS FLOATING POINT NUMBER (4 BYTES)']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on map_data_type' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.file is not None or
self.symmetry is not None or
self.data_type is not None or
self.dimensions is not None or
self.origin is not None or
self.spacing is not None or
self.cell is not None or
self.axis_order is not None or
self.statistics is not None or
self.pixel_spacing is not None or
self.contour_list is not None or
self.label is not None or
self.annotation_details is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='map_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='map_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='map_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='map_type'):
if self.size_kbytes is not None and 'size_kbytes' not in already_processed:
already_processed.add('size_kbytes')
outfile.write(' size_kbytes="%s"' % self.gds_format_integer(self.size_kbytes, input_name='size_kbytes'))
if self.format is not None and 'format' not in already_processed:
already_processed.add('format')
outfile.write(' format=%s' % (self.gds_format_string(quote_attrib(self.format).encode(ExternalEncoding), input_name='format'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='map_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.file is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfile>%s</%sfile>%s' % (namespace_, self.gds_format_string(quote_xml(self.file).encode(ExternalEncoding), input_name='file'), namespace_, eol_))
if self.symmetry is not None:
self.symmetry.export(outfile, level, namespace_, name_='symmetry', pretty_print=pretty_print)
if self.data_type is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdata_type>%s</%sdata_type>%s' % (namespace_, self.gds_format_string(quote_xml(self.data_type).encode(ExternalEncoding), input_name='data_type'), namespace_, eol_))
if self.dimensions is not None:
self.dimensions.export(outfile, level, namespace_, name_='dimensions', pretty_print=pretty_print)
if self.origin is not None:
self.origin.export(outfile, level, namespace_, name_='origin', pretty_print=pretty_print)
if self.spacing is not None:
self.spacing.export(outfile, level, namespace_, name_='spacing', pretty_print=pretty_print)
if self.cell is not None:
self.cell.export(outfile, level, namespace_, name_='cell', pretty_print=pretty_print)
if self.axis_order is not None:
self.axis_order.export(outfile, level, namespace_, name_='axis_order', pretty_print=pretty_print)
if self.statistics is not None:
self.statistics.export(outfile, level, namespace_, name_='statistics', pretty_print=pretty_print)
if self.pixel_spacing is not None:
self.pixel_spacing.export(outfile, level, namespace_, name_='pixel_spacing', pretty_print=pretty_print)
if self.contour_list is not None:
self.contour_list.export(outfile, level, namespace_, name_='contour_list', pretty_print=pretty_print)
if self.label is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slabel>%s</%slabel>%s' % (namespace_, self.gds_format_string(quote_xml(self.label).encode(ExternalEncoding), input_name='label'), namespace_, eol_))
if self.annotation_details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sannotation_details>%s</%sannotation_details>%s' % (namespace_, self.gds_format_string(quote_xml(self.annotation_details).encode(ExternalEncoding), input_name='annotation_details'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('size_kbytes', node)
if value is not None and 'size_kbytes' not in already_processed:
already_processed.add('size_kbytes')
try:
self.size_kbytes = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.size_kbytes <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('format', node)
if value is not None and 'format' not in already_processed:
already_processed.add('format')
self.format = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'file':
file_ = child_.text
file_ = re_.sub(String_cleanup_pat_, " ", file_).strip()
file_ = self.gds_validate_string(file_, node, 'file')
self.file = file_
# validate type fileType32
self.validate_fileType32(self.file)
elif nodeName_ == 'symmetry':
obj_ = applied_symmetry_type.factory()
obj_.build(child_)
self.symmetry = obj_
obj_.original_tagname_ = 'symmetry'
elif nodeName_ == 'data_type':
data_type_ = child_.text
data_type_ = self.gds_validate_string(data_type_, node, 'data_type')
self.data_type = data_type_
# validate type map_data_type
self.validate_map_data_type(self.data_type)
elif nodeName_ == 'dimensions':
obj_ = integer_vector_map_type.factory()
obj_.build(child_)
self.dimensions = obj_
obj_.original_tagname_ = 'dimensions'
elif nodeName_ == 'origin':
obj_ = originType.factory()
obj_.build(child_)
self.origin = obj_
obj_.original_tagname_ = 'origin'
elif nodeName_ == 'spacing':
obj_ = spacingType.factory()
obj_.build(child_)
self.spacing = obj_
obj_.original_tagname_ = 'spacing'
elif nodeName_ == 'cell':
obj_ = cellType.factory()
obj_.build(child_)
self.cell = obj_
obj_.original_tagname_ = 'cell'
elif nodeName_ == 'axis_order':
obj_ = axis_orderType.factory()
obj_.build(child_)
self.axis_order = obj_
obj_.original_tagname_ = 'axis_order'
elif nodeName_ == 'statistics':
obj_ = map_statistics_type.factory()
obj_.build(child_)
self.statistics = obj_
obj_.original_tagname_ = 'statistics'
elif nodeName_ == 'pixel_spacing':
obj_ = pixel_spacingType.factory()
obj_.build(child_)
self.pixel_spacing = obj_
obj_.original_tagname_ = 'pixel_spacing'
elif nodeName_ == 'contour_list':
obj_ = contour_listType.factory()
obj_.build(child_)
self.contour_list = obj_
obj_.original_tagname_ = 'contour_list'
elif nodeName_ == 'label':
label_ = child_.text
label_ = re_.sub(String_cleanup_pat_, " ", label_).strip()
label_ = self.gds_validate_string(label_, node, 'label')
self.label = label_
elif nodeName_ == 'annotation_details':
annotation_details_ = child_.text
annotation_details_ = self.gds_validate_string(annotation_details_, node, 'annotation_details')
self.annotation_details = annotation_details_
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class map_type
[docs]class validation_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('fsc_curve', 'fsc_curve', 0),
MemberSpec_('crystallography_validation', 'crystallography_validation', 0),
]
subclass = None
superclass = None
def __init__(self, fsc_curve=None, crystallography_validation=None):
self.original_tagname_ = None
self.fsc_curve = fsc_curve
self.crystallography_validation = crystallography_validation
[docs] def factory(*args_, **kwargs_):
if validation_type.subclass:
return validation_type.subclass(*args_, **kwargs_)
else:
return validation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_fsc_curve(self): return self.fsc_curve
[docs] def set_fsc_curve(self, fsc_curve): self.fsc_curve = fsc_curve
[docs] def get_crystallography_validation(self): return self.crystallography_validation
[docs] def set_crystallography_validation(self, crystallography_validation): self.crystallography_validation = crystallography_validation
[docs] def hasContent_(self):
if (
self.fsc_curve is not None or
self.crystallography_validation is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='validation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='validation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='validation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='validation_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='validation_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.fsc_curve is not None:
self.fsc_curve.export(outfile, level, namespace_, name_='fsc_curve', pretty_print=pretty_print)
if self.crystallography_validation is not None:
self.crystallography_validation.export(outfile, level, namespace_, name_='crystallography_validation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'fsc_curve':
obj_ = fsc_curve.factory()
obj_.build(child_)
self.fsc_curve = obj_
obj_.original_tagname_ = 'fsc_curve'
elif nodeName_ == 'crystallography_validation':
obj_ = crystallography_validation.factory()
obj_.build(child_)
self.crystallography_validation = obj_
obj_.original_tagname_ = 'crystallography_validation'
# end class validation_type
[docs]class fsc_curve(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('file', ['fileType33', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, file=None, details=None):
self.original_tagname_ = None
self.file = file
self.validate_fileType33(self.file)
self.details = details
[docs] def factory(*args_, **kwargs_):
if fsc_curve.subclass:
return fsc_curve.subclass(*args_, **kwargs_)
else:
return fsc_curve(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_file(self): return self.file
[docs] def set_file(self, file): self.file = file
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_fileType33(self, value):
# Validate type fileType33, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fileType33_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fileType33_patterns_, ))
validate_fileType33_patterns_ = [['^emd_\\d{4,}_fsc.xml$']]
[docs] def hasContent_(self):
if (
self.file is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fsc_curve', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fsc_curve')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='fsc_curve', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fsc_curve'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fsc_curve', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.file is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfile>%s</%sfile>%s' % (namespace_, self.gds_format_string(quote_xml(self.file).encode(ExternalEncoding), input_name='file'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'file':
file_ = child_.text
file_ = re_.sub(String_cleanup_pat_, " ", file_).strip()
file_ = self.gds_validate_string(file_, node, 'file')
self.file = file_
# validate type fileType33
self.validate_fileType33(self.file)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class fsc_curve
[docs]class layer_lines(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('file', ['fileType34', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, file=None):
self.original_tagname_ = None
self.file = file
self.validate_fileType34(self.file)
[docs] def factory(*args_, **kwargs_):
if layer_lines.subclass:
return layer_lines.subclass(*args_, **kwargs_)
else:
return layer_lines(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_file(self): return self.file
[docs] def set_file(self, file): self.file = file
[docs] def validate_fileType34(self, value):
# Validate type fileType34, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fileType34_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fileType34_patterns_, ))
validate_fileType34_patterns_ = [['^emd_\\d{4,}_fsc.xml$']]
[docs] def hasContent_(self):
if (
self.file is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='layer_lines', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='layer_lines')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='layer_lines', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='layer_lines'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='layer_lines', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.file is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfile>%s</%sfile>%s' % (namespace_, self.gds_format_string(quote_xml(self.file).encode(ExternalEncoding), input_name='file'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'file':
file_ = child_.text
file_ = re_.sub(String_cleanup_pat_, " ", file_).strip()
file_ = self.gds_validate_string(file_, node, 'file')
self.file = file_
# validate type fileType34
self.validate_fileType34(self.file)
# end class layer_lines
[docs]class structure_factors(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('file', ['fileType35', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, file=None):
self.original_tagname_ = None
self.file = file
self.validate_fileType35(self.file)
[docs] def factory(*args_, **kwargs_):
if structure_factors.subclass:
return structure_factors.subclass(*args_, **kwargs_)
else:
return structure_factors(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_file(self): return self.file
[docs] def set_file(self, file): self.file = file
[docs] def validate_fileType35(self, value):
# Validate type fileType35, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fileType35_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fileType35_patterns_, ))
validate_fileType35_patterns_ = [['^emd_\\d{4,}_fsc.xml$']]
[docs] def hasContent_(self):
if (
self.file is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='structure_factors', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='structure_factors')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='structure_factors', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='structure_factors'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='structure_factors', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.file is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfile>%s</%sfile>%s' % (namespace_, self.gds_format_string(quote_xml(self.file).encode(ExternalEncoding), input_name='file'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'file':
file_ = child_.text
file_ = re_.sub(String_cleanup_pat_, " ", file_).strip()
file_ = self.gds_validate_string(file_, node, 'file')
self.file = file_
# validate type fileType35
self.validate_fileType35(self.file)
# end class structure_factors
[docs]class crystallography_validation(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('parallel_resolution', 'xs:string', 0),
MemberSpec_('perpendicular_resolution', 'xs:string', 0),
MemberSpec_('number_observed_reflections', 'xs:string', 0),
MemberSpec_('number_unique_reflections', 'xs:string', 0),
MemberSpec_('weighted_phase_residual', 'xs:string', 0),
MemberSpec_('weighted_r_factor', 'xs:string', 0),
MemberSpec_('data_completeness', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, parallel_resolution=None, perpendicular_resolution=None, number_observed_reflections=None, number_unique_reflections=None, weighted_phase_residual=None, weighted_r_factor=None, data_completeness=None):
self.original_tagname_ = None
self.parallel_resolution = parallel_resolution
self.perpendicular_resolution = perpendicular_resolution
self.number_observed_reflections = number_observed_reflections
self.number_unique_reflections = number_unique_reflections
self.weighted_phase_residual = weighted_phase_residual
self.weighted_r_factor = weighted_r_factor
self.data_completeness = data_completeness
[docs] def factory(*args_, **kwargs_):
if crystallography_validation.subclass:
return crystallography_validation.subclass(*args_, **kwargs_)
else:
return crystallography_validation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_parallel_resolution(self): return self.parallel_resolution
[docs] def set_parallel_resolution(self, parallel_resolution): self.parallel_resolution = parallel_resolution
[docs] def get_perpendicular_resolution(self): return self.perpendicular_resolution
[docs] def set_perpendicular_resolution(self, perpendicular_resolution): self.perpendicular_resolution = perpendicular_resolution
[docs] def get_number_observed_reflections(self): return self.number_observed_reflections
[docs] def set_number_observed_reflections(self, number_observed_reflections): self.number_observed_reflections = number_observed_reflections
[docs] def get_number_unique_reflections(self): return self.number_unique_reflections
[docs] def set_number_unique_reflections(self, number_unique_reflections): self.number_unique_reflections = number_unique_reflections
[docs] def get_weighted_phase_residual(self): return self.weighted_phase_residual
[docs] def set_weighted_phase_residual(self, weighted_phase_residual): self.weighted_phase_residual = weighted_phase_residual
[docs] def get_weighted_r_factor(self): return self.weighted_r_factor
[docs] def set_weighted_r_factor(self, weighted_r_factor): self.weighted_r_factor = weighted_r_factor
[docs] def get_data_completeness(self): return self.data_completeness
[docs] def set_data_completeness(self, data_completeness): self.data_completeness = data_completeness
[docs] def hasContent_(self):
if (
self.parallel_resolution is not None or
self.perpendicular_resolution is not None or
self.number_observed_reflections is not None or
self.number_unique_reflections is not None or
self.weighted_phase_residual is not None or
self.weighted_r_factor is not None or
self.data_completeness is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_validation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_validation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_validation', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_validation'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_validation', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.parallel_resolution is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sparallel_resolution>%s</%sparallel_resolution>%s' % (namespace_, self.gds_format_string(quote_xml(self.parallel_resolution).encode(ExternalEncoding), input_name='parallel_resolution'), namespace_, eol_))
if self.perpendicular_resolution is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sperpendicular_resolution>%s</%sperpendicular_resolution>%s' % (namespace_, self.gds_format_string(quote_xml(self.perpendicular_resolution).encode(ExternalEncoding), input_name='perpendicular_resolution'), namespace_, eol_))
if self.number_observed_reflections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_observed_reflections>%s</%snumber_observed_reflections>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_observed_reflections).encode(ExternalEncoding), input_name='number_observed_reflections'), namespace_, eol_))
if self.number_unique_reflections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_unique_reflections>%s</%snumber_unique_reflections>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_unique_reflections).encode(ExternalEncoding), input_name='number_unique_reflections'), namespace_, eol_))
if self.weighted_phase_residual is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sweighted_phase_residual>%s</%sweighted_phase_residual>%s' % (namespace_, self.gds_format_string(quote_xml(self.weighted_phase_residual).encode(ExternalEncoding), input_name='weighted_phase_residual'), namespace_, eol_))
if self.weighted_r_factor is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sweighted_r_factor>%s</%sweighted_r_factor>%s' % (namespace_, self.gds_format_string(quote_xml(self.weighted_r_factor).encode(ExternalEncoding), input_name='weighted_r_factor'), namespace_, eol_))
if self.data_completeness is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdata_completeness>%s</%sdata_completeness>%s' % (namespace_, self.gds_format_string(quote_xml(self.data_completeness).encode(ExternalEncoding), input_name='data_completeness'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'parallel_resolution':
parallel_resolution_ = child_.text
parallel_resolution_ = self.gds_validate_string(parallel_resolution_, node, 'parallel_resolution')
self.parallel_resolution = parallel_resolution_
elif nodeName_ == 'perpendicular_resolution':
perpendicular_resolution_ = child_.text
perpendicular_resolution_ = self.gds_validate_string(perpendicular_resolution_, node, 'perpendicular_resolution')
self.perpendicular_resolution = perpendicular_resolution_
elif nodeName_ == 'number_observed_reflections':
number_observed_reflections_ = child_.text
number_observed_reflections_ = self.gds_validate_string(number_observed_reflections_, node, 'number_observed_reflections')
self.number_observed_reflections = number_observed_reflections_
elif nodeName_ == 'number_unique_reflections':
number_unique_reflections_ = child_.text
number_unique_reflections_ = self.gds_validate_string(number_unique_reflections_, node, 'number_unique_reflections')
self.number_unique_reflections = number_unique_reflections_
elif nodeName_ == 'weighted_phase_residual':
weighted_phase_residual_ = child_.text
weighted_phase_residual_ = self.gds_validate_string(weighted_phase_residual_, node, 'weighted_phase_residual')
self.weighted_phase_residual = weighted_phase_residual_
elif nodeName_ == 'weighted_r_factor':
weighted_r_factor_ = child_.text
weighted_r_factor_ = self.gds_validate_string(weighted_r_factor_, node, 'weighted_r_factor')
self.weighted_r_factor = weighted_r_factor_
elif nodeName_ == 'data_completeness':
data_completeness_ = child_.text
data_completeness_ = self.gds_validate_string(data_completeness_, node, 'data_completeness')
self.data_completeness = data_completeness_
# end class crystallography_validation
[docs]class parallel_resolution(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if parallel_resolution.subclass:
return parallel_resolution.subclass(*args_, **kwargs_)
else:
return parallel_resolution(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='parallel_resolution', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='parallel_resolution')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='parallel_resolution', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='parallel_resolution'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='parallel_resolution', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class parallel_resolution
[docs]class perpendicular_resolution(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if perpendicular_resolution.subclass:
return perpendicular_resolution.subclass(*args_, **kwargs_)
else:
return perpendicular_resolution(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='perpendicular_resolution', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='perpendicular_resolution')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='perpendicular_resolution', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='perpendicular_resolution'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='perpendicular_resolution', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class perpendicular_resolution
[docs]class number_observed_reflections(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if number_observed_reflections.subclass:
return number_observed_reflections.subclass(*args_, **kwargs_)
else:
return number_observed_reflections(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='number_observed_reflections', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='number_observed_reflections')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='number_observed_reflections', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='number_observed_reflections'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='number_observed_reflections', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class number_observed_reflections
[docs]class number_unique_reflections(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if number_unique_reflections.subclass:
return number_unique_reflections.subclass(*args_, **kwargs_)
else:
return number_unique_reflections(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='number_unique_reflections', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='number_unique_reflections')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='number_unique_reflections', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='number_unique_reflections'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='number_unique_reflections', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class number_unique_reflections
[docs]class weighted_phase_residual(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if weighted_phase_residual.subclass:
return weighted_phase_residual.subclass(*args_, **kwargs_)
else:
return weighted_phase_residual(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='weighted_phase_residual', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='weighted_phase_residual')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='weighted_phase_residual', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='weighted_phase_residual'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='weighted_phase_residual', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class weighted_phase_residual
[docs]class weighted_r_factor(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if weighted_r_factor.subclass:
return weighted_r_factor.subclass(*args_, **kwargs_)
else:
return weighted_r_factor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='weighted_r_factor', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='weighted_r_factor')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='weighted_r_factor', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='weighted_r_factor'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='weighted_r_factor', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class weighted_r_factor
[docs]class data_completeness(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if data_completeness.subclass:
return data_completeness.subclass(*args_, **kwargs_)
else:
return data_completeness(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='data_completeness', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='data_completeness')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='data_completeness', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='data_completeness'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='data_completeness', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class data_completeness
[docs]class grant_reference_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('funding_body', 'xs:token', 0),
MemberSpec_('code', 'xs:token', 0),
MemberSpec_('country', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, funding_body=None, code=None, country=None):
self.original_tagname_ = None
self.funding_body = funding_body
self.code = code
self.country = country
[docs] def factory(*args_, **kwargs_):
if grant_reference_type.subclass:
return grant_reference_type.subclass(*args_, **kwargs_)
else:
return grant_reference_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_funding_body(self): return self.funding_body
[docs] def set_funding_body(self, funding_body): self.funding_body = funding_body
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_country(self): return self.country
[docs] def set_country(self, country): self.country = country
[docs] def hasContent_(self):
if (
self.funding_body is not None or
self.code is not None or
self.country is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='grant_reference_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='grant_reference_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='grant_reference_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='grant_reference_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='grant_reference_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.funding_body is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfunding_body>%s</%sfunding_body>%s' % (namespace_, self.gds_format_string(quote_xml(self.funding_body).encode(ExternalEncoding), input_name='funding_body'), namespace_, eol_))
if self.code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scode>%s</%scode>%s' % (namespace_, self.gds_format_string(quote_xml(self.code).encode(ExternalEncoding), input_name='code'), namespace_, eol_))
if self.country is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scountry>%s</%scountry>%s' % (namespace_, self.gds_format_string(quote_xml(self.country).encode(ExternalEncoding), input_name='country'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'funding_body':
funding_body_ = child_.text
funding_body_ = re_.sub(String_cleanup_pat_, " ", funding_body_).strip()
funding_body_ = self.gds_validate_string(funding_body_, node, 'funding_body')
self.funding_body = funding_body_
elif nodeName_ == 'code':
code_ = child_.text
code_ = re_.sub(String_cleanup_pat_, " ", code_).strip()
code_ = self.gds_validate_string(code_, node, 'code')
self.code = code_
elif nodeName_ == 'country':
country_ = child_.text
country_ = re_.sub(String_cleanup_pat_, " ", country_).strip()
country_ = self.gds_validate_string(country_, node, 'country')
self.country = country_
# end class grant_reference_type
[docs]class chain_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', ['chain_pdb_id', 'xs:token'], 0),
MemberSpec_('residue_range', ['residue_rangeType', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, id=None, residue_range=None, extensiontype_=None):
self.original_tagname_ = None
self.id = id
self.validate_chain_pdb_id(self.id)
if residue_range is None:
self.residue_range = []
else:
self.residue_range = residue_range
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if chain_type.subclass:
return chain_type.subclass(*args_, **kwargs_)
else:
return chain_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_residue_range(self): return self.residue_range
[docs] def set_residue_range(self, residue_range): self.residue_range = residue_range
[docs] def add_residue_range(self, value): self.residue_range.append(value)
[docs] def insert_residue_range_at(self, index, value): self.residue_range.insert(index, value)
[docs] def replace_residue_range_at(self, index, value): self.residue_range[index] = value
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_chain_pdb_id(self, value):
# Validate type chain_pdb_id, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_chain_pdb_id_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_chain_pdb_id_patterns_, ))
validate_chain_pdb_id_patterns_ = [['^\\d|[A-Za-z]$']]
[docs] def validate_residue_rangeType(self, value):
# Validate type residue_rangeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_residue_rangeType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_residue_rangeType_patterns_, ))
validate_residue_rangeType_patterns_ = [['^\\d+-\\d+$']]
[docs] def hasContent_(self):
if (
self.id is not None or
self.residue_range
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chain_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chain_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='chain_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chain_type'):
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chain_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sid>%s</%sid>%s' % (namespace_, self.gds_format_string(quote_xml(self.id).encode(ExternalEncoding), input_name='id'), namespace_, eol_))
for residue_range_ in self.residue_range:
showIndent(outfile, level, pretty_print)
outfile.write('<%sresidue_range>%s</%sresidue_range>%s' % (namespace_, self.gds_format_string(quote_xml(residue_range_).encode(ExternalEncoding), input_name='residue_range'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'id':
id_ = child_.text
id_ = re_.sub(String_cleanup_pat_, " ", id_).strip()
id_ = self.gds_validate_string(id_, node, 'id')
self.id = id_
# validate type chain_pdb_id
self.validate_chain_pdb_id(self.id)
elif nodeName_ == 'residue_range':
residue_range_ = child_.text
residue_range_ = re_.sub(String_cleanup_pat_, " ", residue_range_).strip()
residue_range_ = self.gds_validate_string(residue_range_, node, 'residue_range')
self.residue_range.append(residue_range_)
# validate type residue_rangeType
self.validate_residue_rangeType(self.residue_range[-1])
# end class chain_type
[docs]class pdb_model_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('pdb_id', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain_id_list', 'chain_id_list', 0),
]
subclass = None
superclass = None
def __init__(self, pdb_id=None, chain_id_list=None):
self.original_tagname_ = None
self.pdb_id = pdb_id
self.validate_pdb_code_type(self.pdb_id)
self.chain_id_list = chain_id_list
[docs] def factory(*args_, **kwargs_):
if pdb_model_type.subclass:
return pdb_model_type.subclass(*args_, **kwargs_)
else:
return pdb_model_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_pdb_id(self): return self.pdb_id
[docs] def set_pdb_id(self, pdb_id): self.pdb_id = pdb_id
[docs] def get_chain_id_list(self): return self.chain_id_list
[docs] def set_chain_id_list(self, chain_id_list): self.chain_id_list = chain_id_list
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.pdb_id is not None or
self.chain_id_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pdb_model_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pdb_model_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='pdb_model_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pdb_model_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pdb_model_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.pdb_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%spdb_id>%s</%spdb_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.pdb_id).encode(ExternalEncoding), input_name='pdb_id'), namespace_, eol_))
if self.chain_id_list is not None:
self.chain_id_list.export(outfile, level, namespace_, name_='chain_id_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'pdb_id':
pdb_id_ = child_.text
pdb_id_ = re_.sub(String_cleanup_pat_, " ", pdb_id_).strip()
pdb_id_ = self.gds_validate_string(pdb_id_, node, 'pdb_id')
self.pdb_id = pdb_id_
# validate type pdb_code_type
self.validate_pdb_code_type(self.pdb_id)
elif nodeName_ == 'chain_id_list':
class_obj_ = self.get_class_obj_(child_, chain_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.chain_id_list = obj_
obj_.original_tagname_ = 'chain_id_list'
# end class pdb_model_type
[docs]class macromolecules_and_complexes_type(GeneratedsSuper):
"""Depending on the problem, one can either reference the sample on the
macromolecule level or the complex level."""
member_data_items_ = [
MemberSpec_('macromolecule_id', 'xs:positiveInteger', 1),
MemberSpec_('complex_id', 'xs:nonNegativeInteger', 1),
]
subclass = None
superclass = None
def __init__(self, macromolecule_id=None, complex_id=None):
self.original_tagname_ = None
if macromolecule_id is None:
self.macromolecule_id = []
else:
self.macromolecule_id = macromolecule_id
if complex_id is None:
self.complex_id = []
else:
self.complex_id = complex_id
[docs] def factory(*args_, **kwargs_):
if macromolecules_and_complexes_type.subclass:
return macromolecules_and_complexes_type.subclass(*args_, **kwargs_)
else:
return macromolecules_and_complexes_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_macromolecule_id(self): return self.macromolecule_id
[docs] def set_macromolecule_id(self, macromolecule_id): self.macromolecule_id = macromolecule_id
[docs] def add_macromolecule_id(self, value): self.macromolecule_id.append(value)
[docs] def insert_macromolecule_id_at(self, index, value): self.macromolecule_id.insert(index, value)
[docs] def replace_macromolecule_id_at(self, index, value): self.macromolecule_id[index] = value
[docs] def get_complex_id(self): return self.complex_id
[docs] def set_complex_id(self, complex_id): self.complex_id = complex_id
[docs] def add_complex_id(self, value): self.complex_id.append(value)
[docs] def insert_complex_id_at(self, index, value): self.complex_id.insert(index, value)
[docs] def replace_complex_id_at(self, index, value): self.complex_id[index] = value
[docs] def hasContent_(self):
if (
self.macromolecule_id or
self.complex_id
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='macromolecules_and_complexes_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='macromolecules_and_complexes_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='macromolecules_and_complexes_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='macromolecules_and_complexes_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='macromolecules_and_complexes_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for macromolecule_id_ in self.macromolecule_id:
showIndent(outfile, level, pretty_print)
outfile.write('<%smacromolecule_id>%s</%smacromolecule_id>%s' % (namespace_, self.gds_format_integer(macromolecule_id_, input_name='macromolecule_id'), namespace_, eol_))
for complex_id_ in self.complex_id:
showIndent(outfile, level, pretty_print)
outfile.write('<%scomplex_id>%s</%scomplex_id>%s' % (namespace_, self.gds_format_integer(complex_id_, input_name='complex_id'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'macromolecule_id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'macromolecule_id')
self.macromolecule_id.append(ival_)
elif nodeName_ == 'complex_id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ < 0:
raise_parse_error(child_, 'requires nonNegativeInteger')
ival_ = self.gds_validate_integer(ival_, node, 'complex_id')
self.complex_id.append(ival_)
# end class macromolecules_and_complexes_type
[docs]class base_supramolecule_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('name', 'sci_name_type', 0),
MemberSpec_('category', 'categoryType', 0),
MemberSpec_('parent', 'xs:nonNegativeInteger', 0),
MemberSpec_('macromolecule_list', 'macromolecule_listType', 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('number_of_copies', 'pos_int_or_string_type', 0),
MemberSpec_('oligomeric_state', 'pos_int_or_string_type', 0),
MemberSpec_('external_references', 'external_referencesType', 1),
MemberSpec_('recombinant_exp_flag', 'xs:boolean', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, extensiontype_=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.name = name
self.category = category
self.parent = parent
self.macromolecule_list = macromolecule_list
self.details = details
self.number_of_copies = number_of_copies
self.validate_pos_int_or_string_type(self.number_of_copies)
self.oligomeric_state = oligomeric_state
self.validate_pos_int_or_string_type(self.oligomeric_state)
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
self.recombinant_exp_flag = recombinant_exp_flag
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_supramolecule_type.subclass:
return base_supramolecule_type.subclass(*args_, **kwargs_)
else:
return base_supramolecule_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_category(self): return self.category
[docs] def set_category(self, category): self.category = category
[docs] def get_parent(self): return self.parent
[docs] def set_parent(self, parent): self.parent = parent
[docs] def get_macromolecule_list(self): return self.macromolecule_list
[docs] def set_macromolecule_list(self, macromolecule_list): self.macromolecule_list = macromolecule_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_number_of_copies(self): return self.number_of_copies
[docs] def set_number_of_copies(self, number_of_copies): self.number_of_copies = number_of_copies
[docs] def get_oligomeric_state(self): return self.oligomeric_state
[docs] def set_oligomeric_state(self, oligomeric_state): self.oligomeric_state = oligomeric_state
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def get_recombinant_exp_flag(self): return self.recombinant_exp_flag
[docs] def set_recombinant_exp_flag(self, recombinant_exp_flag): self.recombinant_exp_flag = recombinant_exp_flag
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_pos_int_or_string_type(self, value):
# Validate type pos_int_or_string_type, a restriction on None.
pass
[docs] def hasContent_(self):
if (
self.name is not None or
self.category is not None or
self.parent is not None or
self.macromolecule_list is not None or
self.details is not None or
self.number_of_copies is not None or
self.oligomeric_state is not None or
self.external_references or
self.recombinant_exp_flag is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_supramolecule_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_supramolecule_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_supramolecule_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_supramolecule_type'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_supramolecule_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
if self.category is not None:
self.category.export(outfile, level, namespace_, name_='category', pretty_print=pretty_print)
if self.parent is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sparent>%s</%sparent>%s' % (namespace_, self.gds_format_integer(self.parent, input_name='parent'), namespace_, eol_))
if self.macromolecule_list is not None:
self.macromolecule_list.export(outfile, level, namespace_, name_='macromolecule_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.number_of_copies is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_of_copies>%s</%snumber_of_copies>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_of_copies).encode(ExternalEncoding), input_name='number_of_copies'), namespace_, eol_))
if self.oligomeric_state is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soligomeric_state>%s</%soligomeric_state>%s' % (namespace_, self.gds_format_string(quote_xml(self.oligomeric_state).encode(ExternalEncoding), input_name='oligomeric_state'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
if self.recombinant_exp_flag is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srecombinant_exp_flag>%s</%srecombinant_exp_flag>%s' % (namespace_, self.gds_format_boolean(self.recombinant_exp_flag, input_name='recombinant_exp_flag'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
obj_ = sci_name_type.factory()
obj_.build(child_)
self.name = obj_
obj_.original_tagname_ = 'name'
elif nodeName_ == 'category':
obj_ = categoryType.factory()
obj_.build(child_)
self.category = obj_
obj_.original_tagname_ = 'category'
elif nodeName_ == 'parent':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ < 0:
raise_parse_error(child_, 'requires nonNegativeInteger')
ival_ = self.gds_validate_integer(ival_, node, 'parent')
self.parent = ival_
elif nodeName_ == 'macromolecule_list':
obj_ = macromolecule_listType.factory()
obj_.build(child_)
self.macromolecule_list = obj_
obj_.original_tagname_ = 'macromolecule_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'number_of_copies':
number_of_copies_ = child_.text
number_of_copies_ = self.gds_validate_string(number_of_copies_, node, 'number_of_copies')
self.number_of_copies = number_of_copies_
# validate type pos_int_or_string_type
self.validate_pos_int_or_string_type(self.number_of_copies)
elif nodeName_ == 'oligomeric_state':
oligomeric_state_ = child_.text
oligomeric_state_ = self.gds_validate_string(oligomeric_state_, node, 'oligomeric_state')
self.oligomeric_state = oligomeric_state_
# validate type pos_int_or_string_type
self.validate_pos_int_or_string_type(self.oligomeric_state)
elif nodeName_ == 'external_references':
obj_ = external_referencesType.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
elif nodeName_ == 'recombinant_exp_flag':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'recombinant_exp_flag')
self.recombinant_exp_flag = ival_
# end class base_supramolecule_type
[docs]class complex_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('chimera', 'xs:boolean', 0),
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('category', 'categoryType39', 0),
MemberSpec_('parent', 'xs:nonNegativeInteger', 0),
MemberSpec_('macromolecule_list', 'macromolecule_listType40', 0),
MemberSpec_('natural_source', 'natural_source_type', 1),
MemberSpec_('recombinant_expression', 'recombinant_source_type', 1),
MemberSpec_('molecular_weight', 'molecular_weightType', 0),
MemberSpec_('virus_shell', 'virus_shellType41', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, chimera=None, id=None, name=None, category=None, parent=None, macromolecule_list=None, natural_source=None, recombinant_expression=None, molecular_weight=None, virus_shell=None, details=None):
self.original_tagname_ = None
self.chimera = _cast(bool, chimera)
self.id = _cast(int, id)
self.name = name
self.category = category
self.parent = parent
self.macromolecule_list = macromolecule_list
if natural_source is None:
self.natural_source = []
else:
self.natural_source = natural_source
if recombinant_expression is None:
self.recombinant_expression = []
else:
self.recombinant_expression = recombinant_expression
self.molecular_weight = molecular_weight
self.virus_shell = virus_shell
self.details = details
[docs] def factory(*args_, **kwargs_):
if complex_type.subclass:
return complex_type.subclass(*args_, **kwargs_)
else:
return complex_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_category(self): return self.category
[docs] def set_category(self, category): self.category = category
[docs] def get_parent(self): return self.parent
[docs] def set_parent(self, parent): self.parent = parent
[docs] def get_macromolecule_list(self): return self.macromolecule_list
[docs] def set_macromolecule_list(self, macromolecule_list): self.macromolecule_list = macromolecule_list
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def add_natural_source(self, value): self.natural_source.append(value)
[docs] def insert_natural_source_at(self, index, value): self.natural_source.insert(index, value)
[docs] def replace_natural_source_at(self, index, value): self.natural_source[index] = value
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
[docs] def add_recombinant_expression(self, value): self.recombinant_expression.append(value)
[docs] def insert_recombinant_expression_at(self, index, value): self.recombinant_expression.insert(index, value)
[docs] def replace_recombinant_expression_at(self, index, value): self.recombinant_expression[index] = value
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def get_virus_shell(self): return self.virus_shell
[docs] def set_virus_shell(self, virus_shell): self.virus_shell = virus_shell
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_chimera(self): return self.chimera
[docs] def set_chimera(self, chimera): self.chimera = chimera
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def hasContent_(self):
if (
self.name is not None or
self.category is not None or
self.parent is not None or
self.macromolecule_list is not None or
self.natural_source or
self.recombinant_expression or
self.molecular_weight is not None or
self.virus_shell is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='complex_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='complex_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='complex_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='complex_type'):
if self.chimera is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
outfile.write(' chimera="%s"' % self.gds_format_boolean(self.chimera, input_name='chimera'))
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='complex_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.category is not None:
self.category.export(outfile, level, namespace_, name_='category', pretty_print=pretty_print)
if self.parent is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sparent>%s</%sparent>%s' % (namespace_, self.gds_format_integer(self.parent, input_name='parent'), namespace_, eol_))
if self.macromolecule_list is not None:
self.macromolecule_list.export(outfile, level, namespace_, name_='macromolecule_list', pretty_print=pretty_print)
for natural_source_ in self.natural_source:
natural_source_.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
for recombinant_expression_ in self.recombinant_expression:
recombinant_expression_.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
if self.virus_shell is not None:
self.virus_shell.export(outfile, level, namespace_, name_='virus_shell', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('chimera', node)
if value is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
if value in ('true', '1'):
self.chimera = True
elif value in ('false', '0'):
self.chimera = False
else:
raise_parse_error(node, 'Bad boolean attribute')
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'category':
obj_ = categoryType39.factory()
obj_.build(child_)
self.category = obj_
obj_.original_tagname_ = 'category'
elif nodeName_ == 'parent':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ < 0:
raise_parse_error(child_, 'requires nonNegativeInteger')
ival_ = self.gds_validate_integer(ival_, node, 'parent')
self.parent = ival_
elif nodeName_ == 'macromolecule_list':
obj_ = macromolecule_listType40.factory()
obj_.build(child_)
self.macromolecule_list = obj_
obj_.original_tagname_ = 'macromolecule_list'
elif nodeName_ == 'natural_source':
obj_ = natural_source_type.factory()
obj_.build(child_)
self.natural_source.append(obj_)
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression.append(obj_)
obj_.original_tagname_ = 'recombinant_expression'
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weightType.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
elif nodeName_ == 'virus_shell':
obj_ = virus_shellType41.factory()
obj_.build(child_)
self.virus_shell = obj_
obj_.original_tagname_ = 'virus_shell'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class complex_type
[docs]class interpretation_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('modelling_list', 'modelling_listType', 0),
MemberSpec_('figure_list', 'figure_listType', 0),
MemberSpec_('segmentation_list', 'segmentation_listType', 0),
MemberSpec_('slices_list', 'slices_listType', 0),
MemberSpec_('additional_map_list', 'additional_map_listType', 0),
MemberSpec_('half_map_list', 'half_map_listType', 0),
]
subclass = None
superclass = None
def __init__(self, modelling_list=None, figure_list=None, segmentation_list=None, slices_list=None, additional_map_list=None, half_map_list=None):
self.original_tagname_ = None
self.modelling_list = modelling_list
self.figure_list = figure_list
self.segmentation_list = segmentation_list
self.slices_list = slices_list
self.additional_map_list = additional_map_list
self.half_map_list = half_map_list
[docs] def factory(*args_, **kwargs_):
if interpretation_type.subclass:
return interpretation_type.subclass(*args_, **kwargs_)
else:
return interpretation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_modelling_list(self): return self.modelling_list
[docs] def set_modelling_list(self, modelling_list): self.modelling_list = modelling_list
[docs] def get_segmentation_list(self): return self.segmentation_list
[docs] def set_segmentation_list(self, segmentation_list): self.segmentation_list = segmentation_list
[docs] def get_slices_list(self): return self.slices_list
[docs] def set_slices_list(self, slices_list): self.slices_list = slices_list
[docs] def get_additional_map_list(self): return self.additional_map_list
[docs] def set_additional_map_list(self, additional_map_list): self.additional_map_list = additional_map_list
[docs] def get_half_map_list(self): return self.half_map_list
[docs] def set_half_map_list(self, half_map_list): self.half_map_list = half_map_list
[docs] def hasContent_(self):
if (
self.modelling_list is not None or
self.figure_list is not None or
self.segmentation_list is not None or
self.slices_list is not None or
self.additional_map_list is not None or
self.half_map_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='interpretation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='interpretation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='interpretation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='interpretation_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='interpretation_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.modelling_list is not None:
self.modelling_list.export(outfile, level, namespace_, name_='modelling_list', pretty_print=pretty_print)
if self.figure_list is not None:
self.figure_list.export(outfile, level, namespace_, name_='figure_list', pretty_print=pretty_print)
if self.segmentation_list is not None:
self.segmentation_list.export(outfile, level, namespace_, name_='segmentation_list', pretty_print=pretty_print)
if self.slices_list is not None:
self.slices_list.export(outfile, level, namespace_, name_='slices_list', pretty_print=pretty_print)
if self.additional_map_list is not None:
self.additional_map_list.export(outfile, level, namespace_, name_='additional_map_list', pretty_print=pretty_print)
if self.half_map_list is not None:
self.half_map_list.export(outfile, level, namespace_, name_='half_map_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'modelling_list':
obj_ = modelling_listType.factory()
obj_.build(child_)
self.modelling_list = obj_
obj_.original_tagname_ = 'modelling_list'
elif nodeName_ == 'figure_list':
obj_ = figure_listType.factory()
obj_.build(child_)
self.figure_list = obj_
obj_.original_tagname_ = 'figure_list'
elif nodeName_ == 'segmentation_list':
obj_ = segmentation_listType.factory()
obj_.build(child_)
self.segmentation_list = obj_
obj_.original_tagname_ = 'segmentation_list'
elif nodeName_ == 'slices_list':
obj_ = slices_listType.factory()
obj_.build(child_)
self.slices_list = obj_
obj_.original_tagname_ = 'slices_list'
elif nodeName_ == 'additional_map_list':
obj_ = additional_map_listType.factory()
obj_.build(child_)
self.additional_map_list = obj_
obj_.original_tagname_ = 'additional_map_list'
elif nodeName_ == 'half_map_list':
obj_ = half_map_listType.factory()
obj_.build(child_)
self.half_map_list = obj_
obj_.original_tagname_ = 'half_map_list'
# end class interpretation_type
[docs]class software_list_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software', 'software_type', 1),
]
subclass = None
superclass = None
def __init__(self, software=None):
self.original_tagname_ = None
if software is None:
self.software = []
else:
self.software = software
[docs] def factory(*args_, **kwargs_):
if software_list_type.subclass:
return software_list_type.subclass(*args_, **kwargs_)
else:
return software_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software(self): return self.software
[docs] def set_software(self, software): self.software = software
[docs] def add_software(self, value): self.software.append(value)
[docs] def insert_software_at(self, index, value): self.software.insert(index, value)
[docs] def replace_software_at(self, index, value): self.software[index] = value
[docs] def hasContent_(self):
if (
self.software
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='software_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='software_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='software_list_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='software_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='software_list_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for software_ in self.software:
software_.export(outfile, level, namespace_, name_='software', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software':
obj_ = software_type.factory()
obj_.build(child_)
self.software.append(obj_)
obj_.original_tagname_ = 'software'
# end class software_list_type
[docs]class code_type(GeneratedsSuper):
"""It is true, if the current status is 'OBS' and the entry has been
replaced by newer entries. This is true if the current status is
'REL' and there are older entries that have been made obsoleted
because of this one."""
member_data_items_ = [
MemberSpec_('superseded', 'xs:boolean', 0),
MemberSpec_('supersedes', 'xs:boolean', 0),
MemberSpec_('valueOf_', ['status_code_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, superseded=None, supersedes=None, valueOf_=None):
self.original_tagname_ = None
self.superseded = _cast(bool, superseded)
self.supersedes = _cast(bool, supersedes)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if code_type.subclass:
return code_type.subclass(*args_, **kwargs_)
else:
return code_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_superseded(self): return self.superseded
[docs] def set_superseded(self, superseded): self.superseded = superseded
[docs] def get_supersedes(self): return self.supersedes
[docs] def set_supersedes(self, supersedes): self.supersedes = supersedes
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='code_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='code_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='code_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='code_type'):
if self.superseded is not None and 'superseded' not in already_processed:
already_processed.add('superseded')
outfile.write(' superseded="%s"' % self.gds_format_boolean(self.superseded, input_name='superseded'))
if self.supersedes is not None and 'supersedes' not in already_processed:
already_processed.add('supersedes')
outfile.write(' supersedes="%s"' % self.gds_format_boolean(self.supersedes, input_name='supersedes'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='code_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('superseded', node)
if value is not None and 'superseded' not in already_processed:
already_processed.add('superseded')
if value in ('true', '1'):
self.superseded = True
elif value in ('false', '0'):
self.superseded = False
else:
raise_parse_error(node, 'Bad boolean attribute')
value = find_attr_value_('supersedes', node)
if value is not None and 'supersedes' not in already_processed:
already_processed.add('supersedes')
if value in ('true', '1'):
self.supersedes = True
elif value in ('false', '0'):
self.supersedes = False
else:
raise_parse_error(node, 'Bad boolean attribute')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class code_type
[docs]class auxiliary_link_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type_', ['typeType44', 'xs:token'], 0),
MemberSpec_('link', ['linkType', 'xs:anyURI'], 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, link=None, details=None):
self.original_tagname_ = None
self.type_ = type_
self.validate_typeType44(self.type_)
self.link = link
self.validate_linkType(self.link)
self.details = details
[docs] def factory(*args_, **kwargs_):
if auxiliary_link_type.subclass:
return auxiliary_link_type.subclass(*args_, **kwargs_)
else:
return auxiliary_link_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_link(self): return self.link
[docs] def set_link(self, link): self.link = link
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_typeType44(self, value):
# Validate type typeType44, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['2D EM DATA', 'CORRELATIVE LIGHT MICROSCOPY']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on typeType44' % {"value" : value.encode("utf-8")} )
[docs] def validate_linkType(self, value):
# Validate type linkType, a restriction on xs:anyURI.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_linkType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_linkType_patterns_, ))
validate_linkType_patterns_ = [['^(https?|ftp)://.*$']]
[docs] def hasContent_(self):
if (
self.type_ is not None or
self.link is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='auxiliary_link_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='auxiliary_link_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='auxiliary_link_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='auxiliary_link_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='auxiliary_link_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.type_ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_))
if self.link is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slink>%s</%slink>%s' % (namespace_, self.gds_format_string(quote_xml(self.link).encode(ExternalEncoding), input_name='link'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'type':
type_ = child_.text
type_ = re_.sub(String_cleanup_pat_, " ", type_).strip()
type_ = self.gds_validate_string(type_, node, 'type')
self.type_ = type_
# validate type typeType44
self.validate_typeType44(self.type_)
elif nodeName_ == 'link':
link_ = child_.text
link_ = self.gds_validate_string(link_, node, 'link')
self.link = link_
# validate type linkType
self.validate_linkType(self.link)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class auxiliary_link_type
[docs]class author_order_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('order', 'xs:positiveInteger', 0),
MemberSpec_('valueOf_', ['author_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, order=None, valueOf_=None):
self.original_tagname_ = None
self.order = _cast(int, order)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if author_order_type.subclass:
return author_order_type.subclass(*args_, **kwargs_)
else:
return author_order_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_order(self): return self.order
[docs] def set_order(self, order): self.order = order
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='author_order_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='author_order_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='author_order_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='author_order_type'):
if self.order is not None and 'order' not in already_processed:
already_processed.add('order')
outfile.write(' order="%s"' % self.gds_format_integer(self.order, input_name='order'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='author_order_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('order', node)
if value is not None and 'order' not in already_processed:
already_processed.add('order')
try:
self.order = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.order <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class author_order_type
[docs]class macromolecule_list_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('macromolecule', 'base_macromolecule_type', 1),
]
subclass = None
superclass = None
def __init__(self, macromolecule=None):
self.original_tagname_ = None
if macromolecule is None:
self.macromolecule = []
else:
self.macromolecule = macromolecule
[docs] def factory(*args_, **kwargs_):
if macromolecule_list_type.subclass:
return macromolecule_list_type.subclass(*args_, **kwargs_)
else:
return macromolecule_list_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_macromolecule(self): return self.macromolecule
[docs] def set_macromolecule(self, macromolecule): self.macromolecule = macromolecule
[docs] def add_macromolecule(self, value): self.macromolecule.append(value)
[docs] def insert_macromolecule_at(self, index, value): self.macromolecule.insert(index, value)
[docs] def replace_macromolecule_at(self, index, value): self.macromolecule[index] = value
[docs] def hasContent_(self):
if (
self.macromolecule
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='macromolecule_list_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='macromolecule_list_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='macromolecule_list_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='macromolecule_list_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='macromolecule_list_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for macromolecule_ in self.macromolecule:
macromolecule_.export(outfile, level, namespace_, name_='macromolecule', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'macromolecule':
class_obj_ = self.get_class_obj_(child_, base_macromolecule_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'macromolecule'
elif nodeName_ == 'protein_or_peptide':
obj_ = protein_or_peptide.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'protein_or_peptide'
elif nodeName_ == 'dna':
obj_ = dna.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'dna'
elif nodeName_ == 'rna':
obj_ = rna.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'rna'
elif nodeName_ == 'saccharide':
obj_ = saccharide.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'saccharide'
elif nodeName_ == 'lipid':
obj_ = lipid.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'lipid'
elif nodeName_ == 'ligand':
obj_ = ligand.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'ligand'
elif nodeName_ == 'em_label':
obj_ = em_label.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'em_label'
elif nodeName_ == 'other_macromolecule':
obj_ = other_macromolecule.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'other_macromolecule'
# end class macromolecule_list_type
[docs]class temperature_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_temperature', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if temperature_type.subclass:
return temperature_type.subclass(*args_, **kwargs_)
else:
return temperature_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='temperature_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='temperature_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='temperature_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='temperature_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='temperature_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class temperature_type
[docs]class cell_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_cell_dim', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if cell_type.subclass:
return cell_type.subclass(*args_, **kwargs_)
else:
return cell_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='cell_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='cell_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='cell_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='cell_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='cell_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class cell_type
[docs]class cell_angle_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_cell_angle', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if cell_angle_type.subclass:
return cell_angle_type.subclass(*args_, **kwargs_)
else:
return cell_angle_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='cell_angle_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='cell_angle_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='cell_angle_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='cell_angle_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='cell_angle_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class cell_angle_type
[docs]class integer_vector_map_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('col', 'xs:positiveInteger', 0),
MemberSpec_('row', 'xs:positiveInteger', 0),
MemberSpec_('sec', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, col=None, row=None, sec=None):
self.original_tagname_ = None
self.col = col
self.row = row
self.sec = sec
[docs] def factory(*args_, **kwargs_):
if integer_vector_map_type.subclass:
return integer_vector_map_type.subclass(*args_, **kwargs_)
else:
return integer_vector_map_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_col(self): return self.col
[docs] def set_col(self, col): self.col = col
[docs] def get_row(self): return self.row
[docs] def set_row(self, row): self.row = row
[docs] def get_sec(self): return self.sec
[docs] def set_sec(self, sec): self.sec = sec
[docs] def hasContent_(self):
if (
self.col is not None or
self.row is not None or
self.sec is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='integer_vector_map_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='integer_vector_map_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='integer_vector_map_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='integer_vector_map_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='integer_vector_map_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.col is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scol>%s</%scol>%s' % (namespace_, self.gds_format_integer(self.col, input_name='col'), namespace_, eol_))
if self.row is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srow>%s</%srow>%s' % (namespace_, self.gds_format_integer(self.row, input_name='row'), namespace_, eol_))
if self.sec is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssec>%s</%ssec>%s' % (namespace_, self.gds_format_integer(self.sec, input_name='sec'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'col':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'col')
self.col = ival_
elif nodeName_ == 'row':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'row')
self.row = ival_
elif nodeName_ == 'sec':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'sec')
self.sec = ival_
# end class integer_vector_map_type
[docs]class citation_type(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if citation_type.subclass:
return citation_type.subclass(*args_, **kwargs_)
else:
return citation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='citation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='citation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='citation_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='citation_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='citation_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class citation_type
[docs]class non_journal_citation(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('published', 'xs:boolean', 0),
MemberSpec_('author', 'author_order_type', 1),
MemberSpec_('editor', 'author_order_type', 1),
MemberSpec_('book_title', 'xs:token', 0),
MemberSpec_('thesis_title', 'xs:token', 0),
MemberSpec_('book_chapter_title', 'xs:token', 0),
MemberSpec_('volume', 'xs:string', 0),
MemberSpec_('publisher', 'xs:token', 0),
MemberSpec_('publication_location', ['publication_locationType', 'xs:token'], 0),
MemberSpec_('country', 'xs:token', 0),
MemberSpec_('first_page', ['page_type', 'xs:string'], 0),
MemberSpec_('last_page', ['page_type', 'xs:string'], 0),
MemberSpec_('year', ['yearType', 'xs:gYear'], 0),
MemberSpec_('language', 'xs:language', 0),
MemberSpec_('external_references', 'external_referencesType45', 1),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, published=None, author=None, editor=None, book_title=None, thesis_title=None, book_chapter_title=None, volume=None, publisher=None, publication_location=None, country=None, first_page=None, last_page=None, year=None, language=None, external_references=None, details=None):
self.original_tagname_ = None
self.published = _cast(bool, published)
if author is None:
self.author = []
else:
self.author = author
if editor is None:
self.editor = []
else:
self.editor = editor
self.book_title = book_title
self.thesis_title = thesis_title
self.book_chapter_title = book_chapter_title
self.volume = volume
self.publisher = publisher
self.publication_location = publication_location
self.validate_publication_locationType(self.publication_location)
self.country = country
self.first_page = first_page
self.validate_page_type(self.first_page)
self.last_page = last_page
self.validate_page_type(self.last_page)
self.year = year
self.validate_yearType(self.year)
self.language = language
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
self.details = details
[docs] def factory(*args_, **kwargs_):
if non_journal_citation.subclass:
return non_journal_citation.subclass(*args_, **kwargs_)
else:
return non_journal_citation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_editor(self): return self.editor
[docs] def set_editor(self, editor): self.editor = editor
[docs] def add_editor(self, value): self.editor.append(value)
[docs] def insert_editor_at(self, index, value): self.editor.insert(index, value)
[docs] def replace_editor_at(self, index, value): self.editor[index] = value
[docs] def get_book_title(self): return self.book_title
[docs] def set_book_title(self, book_title): self.book_title = book_title
[docs] def get_thesis_title(self): return self.thesis_title
[docs] def set_thesis_title(self, thesis_title): self.thesis_title = thesis_title
[docs] def get_book_chapter_title(self): return self.book_chapter_title
[docs] def set_book_chapter_title(self, book_chapter_title): self.book_chapter_title = book_chapter_title
[docs] def get_volume(self): return self.volume
[docs] def set_volume(self, volume): self.volume = volume
[docs] def get_publisher(self): return self.publisher
[docs] def set_publisher(self, publisher): self.publisher = publisher
[docs] def get_publication_location(self): return self.publication_location
[docs] def set_publication_location(self, publication_location): self.publication_location = publication_location
[docs] def get_country(self): return self.country
[docs] def set_country(self, country): self.country = country
[docs] def get_first_page(self): return self.first_page
[docs] def set_first_page(self, first_page): self.first_page = first_page
[docs] def get_last_page(self): return self.last_page
[docs] def set_last_page(self, last_page): self.last_page = last_page
[docs] def get_year(self): return self.year
[docs] def set_year(self, year): self.year = year
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_published(self): return self.published
[docs] def set_published(self, published): self.published = published
[docs] def validate_publication_locationType(self, value):
# Validate type publication_locationType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_publication_locationType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_publication_locationType_patterns_, ))
validate_publication_locationType_patterns_ = [['^[\\w -]+(, [\\w -]+)*$']]
[docs] def validate_page_type(self, value):
# Validate type page_type, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
pass
[docs] def validate_yearType(self, value):
# Validate type yearType, a restriction on xs:gYear.
if value is not None and Validate_simpletypes_:
if value < 1900:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on yearType' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.author or
self.editor or
self.book_title is not None or
self.thesis_title is not None or
self.book_chapter_title is not None or
self.volume is not None or
self.publisher is not None or
self.publication_location is not None or
self.country is not None or
self.first_page is not None or
self.last_page is not None or
self.year is not None or
self.language is not None or
self.external_references or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='non_journal_citation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='non_journal_citation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='non_journal_citation', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='non_journal_citation'):
if self.published is not None and 'published' not in already_processed:
already_processed.add('published')
outfile.write(' published="%s"' % self.gds_format_boolean(self.published, input_name='published'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='non_journal_citation', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for author_ in self.author:
author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
for editor_ in self.editor:
editor_.export(outfile, level, namespace_, name_='editor', pretty_print=pretty_print)
if self.book_title is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sbook_title>%s</%sbook_title>%s' % (namespace_, self.gds_format_string(quote_xml(self.book_title).encode(ExternalEncoding), input_name='book_title'), namespace_, eol_))
if self.thesis_title is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sthesis_title>%s</%sthesis_title>%s' % (namespace_, self.gds_format_string(quote_xml(self.thesis_title).encode(ExternalEncoding), input_name='thesis_title'), namespace_, eol_))
if self.book_chapter_title is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sbook_chapter_title>%s</%sbook_chapter_title>%s' % (namespace_, self.gds_format_string(quote_xml(self.book_chapter_title).encode(ExternalEncoding), input_name='book_chapter_title'), namespace_, eol_))
if self.volume is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svolume>%s</%svolume>%s' % (namespace_, self.gds_format_string(quote_xml(self.volume).encode(ExternalEncoding), input_name='volume'), namespace_, eol_))
if self.publisher is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%spublisher>%s</%spublisher>%s' % (namespace_, self.gds_format_string(quote_xml(self.publisher).encode(ExternalEncoding), input_name='publisher'), namespace_, eol_))
if self.publication_location is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%spublication_location>%s</%spublication_location>%s' % (namespace_, self.gds_format_string(quote_xml(self.publication_location).encode(ExternalEncoding), input_name='publication_location'), namespace_, eol_))
if self.country is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scountry>%s</%scountry>%s' % (namespace_, self.gds_format_string(quote_xml(self.country).encode(ExternalEncoding), input_name='country'), namespace_, eol_))
if self.first_page is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfirst_page>%s</%sfirst_page>%s' % (namespace_, self.gds_format_string(quote_xml(self.first_page).encode(ExternalEncoding), input_name='first_page'), namespace_, eol_))
if self.last_page is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slast_page>%s</%slast_page>%s' % (namespace_, self.gds_format_string(quote_xml(self.last_page).encode(ExternalEncoding), input_name='last_page'), namespace_, eol_))
if self.year is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%syear>%s</%syear>%s' % (namespace_, self.gds_format_string(quote_xml(self.year).encode(ExternalEncoding), input_name='year'), namespace_, eol_))
if self.language is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slanguage>%s</%slanguage>%s' % (namespace_, self.gds_format_string(quote_xml(self.language).encode(ExternalEncoding), input_name='language'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('published', node)
if value is not None and 'published' not in already_processed:
already_processed.add('published')
if value in ('true', '1'):
self.published = True
elif value in ('false', '0'):
self.published = False
else:
raise_parse_error(node, 'Bad boolean attribute')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'author':
obj_ = author_order_type.factory()
obj_.build(child_)
self.author.append(obj_)
obj_.original_tagname_ = 'author'
elif nodeName_ == 'editor':
obj_ = author_order_type.factory()
obj_.build(child_)
self.editor.append(obj_)
obj_.original_tagname_ = 'editor'
elif nodeName_ == 'book_title':
book_title_ = child_.text
book_title_ = re_.sub(String_cleanup_pat_, " ", book_title_).strip()
book_title_ = self.gds_validate_string(book_title_, node, 'book_title')
self.book_title = book_title_
elif nodeName_ == 'thesis_title':
thesis_title_ = child_.text
thesis_title_ = re_.sub(String_cleanup_pat_, " ", thesis_title_).strip()
thesis_title_ = self.gds_validate_string(thesis_title_, node, 'thesis_title')
self.thesis_title = thesis_title_
elif nodeName_ == 'book_chapter_title':
book_chapter_title_ = child_.text
book_chapter_title_ = re_.sub(String_cleanup_pat_, " ", book_chapter_title_).strip()
book_chapter_title_ = self.gds_validate_string(book_chapter_title_, node, 'book_chapter_title')
self.book_chapter_title = book_chapter_title_
elif nodeName_ == 'volume':
volume_ = child_.text
volume_ = self.gds_validate_string(volume_, node, 'volume')
self.volume = volume_
elif nodeName_ == 'publisher':
publisher_ = child_.text
publisher_ = re_.sub(String_cleanup_pat_, " ", publisher_).strip()
publisher_ = self.gds_validate_string(publisher_, node, 'publisher')
self.publisher = publisher_
elif nodeName_ == 'publication_location':
publication_location_ = child_.text
publication_location_ = re_.sub(String_cleanup_pat_, " ", publication_location_).strip()
publication_location_ = self.gds_validate_string(publication_location_, node, 'publication_location')
self.publication_location = publication_location_
# validate type publication_locationType
self.validate_publication_locationType(self.publication_location)
elif nodeName_ == 'country':
country_ = child_.text
country_ = re_.sub(String_cleanup_pat_, " ", country_).strip()
country_ = self.gds_validate_string(country_, node, 'country')
self.country = country_
elif nodeName_ == 'first_page':
first_page_ = child_.text
first_page_ = self.gds_validate_string(first_page_, node, 'first_page')
self.first_page = first_page_
# validate type page_type
self.validate_page_type(self.first_page)
elif nodeName_ == 'last_page':
last_page_ = child_.text
last_page_ = self.gds_validate_string(last_page_, node, 'last_page')
self.last_page = last_page_
# validate type page_type
self.validate_page_type(self.last_page)
elif nodeName_ == 'year':
year_ = child_.text
year_ = self.gds_validate_string(year_, node, 'year')
self.year = year_
# validate type yearType
self.validate_yearType(self.year)
elif nodeName_ == 'language':
language_ = child_.text
language_ = self.gds_validate_string(language_, node, 'language')
self.language = language_
elif nodeName_ == 'external_references':
obj_ = external_referencesType45.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class non_journal_citation
[docs]class journal_citation(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('published', 'xs:boolean', 0),
MemberSpec_('author', 'author_order_type', 1),
MemberSpec_('editor', 'author_order_type', 1),
MemberSpec_('title', 'xs:token', 0),
MemberSpec_('journal', 'xs:token', 0),
MemberSpec_('journal_abbreviation', ['journal_abbreviationType', 'xs:token'], 0),
MemberSpec_('country', 'xs:token', 0),
MemberSpec_('issue', 'xs:positiveInteger', 0),
MemberSpec_('volume', 'xs:string', 0),
MemberSpec_('first_page', ['page_type', 'xs:string'], 0),
MemberSpec_('last_page', ['page_type', 'xs:string'], 0),
MemberSpec_('year', ['yearType46', 'xs:gYear'], 0),
MemberSpec_('language', 'xs:language', 0),
MemberSpec_('external_references', 'external_referencesType47', 1),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, published=None, author=None, editor=None, title=None, journal=None, journal_abbreviation=None, country=None, issue=None, volume=None, first_page=None, last_page=None, year=None, language=None, external_references=None, details=None):
self.original_tagname_ = None
self.published = _cast(bool, published)
if author is None:
self.author = []
else:
self.author = author
if editor is None:
self.editor = []
else:
self.editor = editor
self.title = title
self.journal = journal
self.journal_abbreviation = journal_abbreviation
self.validate_journal_abbreviationType(self.journal_abbreviation)
self.country = country
self.issue = issue
self.volume = volume
self.first_page = first_page
self.validate_page_type(self.first_page)
self.last_page = last_page
self.validate_page_type(self.last_page)
self.year = year
self.validate_yearType46(self.year)
self.language = language
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
self.details = details
[docs] def factory(*args_, **kwargs_):
if journal_citation.subclass:
return journal_citation.subclass(*args_, **kwargs_)
else:
return journal_citation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_editor(self): return self.editor
[docs] def set_editor(self, editor): self.editor = editor
[docs] def add_editor(self, value): self.editor.append(value)
[docs] def insert_editor_at(self, index, value): self.editor.insert(index, value)
[docs] def replace_editor_at(self, index, value): self.editor[index] = value
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_journal(self): return self.journal
[docs] def set_journal(self, journal): self.journal = journal
[docs] def get_journal_abbreviation(self): return self.journal_abbreviation
[docs] def set_journal_abbreviation(self, journal_abbreviation): self.journal_abbreviation = journal_abbreviation
[docs] def get_country(self): return self.country
[docs] def set_country(self, country): self.country = country
[docs] def get_issue(self): return self.issue
[docs] def set_issue(self, issue): self.issue = issue
[docs] def get_volume(self): return self.volume
[docs] def set_volume(self, volume): self.volume = volume
[docs] def get_first_page(self): return self.first_page
[docs] def set_first_page(self, first_page): self.first_page = first_page
[docs] def get_last_page(self): return self.last_page
[docs] def set_last_page(self, last_page): self.last_page = last_page
[docs] def get_year(self): return self.year
[docs] def set_year(self, year): self.year = year
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_published(self): return self.published
[docs] def set_published(self, published): self.published = published
[docs] def validate_journal_abbreviationType(self, value):
# Validate type journal_abbreviationType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_journal_abbreviationType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_journal_abbreviationType_patterns_, ))
validate_journal_abbreviationType_patterns_ = [['^[A-Z][a-z]*\\.?( [A-Z][a-z]+\\.?)*$']]
[docs] def validate_page_type(self, value):
# Validate type page_type, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
pass
[docs] def validate_yearType46(self, value):
# Validate type yearType46, a restriction on xs:gYear.
if value is not None and Validate_simpletypes_:
if value < 1900:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on yearType46' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.author or
self.editor or
self.title is not None or
self.journal is not None or
self.journal_abbreviation is not None or
self.country is not None or
self.issue is not None or
self.volume is not None or
self.first_page is not None or
self.last_page is not None or
self.year is not None or
self.language is not None or
self.external_references or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='journal_citation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='journal_citation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='journal_citation', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='journal_citation'):
if self.published is not None and 'published' not in already_processed:
already_processed.add('published')
outfile.write(' published="%s"' % self.gds_format_boolean(self.published, input_name='published'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='journal_citation', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for author_ in self.author:
author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
for editor_ in self.editor:
editor_.export(outfile, level, namespace_, name_='editor', pretty_print=pretty_print)
if self.title is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stitle>%s</%stitle>%s' % (namespace_, self.gds_format_string(quote_xml(self.title).encode(ExternalEncoding), input_name='title'), namespace_, eol_))
if self.journal is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sjournal>%s</%sjournal>%s' % (namespace_, self.gds_format_string(quote_xml(self.journal).encode(ExternalEncoding), input_name='journal'), namespace_, eol_))
if self.journal_abbreviation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sjournal_abbreviation>%s</%sjournal_abbreviation>%s' % (namespace_, self.gds_format_string(quote_xml(self.journal_abbreviation).encode(ExternalEncoding), input_name='journal_abbreviation'), namespace_, eol_))
if self.country is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scountry>%s</%scountry>%s' % (namespace_, self.gds_format_string(quote_xml(self.country).encode(ExternalEncoding), input_name='country'), namespace_, eol_))
if self.issue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sissue>%s</%sissue>%s' % (namespace_, self.gds_format_integer(self.issue, input_name='issue'), namespace_, eol_))
if self.volume is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svolume>%s</%svolume>%s' % (namespace_, self.gds_format_string(quote_xml(self.volume).encode(ExternalEncoding), input_name='volume'), namespace_, eol_))
if self.first_page is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfirst_page>%s</%sfirst_page>%s' % (namespace_, self.gds_format_string(quote_xml(self.first_page).encode(ExternalEncoding), input_name='first_page'), namespace_, eol_))
if self.last_page is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slast_page>%s</%slast_page>%s' % (namespace_, self.gds_format_string(quote_xml(self.last_page).encode(ExternalEncoding), input_name='last_page'), namespace_, eol_))
if self.year is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%syear>%s</%syear>%s' % (namespace_, self.gds_format_string(quote_xml(self.year).encode(ExternalEncoding), input_name='year'), namespace_, eol_))
if self.language is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slanguage>%s</%slanguage>%s' % (namespace_, self.gds_format_string(quote_xml(self.language).encode(ExternalEncoding), input_name='language'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('published', node)
if value is not None and 'published' not in already_processed:
already_processed.add('published')
if value in ('true', '1'):
self.published = True
elif value in ('false', '0'):
self.published = False
else:
raise_parse_error(node, 'Bad boolean attribute')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'author':
obj_ = author_order_type.factory()
obj_.build(child_)
self.author.append(obj_)
obj_.original_tagname_ = 'author'
elif nodeName_ == 'editor':
obj_ = author_order_type.factory()
obj_.build(child_)
self.editor.append(obj_)
obj_.original_tagname_ = 'editor'
elif nodeName_ == 'title':
title_ = child_.text
title_ = re_.sub(String_cleanup_pat_, " ", title_).strip()
title_ = self.gds_validate_string(title_, node, 'title')
self.title = title_
elif nodeName_ == 'journal':
journal_ = child_.text
journal_ = re_.sub(String_cleanup_pat_, " ", journal_).strip()
journal_ = self.gds_validate_string(journal_, node, 'journal')
self.journal = journal_
elif nodeName_ == 'journal_abbreviation':
journal_abbreviation_ = child_.text
journal_abbreviation_ = re_.sub(String_cleanup_pat_, " ", journal_abbreviation_).strip()
journal_abbreviation_ = self.gds_validate_string(journal_abbreviation_, node, 'journal_abbreviation')
self.journal_abbreviation = journal_abbreviation_
# validate type journal_abbreviationType
self.validate_journal_abbreviationType(self.journal_abbreviation)
elif nodeName_ == 'country':
country_ = child_.text
country_ = re_.sub(String_cleanup_pat_, " ", country_).strip()
country_ = self.gds_validate_string(country_, node, 'country')
self.country = country_
elif nodeName_ == 'issue':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'issue')
self.issue = ival_
elif nodeName_ == 'volume':
volume_ = child_.text
volume_ = self.gds_validate_string(volume_, node, 'volume')
self.volume = volume_
elif nodeName_ == 'first_page':
first_page_ = child_.text
first_page_ = self.gds_validate_string(first_page_, node, 'first_page')
self.first_page = first_page_
# validate type page_type
self.validate_page_type(self.first_page)
elif nodeName_ == 'last_page':
last_page_ = child_.text
last_page_ = self.gds_validate_string(last_page_, node, 'last_page')
self.last_page = last_page_
# validate type page_type
self.validate_page_type(self.last_page)
elif nodeName_ == 'year':
year_ = child_.text
year_ = self.gds_validate_string(year_, node, 'year')
self.year = year_
# validate type yearType46
self.validate_yearType46(self.year)
elif nodeName_ == 'language':
language_ = child_.text
language_ = self.gds_validate_string(language_, node, 'language')
self.language = language_
elif nodeName_ == 'external_references':
obj_ = external_referencesType47.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class journal_citation
[docs]class software_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('version', 'xs:token', 0),
MemberSpec_('processing_details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, name=None, version=None, processing_details=None):
self.original_tagname_ = None
self.name = name
self.version = version
self.processing_details = processing_details
[docs] def factory(*args_, **kwargs_):
if software_type.subclass:
return software_type.subclass(*args_, **kwargs_)
else:
return software_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_version(self): return self.version
[docs] def set_version(self, version): self.version = version
[docs] def get_processing_details(self): return self.processing_details
[docs] def set_processing_details(self, processing_details): self.processing_details = processing_details
[docs] def hasContent_(self):
if (
self.name is not None or
self.version is not None or
self.processing_details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='software_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='software_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='software_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='software_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='software_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.version is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sversion>%s</%sversion>%s' % (namespace_, self.gds_format_string(quote_xml(self.version).encode(ExternalEncoding), input_name='version'), namespace_, eol_))
if self.processing_details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sprocessing_details>%s</%sprocessing_details>%s' % (namespace_, self.gds_format_string(quote_xml(self.processing_details).encode(ExternalEncoding), input_name='processing_details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'version':
version_ = child_.text
version_ = re_.sub(String_cleanup_pat_, " ", version_).strip()
version_ = self.gds_validate_string(version_, node, 'version')
self.version = version_
elif nodeName_ == 'processing_details':
processing_details_ = child_.text
processing_details_ = self.gds_validate_string(processing_details_, node, 'processing_details')
self.processing_details = processing_details_
# end class software_type
[docs]class telephone_number_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('country', ['countryType', 'xs:token'], 0),
MemberSpec_('area', ['areaType', 'xs:token'], 0),
MemberSpec_('local', ['localType', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, country=None, area=None, local=None):
self.original_tagname_ = None
self.country = country
self.validate_countryType(self.country)
self.area = area
self.validate_areaType(self.area)
self.local = local
self.validate_localType(self.local)
[docs] def factory(*args_, **kwargs_):
if telephone_number_type.subclass:
return telephone_number_type.subclass(*args_, **kwargs_)
else:
return telephone_number_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_country(self): return self.country
[docs] def set_country(self, country): self.country = country
[docs] def get_area(self): return self.area
[docs] def set_area(self, area): self.area = area
[docs] def get_local(self): return self.local
[docs] def set_local(self, local): self.local = local
[docs] def validate_countryType(self, value):
# Validate type countryType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_countryType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_countryType_patterns_, ))
validate_countryType_patterns_ = [['^\\d{1,3}$']]
[docs] def validate_areaType(self, value):
# Validate type areaType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_areaType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_areaType_patterns_, ))
validate_areaType_patterns_ = [['^\\d{2,5}$']]
[docs] def validate_localType(self, value):
# Validate type localType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_localType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_localType_patterns_, ))
validate_localType_patterns_ = [['^\\d+( ext. \\d+)?$']]
[docs] def hasContent_(self):
if (
self.country is not None or
self.area is not None or
self.local is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='telephone_number_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='telephone_number_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='telephone_number_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='telephone_number_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='telephone_number_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.country is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scountry>%s</%scountry>%s' % (namespace_, self.gds_format_string(quote_xml(self.country).encode(ExternalEncoding), input_name='country'), namespace_, eol_))
if self.area is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sarea>%s</%sarea>%s' % (namespace_, self.gds_format_string(quote_xml(self.area).encode(ExternalEncoding), input_name='area'), namespace_, eol_))
if self.local is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slocal>%s</%slocal>%s' % (namespace_, self.gds_format_string(quote_xml(self.local).encode(ExternalEncoding), input_name='local'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'country':
country_ = child_.text
country_ = re_.sub(String_cleanup_pat_, " ", country_).strip()
country_ = self.gds_validate_string(country_, node, 'country')
self.country = country_
# validate type countryType
self.validate_countryType(self.country)
elif nodeName_ == 'area':
area_ = child_.text
area_ = re_.sub(String_cleanup_pat_, " ", area_).strip()
area_ = self.gds_validate_string(area_, node, 'area')
self.area = area_
# validate type areaType
self.validate_areaType(self.area)
elif nodeName_ == 'local':
local_ = child_.text
local_ = re_.sub(String_cleanup_pat_, " ", local_).strip()
local_ = self.gds_validate_string(local_, node, 'local')
self.local = local_
# validate type localType
self.validate_localType(self.local)
# end class telephone_number_type
[docs]class crystallography_preparation_type(base_preparation_type):
"""TODO: add limits and units."""
member_data_items_ = [
MemberSpec_('crystal_formation', 'crystal_formationType', 0),
]
subclass = None
superclass = base_preparation_type
def __init__(self, id=None, concentration=None, buffer=None, staining=None, sugar_embedding=None, shadowing=None, grid=None, vitrification=None, details=None, crystal_formation=None):
self.original_tagname_ = None
super(crystallography_preparation_type, self).__init__(id, concentration, buffer, staining, sugar_embedding, shadowing, grid, vitrification, details, )
self.crystal_formation = crystal_formation
[docs] def factory(*args_, **kwargs_):
if crystallography_preparation_type.subclass:
return crystallography_preparation_type.subclass(*args_, **kwargs_)
else:
return crystallography_preparation_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
self.crystal_formation is not None or
super(crystallography_preparation_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_preparation_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_preparation_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_preparation_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_preparation_type'):
super(crystallography_preparation_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_preparation_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_preparation_type', fromsubclass_=False, pretty_print=True):
super(crystallography_preparation_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.crystal_formation is not None:
self.crystal_formation.export(outfile, level, namespace_, name_='crystal_formation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(crystallography_preparation_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'crystal_formation':
obj_ = crystal_formationType.factory()
obj_.build(child_)
self.crystal_formation = obj_
obj_.original_tagname_ = 'crystal_formation'
super(crystallography_preparation_type, self).buildChildren(child_, node, nodeName_, True)
# end class crystallography_preparation_type
[docs]class background_masked_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('geometrical_shape', ['geometrical_shapeType', 'xs:token'], 0),
MemberSpec_('dimensions', 'dimensionsType49', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, geometrical_shape=None, dimensions=None, software_list=None, details=None):
self.original_tagname_ = None
self.geometrical_shape = geometrical_shape
self.validate_geometrical_shapeType(self.geometrical_shape)
self.dimensions = dimensions
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if background_masked_type.subclass:
return background_masked_type.subclass(*args_, **kwargs_)
else:
return background_masked_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_geometrical_shape(self): return self.geometrical_shape
[docs] def set_geometrical_shape(self, geometrical_shape): self.geometrical_shape = geometrical_shape
[docs] def get_dimensions(self): return self.dimensions
[docs] def set_dimensions(self, dimensions): self.dimensions = dimensions
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_geometrical_shapeType(self, value):
# Validate type geometrical_shapeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['SPHERE', 'SOFT SPHERE', 'GAUSSIAN', 'CIRCLE', 'RECTANGLE', 'CYLINDER', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on geometrical_shapeType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.geometrical_shape is not None or
self.dimensions is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='background_masked_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='background_masked_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='background_masked_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='background_masked_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='background_masked_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.geometrical_shape is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sgeometrical_shape>%s</%sgeometrical_shape>%s' % (namespace_, self.gds_format_string(quote_xml(self.geometrical_shape).encode(ExternalEncoding), input_name='geometrical_shape'), namespace_, eol_))
if self.dimensions is not None:
self.dimensions.export(outfile, level, namespace_, name_='dimensions', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'geometrical_shape':
geometrical_shape_ = child_.text
geometrical_shape_ = re_.sub(String_cleanup_pat_, " ", geometrical_shape_).strip()
geometrical_shape_ = self.gds_validate_string(geometrical_shape_, node, 'geometrical_shape')
self.geometrical_shape = geometrical_shape_
# validate type geometrical_shapeType
self.validate_geometrical_shapeType(self.geometrical_shape)
elif nodeName_ == 'dimensions':
obj_ = dimensionsType49.factory()
obj_.build(child_)
self.dimensions = obj_
obj_.original_tagname_ = 'dimensions'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class background_masked_type
[docs]class reconstruction_filtering_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('background_masked', 'background_masked_type', 0),
MemberSpec_('spatial_filtering', 'spatial_filteringType', 0),
MemberSpec_('sharpening', 'sharpeningType', 0),
MemberSpec_('b_factorSharpening', 'b-factorSharpeningType', 0),
MemberSpec_('other', 'otherType52', 0),
]
subclass = None
superclass = None
def __init__(self, background_masked=None, spatial_filtering=None, sharpening=None, b_factorSharpening=None, other=None):
self.original_tagname_ = None
self.background_masked = background_masked
self.spatial_filtering = spatial_filtering
self.sharpening = sharpening
self.b_factorSharpening = b_factorSharpening
self.other = other
[docs] def factory(*args_, **kwargs_):
if reconstruction_filtering_type.subclass:
return reconstruction_filtering_type.subclass(*args_, **kwargs_)
else:
return reconstruction_filtering_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_background_masked(self): return self.background_masked
[docs] def set_background_masked(self, background_masked): self.background_masked = background_masked
[docs] def get_spatial_filtering(self): return self.spatial_filtering
[docs] def set_spatial_filtering(self, spatial_filtering): self.spatial_filtering = spatial_filtering
[docs] def get_sharpening(self): return self.sharpening
[docs] def set_sharpening(self, sharpening): self.sharpening = sharpening
[docs] def get_b_factorSharpening(self): return self.b_factorSharpening
[docs] def set_b_factorSharpening(self, b_factorSharpening): self.b_factorSharpening = b_factorSharpening
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def hasContent_(self):
if (
self.background_masked is not None or
self.spatial_filtering is not None or
self.sharpening is not None or
self.b_factorSharpening is not None or
self.other is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='reconstruction_filtering_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='reconstruction_filtering_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='reconstruction_filtering_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='reconstruction_filtering_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='reconstruction_filtering_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.background_masked is not None:
self.background_masked.export(outfile, level, namespace_, name_='background_masked', pretty_print=pretty_print)
if self.spatial_filtering is not None:
self.spatial_filtering.export(outfile, level, namespace_, name_='spatial_filtering', pretty_print=pretty_print)
if self.sharpening is not None:
self.sharpening.export(outfile, level, namespace_, name_='sharpening', pretty_print=pretty_print)
if self.b_factorSharpening is not None:
self.b_factorSharpening.export(outfile, level, namespace_, name_='b-factorSharpening', pretty_print=pretty_print)
if self.other is not None:
self.other.export(outfile, level, namespace_, name_='other', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'background_masked':
obj_ = background_masked_type.factory()
obj_.build(child_)
self.background_masked = obj_
obj_.original_tagname_ = 'background_masked'
elif nodeName_ == 'spatial_filtering':
obj_ = spatial_filteringType.factory()
obj_.build(child_)
self.spatial_filtering = obj_
obj_.original_tagname_ = 'spatial_filtering'
elif nodeName_ == 'sharpening':
obj_ = sharpeningType.factory()
obj_.build(child_)
self.sharpening = obj_
obj_.original_tagname_ = 'sharpening'
elif nodeName_ == 'b-factorSharpening':
obj_ = b_factorSharpeningType.factory()
obj_.build(child_)
self.b_factorSharpening = obj_
obj_.original_tagname_ = 'b-factorSharpening'
elif nodeName_ == 'other':
obj_ = otherType52.factory()
obj_.build(child_)
self.other = obj_
obj_.original_tagname_ = 'other'
# end class reconstruction_filtering_type
[docs]class chain_id_list(chain_type):
member_data_items_ = [
]
subclass = None
superclass = chain_type
def __init__(self, id=None, residue_range=None):
self.original_tagname_ = None
super(chain_id_list, self).__init__(id, residue_range, )
[docs] def factory(*args_, **kwargs_):
if chain_id_list.subclass:
return chain_id_list.subclass(*args_, **kwargs_)
else:
return chain_id_list(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
super(chain_id_list, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chain_id_list', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chain_id_list')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='chain_id_list', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chain_id_list'):
super(chain_id_list, self).exportAttributes(outfile, level, already_processed, namespace_, name_='chain_id_list')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chain_id_list', fromsubclass_=False, pretty_print=True):
super(chain_id_list, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(chain_id_list, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
super(chain_id_list, self).buildChildren(child_, node, nodeName_, True)
pass
# end class chain_id_list
[docs]class recombinant_source_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('database', 'xs:token', 0),
MemberSpec_('organism', 'organism_type', 0),
MemberSpec_('strain', 'xs:token', 0),
MemberSpec_('cell', 'cell', 0),
MemberSpec_('plasmid', 'xs:token', 0),
MemberSpec_('synonym_organism', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, database=None, organism=None, strain=None, cell=None, plasmid=None, synonym_organism=None):
self.original_tagname_ = None
self.database = _cast(None, database)
self.organism = organism
self.strain = strain
self.cell = cell
self.plasmid = plasmid
self.synonym_organism = synonym_organism
[docs] def factory(*args_, **kwargs_):
if recombinant_source_type.subclass:
return recombinant_source_type.subclass(*args_, **kwargs_)
else:
return recombinant_source_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organism(self): return self.organism
[docs] def set_organism(self, organism): self.organism = organism
[docs] def get_strain(self): return self.strain
[docs] def set_strain(self, strain): self.strain = strain
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def get_plasmid(self): return self.plasmid
[docs] def set_plasmid(self, plasmid): self.plasmid = plasmid
[docs] def get_synonym_organism(self): return self.synonym_organism
[docs] def set_synonym_organism(self, synonym_organism): self.synonym_organism = synonym_organism
[docs] def get_database(self): return self.database
[docs] def set_database(self, database): self.database = database
[docs] def hasContent_(self):
if (
self.organism is not None or
self.strain is not None or
self.cell is not None or
self.plasmid is not None or
self.synonym_organism is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='recombinant_source_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='recombinant_source_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='recombinant_source_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='recombinant_source_type'):
if self.database is not None and 'database' not in already_processed:
already_processed.add('database')
outfile.write(' database=%s' % (self.gds_format_string(quote_attrib(self.database).encode(ExternalEncoding), input_name='database'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='recombinant_source_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organism is not None:
self.organism.export(outfile, level, namespace_, name_='organism', pretty_print=pretty_print)
if self.strain is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstrain>%s</%sstrain>%s' % (namespace_, self.gds_format_string(quote_xml(self.strain).encode(ExternalEncoding), input_name='strain'), namespace_, eol_))
if self.cell is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scell>%s</%scell>%s' % (namespace_, self.gds_format_string(quote_xml(self.cell).encode(ExternalEncoding), input_name='cell'), namespace_, eol_))
if self.plasmid is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%splasmid>%s</%splasmid>%s' % (namespace_, self.gds_format_string(quote_xml(self.plasmid).encode(ExternalEncoding), input_name='plasmid'), namespace_, eol_))
if self.synonym_organism is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssynonym_organism>%s</%ssynonym_organism>%s' % (namespace_, self.gds_format_string(quote_xml(self.synonym_organism).encode(ExternalEncoding), input_name='synonym_organism'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('database', node)
if value is not None and 'database' not in already_processed:
already_processed.add('database')
self.database = value
self.database = ' '.join(self.database.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organism':
obj_ = organism_type.factory()
obj_.build(child_)
self.organism = obj_
obj_.original_tagname_ = 'organism'
elif nodeName_ == 'strain':
strain_ = child_.text
strain_ = re_.sub(String_cleanup_pat_, " ", strain_).strip()
strain_ = self.gds_validate_string(strain_, node, 'strain')
self.strain = strain_
elif nodeName_ == 'cell':
cell_ = child_.text
cell_ = re_.sub(String_cleanup_pat_, " ", cell_).strip()
cell_ = self.gds_validate_string(cell_, node, 'cell')
self.cell = cell_
elif nodeName_ == 'plasmid':
plasmid_ = child_.text
plasmid_ = re_.sub(String_cleanup_pat_, " ", plasmid_).strip()
plasmid_ = self.gds_validate_string(plasmid_, node, 'plasmid')
self.plasmid = plasmid_
elif nodeName_ == 'synonym_organism':
synonym_organism_ = child_.text
synonym_organism_ = re_.sub(String_cleanup_pat_, " ", synonym_organism_).strip()
synonym_organism_ = self.gds_validate_string(synonym_organism_, node, 'synonym_organism')
self.synonym_organism = synonym_organism_
# end class recombinant_source_type
[docs]class organism_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('ncbi', 'xs:positiveInteger', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, ncbi=None, valueOf_=None):
self.original_tagname_ = None
self.ncbi = _cast(int, ncbi)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if organism_type.subclass:
return organism_type.subclass(*args_, **kwargs_)
else:
return organism_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ncbi(self): return self.ncbi
[docs] def set_ncbi(self, ncbi): self.ncbi = ncbi
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='organism_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='organism_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='organism_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='organism_type'):
if self.ncbi is not None and 'ncbi' not in already_processed:
already_processed.add('ncbi')
outfile.write(' ncbi="%s"' % self.gds_format_integer(self.ncbi, input_name='ncbi'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='organism_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('ncbi', node)
if value is not None and 'ncbi' not in already_processed:
already_processed.add('ncbi')
try:
self.ncbi = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.ncbi <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class organism_type
[docs]class base_natural_source_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('database', 'xs:token', 0),
MemberSpec_('organism', 'organism_type', 0),
MemberSpec_('strain', 'organism_type', 0),
MemberSpec_('synonym_organism', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, extensiontype_=None):
self.original_tagname_ = None
self.database = _cast(None, database)
self.organism = organism
self.strain = strain
self.synonym_organism = synonym_organism
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_natural_source_type.subclass:
return base_natural_source_type.subclass(*args_, **kwargs_)
else:
return base_natural_source_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organism(self): return self.organism
[docs] def set_organism(self, organism): self.organism = organism
[docs] def get_strain(self): return self.strain
[docs] def set_strain(self, strain): self.strain = strain
[docs] def get_synonym_organism(self): return self.synonym_organism
[docs] def set_synonym_organism(self, synonym_organism): self.synonym_organism = synonym_organism
[docs] def get_database(self): return self.database
[docs] def set_database(self, database): self.database = database
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
self.organism is not None or
self.strain is not None or
self.synonym_organism is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_natural_source_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_natural_source_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_natural_source_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_natural_source_type'):
if self.database is not None and 'database' not in already_processed:
already_processed.add('database')
outfile.write(' database=%s' % (self.gds_format_string(quote_attrib(self.database).encode(ExternalEncoding), input_name='database'), ))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_natural_source_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organism is not None:
self.organism.export(outfile, level, namespace_, name_='organism', pretty_print=pretty_print)
if self.strain is not None:
self.strain.export(outfile, level, namespace_, name_='strain', pretty_print=pretty_print)
if self.synonym_organism is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssynonym_organism>%s</%ssynonym_organism>%s' % (namespace_, self.gds_format_string(quote_xml(self.synonym_organism).encode(ExternalEncoding), input_name='synonym_organism'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('database', node)
if value is not None and 'database' not in already_processed:
already_processed.add('database')
self.database = value
self.database = ' '.join(self.database.split())
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organism':
obj_ = organism_type.factory()
obj_.build(child_)
self.organism = obj_
obj_.original_tagname_ = 'organism'
elif nodeName_ == 'strain':
obj_ = organism_type.factory()
obj_.build(child_)
self.strain = obj_
obj_.original_tagname_ = 'strain'
elif nodeName_ == 'synonym_organism':
synonym_organism_ = child_.text
synonym_organism_ = re_.sub(String_cleanup_pat_, " ", synonym_organism_).strip()
synonym_organism_ = self.gds_validate_string(synonym_organism_, node, 'synonym_organism')
self.synonym_organism = synonym_organism_
# end class base_natural_source_type
[docs]class natural_source_type(base_natural_source_type):
member_data_items_ = [
MemberSpec_('organ', 'xs:token', 0),
MemberSpec_('tissue', 'tissue', 0),
MemberSpec_('cell', 'cell', 0),
MemberSpec_('organelle', 'xs:token', 0),
MemberSpec_('cellular_location', 'xs:token', 0),
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, organ=None, tissue=None, cell=None, organelle=None, cellular_location=None):
self.original_tagname_ = None
super(natural_source_type, self).__init__(database, organism, strain, synonym_organism, )
self.organ = organ
self.tissue = tissue
self.cell = cell
self.organelle = organelle
self.cellular_location = cellular_location
[docs] def factory(*args_, **kwargs_):
if natural_source_type.subclass:
return natural_source_type.subclass(*args_, **kwargs_)
else:
return natural_source_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organ(self): return self.organ
[docs] def set_organ(self, organ): self.organ = organ
[docs] def get_tissue(self): return self.tissue
[docs] def set_tissue(self, tissue): self.tissue = tissue
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def get_organelle(self): return self.organelle
[docs] def set_organelle(self, organelle): self.organelle = organelle
[docs] def get_cellular_location(self): return self.cellular_location
[docs] def set_cellular_location(self, cellular_location): self.cellular_location = cellular_location
[docs] def hasContent_(self):
if (
self.organ is not None or
self.tissue is not None or
self.cell is not None or
self.organelle is not None or
self.cellular_location is not None or
super(natural_source_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_source_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_source_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_source_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_source_type'):
super(natural_source_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_source_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_source_type', fromsubclass_=False, pretty_print=True):
super(natural_source_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorgan>%s</%sorgan>%s' % (namespace_, self.gds_format_string(quote_xml(self.organ).encode(ExternalEncoding), input_name='organ'), namespace_, eol_))
if self.tissue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stissue>%s</%stissue>%s' % (namespace_, self.gds_format_string(quote_xml(self.tissue).encode(ExternalEncoding), input_name='tissue'), namespace_, eol_))
if self.cell is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scell>%s</%scell>%s' % (namespace_, self.gds_format_string(quote_xml(self.cell).encode(ExternalEncoding), input_name='cell'), namespace_, eol_))
if self.organelle is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorganelle>%s</%sorganelle>%s' % (namespace_, self.gds_format_string(quote_xml(self.organelle).encode(ExternalEncoding), input_name='organelle'), namespace_, eol_))
if self.cellular_location is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scellular_location>%s</%scellular_location>%s' % (namespace_, self.gds_format_string(quote_xml(self.cellular_location).encode(ExternalEncoding), input_name='cellular_location'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_source_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organ':
organ_ = child_.text
organ_ = re_.sub(String_cleanup_pat_, " ", organ_).strip()
organ_ = self.gds_validate_string(organ_, node, 'organ')
self.organ = organ_
elif nodeName_ == 'tissue':
tissue_ = child_.text
tissue_ = re_.sub(String_cleanup_pat_, " ", tissue_).strip()
tissue_ = self.gds_validate_string(tissue_, node, 'tissue')
self.tissue = tissue_
elif nodeName_ == 'cell':
cell_ = child_.text
cell_ = re_.sub(String_cleanup_pat_, " ", cell_).strip()
cell_ = self.gds_validate_string(cell_, node, 'cell')
self.cell = cell_
elif nodeName_ == 'organelle':
organelle_ = child_.text
organelle_ = re_.sub(String_cleanup_pat_, " ", organelle_).strip()
organelle_ = self.gds_validate_string(organelle_, node, 'organelle')
self.organelle = organelle_
elif nodeName_ == 'cellular_location':
cellular_location_ = child_.text
cellular_location_ = re_.sub(String_cleanup_pat_, " ", cellular_location_).strip()
cellular_location_ = self.gds_validate_string(cellular_location_, node, 'cellular_location')
self.cellular_location = cellular_location_
super(natural_source_type, self).buildChildren(child_, node, nodeName_, True)
# end class natural_source_type
[docs]class model_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('access_code', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain', 'chainType53', 1),
]
subclass = None
superclass = None
def __init__(self, access_code=None, chain=None):
self.original_tagname_ = None
self.access_code = access_code
self.validate_pdb_code_type(self.access_code)
if chain is None:
self.chain = []
else:
self.chain = chain
[docs] def factory(*args_, **kwargs_):
if model_type.subclass:
return model_type.subclass(*args_, **kwargs_)
else:
return model_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_access_code(self): return self.access_code
[docs] def set_access_code(self, access_code): self.access_code = access_code
[docs] def get_chain(self): return self.chain
[docs] def set_chain(self, chain): self.chain = chain
[docs] def add_chain(self, value): self.chain.append(value)
[docs] def insert_chain_at(self, index, value): self.chain.insert(index, value)
[docs] def replace_chain_at(self, index, value): self.chain[index] = value
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.access_code is not None or
self.chain
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='model_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='model_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='model_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='model_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='model_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.access_code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saccess_code>%s</%saccess_code>%s' % (namespace_, self.gds_format_string(quote_xml(self.access_code).encode(ExternalEncoding), input_name='access_code'), namespace_, eol_))
for chain_ in self.chain:
chain_.export(outfile, level, namespace_, name_='chain', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'access_code':
access_code_ = child_.text
access_code_ = re_.sub(String_cleanup_pat_, " ", access_code_).strip()
access_code_ = self.gds_validate_string(access_code_, node, 'access_code')
self.access_code = access_code_
# validate type pdb_code_type
self.validate_pdb_code_type(self.access_code)
elif nodeName_ == 'chain':
obj_ = chainType53.factory()
obj_.build(child_)
self.chain.append(obj_)
obj_.original_tagname_ = 'chain'
# end class model_type
[docs]class chain_model_type(chain_type):
member_data_items_ = [
]
subclass = None
superclass = chain_type
def __init__(self, id=None, residue_range=None, extensiontype_=None):
self.original_tagname_ = None
super(chain_model_type, self).__init__(id, residue_range, extensiontype_, )
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if chain_model_type.subclass:
return chain_model_type.subclass(*args_, **kwargs_)
else:
return chain_model_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self):
if (
super(chain_model_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chain_model_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chain_model_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='chain_model_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chain_model_type'):
super(chain_model_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='chain_model_type')
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chain_model_type', fromsubclass_=False, pretty_print=True):
super(chain_model_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
super(chain_model_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
super(chain_model_type, self).buildChildren(child_, node, nodeName_, True)
pass
# end class chain_model_type
[docs]class helical_parameters_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('delta_z', 'delta_zType', 0),
MemberSpec_('delta_phi', 'delta_phiType', 0),
MemberSpec_('axial_symmetry', ['axial_symmetryType', 'xs:token'], 0),
MemberSpec_('hand', ['handType', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, delta_z=None, delta_phi=None, axial_symmetry=None, hand=None):
self.original_tagname_ = None
self.delta_z = delta_z
self.delta_phi = delta_phi
self.axial_symmetry = axial_symmetry
self.validate_axial_symmetryType(self.axial_symmetry)
self.hand = hand
self.validate_handType(self.hand)
[docs] def factory(*args_, **kwargs_):
if helical_parameters_type.subclass:
return helical_parameters_type.subclass(*args_, **kwargs_)
else:
return helical_parameters_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_delta_z(self): return self.delta_z
[docs] def set_delta_z(self, delta_z): self.delta_z = delta_z
[docs] def get_delta_phi(self): return self.delta_phi
[docs] def set_delta_phi(self, delta_phi): self.delta_phi = delta_phi
[docs] def get_axial_symmetry(self): return self.axial_symmetry
[docs] def set_axial_symmetry(self, axial_symmetry): self.axial_symmetry = axial_symmetry
[docs] def get_hand(self): return self.hand
[docs] def set_hand(self, hand): self.hand = hand
[docs] def validate_axial_symmetryType(self, value):
# Validate type axial_symmetryType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_axial_symmetryType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_axial_symmetryType_patterns_, ))
validate_axial_symmetryType_patterns_ = [['^[C|D][1-9][0-9]*$']]
[docs] def validate_handType(self, value):
# Validate type handType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['LEFT HANDED', 'RIGHT HANDED']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on handType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.delta_z is not None or
self.delta_phi is not None or
self.axial_symmetry is not None or
self.hand is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='helical_parameters_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='helical_parameters_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='helical_parameters_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='helical_parameters_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='helical_parameters_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.delta_z is not None:
self.delta_z.export(outfile, level, namespace_, name_='delta_z', pretty_print=pretty_print)
if self.delta_phi is not None:
self.delta_phi.export(outfile, level, namespace_, name_='delta_phi', pretty_print=pretty_print)
if self.axial_symmetry is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saxial_symmetry>%s</%saxial_symmetry>%s' % (namespace_, self.gds_format_string(quote_xml(self.axial_symmetry).encode(ExternalEncoding), input_name='axial_symmetry'), namespace_, eol_))
if self.hand is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%shand>%s</%shand>%s' % (namespace_, self.gds_format_string(quote_xml(self.hand).encode(ExternalEncoding), input_name='hand'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'delta_z':
obj_ = delta_zType.factory()
obj_.build(child_)
self.delta_z = obj_
obj_.original_tagname_ = 'delta_z'
elif nodeName_ == 'delta_phi':
obj_ = delta_phiType.factory()
obj_.build(child_)
self.delta_phi = obj_
obj_.original_tagname_ = 'delta_phi'
elif nodeName_ == 'axial_symmetry':
axial_symmetry_ = child_.text
axial_symmetry_ = re_.sub(String_cleanup_pat_, " ", axial_symmetry_).strip()
axial_symmetry_ = self.gds_validate_string(axial_symmetry_, node, 'axial_symmetry')
self.axial_symmetry = axial_symmetry_
# validate type axial_symmetryType
self.validate_axial_symmetryType(self.axial_symmetry)
elif nodeName_ == 'hand':
hand_ = child_.text
hand_ = re_.sub(String_cleanup_pat_, " ", hand_).strip()
hand_ = self.gds_validate_string(hand_, node, 'hand')
self.hand = hand_
# validate type handType
self.validate_handType(self.hand)
# end class helical_parameters_type
[docs]class sci_name_type(GeneratedsSuper):
"""Deprecated (2014/11/12)"""
member_data_items_ = [
MemberSpec_('synonym', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, synonym=None, valueOf_=None):
self.original_tagname_ = None
self.synonym = _cast(None, synonym)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if sci_name_type.subclass:
return sci_name_type.subclass(*args_, **kwargs_)
else:
return sci_name_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_synonym(self): return self.synonym
[docs] def set_synonym(self, synonym): self.synonym = synonym
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sci_name_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sci_name_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='sci_name_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sci_name_type'):
if self.synonym is not None and 'synonym' not in already_processed:
already_processed.add('synonym')
outfile.write(' synonym=%s' % (self.gds_format_string(quote_attrib(self.synonym).encode(ExternalEncoding), input_name='synonym'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sci_name_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('synonym', node)
if value is not None and 'synonym' not in already_processed:
already_processed.add('synonym')
self.synonym = value
self.synonym = ' '.join(self.synonym.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class sci_name_type
[docs]class molecular_weight_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('experimental', 'experimentalType', 0),
MemberSpec_('theoretical', 'theoreticalType', 0),
MemberSpec_('method', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, experimental=None, theoretical=None, method=None):
self.original_tagname_ = None
self.experimental = experimental
self.theoretical = theoretical
self.method = method
[docs] def factory(*args_, **kwargs_):
if molecular_weight_type.subclass:
return molecular_weight_type.subclass(*args_, **kwargs_)
else:
return molecular_weight_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_experimental(self): return self.experimental
[docs] def set_experimental(self, experimental): self.experimental = experimental
[docs] def get_theoretical(self): return self.theoretical
[docs] def set_theoretical(self, theoretical): self.theoretical = theoretical
[docs] def get_method(self): return self.method
[docs] def set_method(self, method): self.method = method
[docs] def hasContent_(self):
if (
self.experimental is not None or
self.theoretical is not None or
self.method is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='molecular_weight_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='molecular_weight_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='molecular_weight_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='molecular_weight_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='molecular_weight_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.experimental is not None:
self.experimental.export(outfile, level, namespace_, name_='experimental', pretty_print=pretty_print)
if self.theoretical is not None:
self.theoretical.export(outfile, level, namespace_, name_='theoretical', pretty_print=pretty_print)
if self.method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smethod>%s</%smethod>%s' % (namespace_, self.gds_format_string(quote_xml(self.method).encode(ExternalEncoding), input_name='method'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'experimental':
obj_ = experimentalType.factory()
obj_.build(child_)
self.experimental = obj_
obj_.original_tagname_ = 'experimental'
elif nodeName_ == 'theoretical':
obj_ = theoreticalType.factory()
obj_.build(child_)
self.theoretical = obj_
obj_.original_tagname_ = 'theoretical'
elif nodeName_ == 'method':
method_ = child_.text
method_ = re_.sub(String_cleanup_pat_, " ", method_).strip()
method_ = self.gds_validate_string(method_, node, 'method')
self.method = method_
# end class molecular_weight_type
[docs]class virus_species_name_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('ncbi', 'xs:positiveInteger', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, ncbi=None, valueOf_=None):
self.original_tagname_ = None
self.ncbi = _cast(int, ncbi)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if virus_species_name_type.subclass:
return virus_species_name_type.subclass(*args_, **kwargs_)
else:
return virus_species_name_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ncbi(self): return self.ncbi
[docs] def set_ncbi(self, ncbi): self.ncbi = ncbi
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='virus_species_name_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='virus_species_name_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='virus_species_name_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='virus_species_name_type'):
if self.ncbi is not None and 'ncbi' not in already_processed:
already_processed.add('ncbi')
outfile.write(' ncbi="%s"' % self.gds_format_integer(self.ncbi, input_name='ncbi'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='virus_species_name_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('ncbi', node)
if value is not None and 'ncbi' not in already_processed:
already_processed.add('ncbi')
try:
self.ncbi = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.ncbi <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class virus_species_name_type
[docs]class base_macromolecule_type(GeneratedsSuper):
"""Autogenerated unique identifier."""
member_data_items_ = [
MemberSpec_('mutant', 'xs:boolean', 0),
MemberSpec_('chimera', 'xs:boolean', 0),
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('name', 'sci_name_type', 0),
MemberSpec_('natural_source', 'natural_source_type', 0),
MemberSpec_('molecular_weight', 'molecular_weight_type', 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('number_of_copies', 'pos_int_or_string_type', 0),
MemberSpec_('oligomeric_state', 'pos_int_or_string_type', 0),
MemberSpec_('recombinant_exp_flag', 'xs:boolean', 0),
]
subclass = None
superclass = None
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, extensiontype_=None):
self.original_tagname_ = None
self.mutant = _cast(bool, mutant)
self.chimera = _cast(bool, chimera)
self.id = _cast(int, id)
self.name = name
self.natural_source = natural_source
self.molecular_weight = molecular_weight
self.details = details
self.number_of_copies = number_of_copies
self.validate_pos_int_or_string_type(self.number_of_copies)
self.oligomeric_state = oligomeric_state
self.validate_pos_int_or_string_type(self.oligomeric_state)
self.recombinant_exp_flag = recombinant_exp_flag
self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_):
if base_macromolecule_type.subclass:
return base_macromolecule_type.subclass(*args_, **kwargs_)
else:
return base_macromolecule_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_number_of_copies(self): return self.number_of_copies
[docs] def set_number_of_copies(self, number_of_copies): self.number_of_copies = number_of_copies
[docs] def get_oligomeric_state(self): return self.oligomeric_state
[docs] def set_oligomeric_state(self, oligomeric_state): self.oligomeric_state = oligomeric_state
[docs] def get_recombinant_exp_flag(self): return self.recombinant_exp_flag
[docs] def set_recombinant_exp_flag(self, recombinant_exp_flag): self.recombinant_exp_flag = recombinant_exp_flag
[docs] def get_mutant(self): return self.mutant
[docs] def set_mutant(self, mutant): self.mutant = mutant
[docs] def get_chimera(self): return self.chimera
[docs] def set_chimera(self, chimera): self.chimera = chimera
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_pos_int_or_string_type(self, value):
# Validate type pos_int_or_string_type, a restriction on None.
pass
[docs] def hasContent_(self):
if (
self.name is not None or
self.natural_source is not None or
self.molecular_weight is not None or
self.details is not None or
self.number_of_copies is not None or
self.oligomeric_state is not None or
self.recombinant_exp_flag is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='base_macromolecule_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='base_macromolecule_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='base_macromolecule_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='base_macromolecule_type'):
if self.mutant is not None and 'mutant' not in already_processed:
already_processed.add('mutant')
outfile.write(' mutant="%s"' % self.gds_format_boolean(self.mutant, input_name='mutant'))
if self.chimera is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
outfile.write(' chimera="%s"' % self.gds_format_boolean(self.chimera, input_name='chimera'))
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='base_macromolecule_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.number_of_copies is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_of_copies>%s</%snumber_of_copies>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_of_copies).encode(ExternalEncoding), input_name='number_of_copies'), namespace_, eol_))
if self.oligomeric_state is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soligomeric_state>%s</%soligomeric_state>%s' % (namespace_, self.gds_format_string(quote_xml(self.oligomeric_state).encode(ExternalEncoding), input_name='oligomeric_state'), namespace_, eol_))
if self.recombinant_exp_flag is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srecombinant_exp_flag>%s</%srecombinant_exp_flag>%s' % (namespace_, self.gds_format_boolean(self.recombinant_exp_flag, input_name='recombinant_exp_flag'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('mutant', node)
if value is not None and 'mutant' not in already_processed:
already_processed.add('mutant')
if value in ('true', '1'):
self.mutant = True
elif value in ('false', '0'):
self.mutant = False
else:
raise_parse_error(node, 'Bad boolean attribute')
value = find_attr_value_('chimera', node)
if value is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
if value in ('true', '1'):
self.chimera = True
elif value in ('false', '0'):
self.chimera = False
else:
raise_parse_error(node, 'Bad boolean attribute')
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
value = find_attr_value_('xsi:type', node)
if value is not None and 'xsi:type' not in already_processed:
already_processed.add('xsi:type')
self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
obj_ = sci_name_type.factory()
obj_.build(child_)
self.name = obj_
obj_.original_tagname_ = 'name'
elif nodeName_ == 'natural_source':
obj_ = natural_source_type.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weight_type.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'number_of_copies':
number_of_copies_ = child_.text
number_of_copies_ = self.gds_validate_string(number_of_copies_, node, 'number_of_copies')
self.number_of_copies = number_of_copies_
# validate type pos_int_or_string_type
self.validate_pos_int_or_string_type(self.number_of_copies)
elif nodeName_ == 'oligomeric_state':
oligomeric_state_ = child_.text
oligomeric_state_ = self.gds_validate_string(oligomeric_state_, node, 'oligomeric_state')
self.oligomeric_state = oligomeric_state_
# validate type pos_int_or_string_type
self.validate_pos_int_or_string_type(self.oligomeric_state)
elif nodeName_ == 'recombinant_exp_flag':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'recombinant_exp_flag')
self.recombinant_exp_flag = ival_
# end class base_macromolecule_type
[docs]class protein_or_peptide(base_macromolecule_type):
member_data_items_ = [
MemberSpec_('recombinant_expression', 'recombinant_source_type', 0),
MemberSpec_('enantiomer', ['enantiomerType', 'xs:token'], 0),
MemberSpec_('sequence', 'sequenceType', 0),
MemberSpec_('ec_number', ['ec_numberType', 'xs:token'], 1),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, recombinant_expression=None, enantiomer=None, sequence=None, ec_number=None):
self.original_tagname_ = None
super(protein_or_peptide, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.recombinant_expression = recombinant_expression
self.enantiomer = enantiomer
self.validate_enantiomerType(self.enantiomer)
self.sequence = sequence
if ec_number is None:
self.ec_number = []
else:
self.ec_number = ec_number
[docs] def factory(*args_, **kwargs_):
if protein_or_peptide.subclass:
return protein_or_peptide.subclass(*args_, **kwargs_)
else:
return protein_or_peptide(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
[docs] def get_enantiomer(self): return self.enantiomer
[docs] def set_enantiomer(self, enantiomer): self.enantiomer = enantiomer
[docs] def get_sequence(self): return self.sequence
[docs] def set_sequence(self, sequence): self.sequence = sequence
[docs] def get_ec_number(self): return self.ec_number
[docs] def set_ec_number(self, ec_number): self.ec_number = ec_number
[docs] def add_ec_number(self, value): self.ec_number.append(value)
[docs] def insert_ec_number_at(self, index, value): self.ec_number.insert(index, value)
[docs] def replace_ec_number_at(self, index, value): self.ec_number[index] = value
[docs] def validate_enantiomerType(self, value):
# Validate type enantiomerType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['LEVO', 'DEXTRO']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on enantiomerType' % {"value" : value.encode("utf-8")} )
[docs] def validate_ec_numberType(self, value):
# Validate type ec_numberType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_ec_numberType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ec_numberType_patterns_, ))
validate_ec_numberType_patterns_ = [['^EC \\d+(\\.\\d+){3}$']]
[docs] def hasContent_(self):
if (
self.recombinant_expression is not None or
self.enantiomer is not None or
self.sequence is not None or
self.ec_number or
super(protein_or_peptide, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='protein_or_peptide', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='protein_or_peptide')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='protein_or_peptide', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='protein_or_peptide'):
super(protein_or_peptide, self).exportAttributes(outfile, level, already_processed, namespace_, name_='protein_or_peptide')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='protein_or_peptide', fromsubclass_=False, pretty_print=True):
super(protein_or_peptide, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.recombinant_expression is not None:
self.recombinant_expression.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
if self.enantiomer is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%senantiomer>%s</%senantiomer>%s' % (namespace_, self.gds_format_string(quote_xml(self.enantiomer).encode(ExternalEncoding), input_name='enantiomer'), namespace_, eol_))
if self.sequence is not None:
self.sequence.export(outfile, level, namespace_, name_='sequence', pretty_print=pretty_print)
for ec_number_ in self.ec_number:
showIndent(outfile, level, pretty_print)
outfile.write('<%sec_number>%s</%sec_number>%s' % (namespace_, self.gds_format_string(quote_xml(ec_number_).encode(ExternalEncoding), input_name='ec_number'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(protein_or_peptide, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression = obj_
obj_.original_tagname_ = 'recombinant_expression'
elif nodeName_ == 'enantiomer':
enantiomer_ = child_.text
enantiomer_ = re_.sub(String_cleanup_pat_, " ", enantiomer_).strip()
enantiomer_ = self.gds_validate_string(enantiomer_, node, 'enantiomer')
self.enantiomer = enantiomer_
# validate type enantiomerType
self.validate_enantiomerType(self.enantiomer)
elif nodeName_ == 'sequence':
obj_ = sequenceType.factory()
obj_.build(child_)
self.sequence = obj_
obj_.original_tagname_ = 'sequence'
elif nodeName_ == 'ec_number':
ec_number_ = child_.text
ec_number_ = re_.sub(String_cleanup_pat_, " ", ec_number_).strip()
ec_number_ = self.gds_validate_string(ec_number_, node, 'ec_number')
self.ec_number.append(ec_number_)
# validate type ec_numberType
self.validate_ec_numberType(self.ec_number[-1])
super(protein_or_peptide, self).buildChildren(child_, node, nodeName_, True)
# end class protein_or_peptide
[docs]class dna(base_macromolecule_type):
"""Is naturalExpression and recombinantExpression suitable for this
component?"""
member_data_items_ = [
MemberSpec_('sequence', 'sequenceType55', 0),
MemberSpec_('classification', ['classificationType', 'xs:token'], 0),
MemberSpec_('structure', 'xs:token', 0),
MemberSpec_('synthetic_flag', 'xs:boolean', 0),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, sequence=None, classification=None, structure=None, synthetic_flag=None):
self.original_tagname_ = None
super(dna, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.sequence = sequence
self.classification = classification
self.validate_classificationType(self.classification)
self.structure = structure
self.synthetic_flag = synthetic_flag
[docs] def factory(*args_, **kwargs_):
if dna.subclass:
return dna.subclass(*args_, **kwargs_)
else:
return dna(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_sequence(self): return self.sequence
[docs] def set_sequence(self, sequence): self.sequence = sequence
[docs] def get_classification(self): return self.classification
[docs] def set_classification(self, classification): self.classification = classification
[docs] def get_structure(self): return self.structure
[docs] def set_structure(self, structure): self.structure = structure
[docs] def get_synthetic_flag(self): return self.synthetic_flag
[docs] def set_synthetic_flag(self, synthetic_flag): self.synthetic_flag = synthetic_flag
[docs] def validate_classificationType(self, value):
# Validate type classificationType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['DNA']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on classificationType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.sequence is not None or
self.classification is not None or
self.structure is not None or
self.synthetic_flag is not None or
super(dna, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='dna', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='dna')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='dna', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='dna'):
super(dna, self).exportAttributes(outfile, level, already_processed, namespace_, name_='dna')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='dna', fromsubclass_=False, pretty_print=True):
super(dna, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.sequence is not None:
self.sequence.export(outfile, level, namespace_, name_='sequence', pretty_print=pretty_print)
if self.classification is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sclassification>%s</%sclassification>%s' % (namespace_, self.gds_format_string(quote_xml(self.classification).encode(ExternalEncoding), input_name='classification'), namespace_, eol_))
if self.structure is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstructure>%s</%sstructure>%s' % (namespace_, self.gds_format_string(quote_xml(self.structure).encode(ExternalEncoding), input_name='structure'), namespace_, eol_))
if self.synthetic_flag is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssynthetic_flag>%s</%ssynthetic_flag>%s' % (namespace_, self.gds_format_boolean(self.synthetic_flag, input_name='synthetic_flag'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(dna, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'sequence':
obj_ = sequenceType55.factory()
obj_.build(child_)
self.sequence = obj_
obj_.original_tagname_ = 'sequence'
elif nodeName_ == 'classification':
classification_ = child_.text
classification_ = re_.sub(String_cleanup_pat_, " ", classification_).strip()
classification_ = self.gds_validate_string(classification_, node, 'classification')
self.classification = classification_
# validate type classificationType
self.validate_classificationType(self.classification)
elif nodeName_ == 'structure':
structure_ = child_.text
structure_ = re_.sub(String_cleanup_pat_, " ", structure_).strip()
structure_ = self.gds_validate_string(structure_, node, 'structure')
self.structure = structure_
elif nodeName_ == 'synthetic_flag':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'synthetic_flag')
self.synthetic_flag = ival_
super(dna, self).buildChildren(child_, node, nodeName_, True)
# end class dna
[docs]class rna(base_macromolecule_type):
"""Is naturalExpression and recombinantExpression suitable for this
component?"""
member_data_items_ = [
MemberSpec_('sequence', 'sequenceType60', 0),
MemberSpec_('classification', ['classificationType65', 'xs:token'], 0),
MemberSpec_('structure', 'xs:token', 0),
MemberSpec_('synthetic_flag', 'xs:boolean', 0),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, sequence=None, classification=None, structure=None, synthetic_flag=None):
self.original_tagname_ = None
super(rna, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.sequence = sequence
self.classification = classification
self.validate_classificationType65(self.classification)
self.structure = structure
self.synthetic_flag = synthetic_flag
[docs] def factory(*args_, **kwargs_):
if rna.subclass:
return rna.subclass(*args_, **kwargs_)
else:
return rna(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_sequence(self): return self.sequence
[docs] def set_sequence(self, sequence): self.sequence = sequence
[docs] def get_classification(self): return self.classification
[docs] def set_classification(self, classification): self.classification = classification
[docs] def get_structure(self): return self.structure
[docs] def set_structure(self, structure): self.structure = structure
[docs] def get_synthetic_flag(self): return self.synthetic_flag
[docs] def set_synthetic_flag(self, synthetic_flag): self.synthetic_flag = synthetic_flag
[docs] def validate_classificationType65(self, value):
# Validate type classificationType65, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['MESSENGER', 'TRANSFER', 'RIBOSOMAL', 'NON-CODING', 'INTERFERENCE', 'SMALL INTERFERENCE', 'GENOMIC', 'PRE-MESSENGER', 'SMALL NUCLEOLAR', 'TRANSFER-MESSENGER', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on classificationType65' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.sequence is not None or
self.classification is not None or
self.structure is not None or
self.synthetic_flag is not None or
super(rna, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='rna', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='rna')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='rna', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='rna'):
super(rna, self).exportAttributes(outfile, level, already_processed, namespace_, name_='rna')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='rna', fromsubclass_=False, pretty_print=True):
super(rna, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.sequence is not None:
self.sequence.export(outfile, level, namespace_, name_='sequence', pretty_print=pretty_print)
if self.classification is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sclassification>%s</%sclassification>%s' % (namespace_, self.gds_format_string(quote_xml(self.classification).encode(ExternalEncoding), input_name='classification'), namespace_, eol_))
if self.structure is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstructure>%s</%sstructure>%s' % (namespace_, self.gds_format_string(quote_xml(self.structure).encode(ExternalEncoding), input_name='structure'), namespace_, eol_))
if self.synthetic_flag is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssynthetic_flag>%s</%ssynthetic_flag>%s' % (namespace_, self.gds_format_boolean(self.synthetic_flag, input_name='synthetic_flag'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(rna, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'sequence':
obj_ = sequenceType60.factory()
obj_.build(child_)
self.sequence = obj_
obj_.original_tagname_ = 'sequence'
elif nodeName_ == 'classification':
classification_ = child_.text
classification_ = re_.sub(String_cleanup_pat_, " ", classification_).strip()
classification_ = self.gds_validate_string(classification_, node, 'classification')
self.classification = classification_
# validate type classificationType65
self.validate_classificationType65(self.classification)
elif nodeName_ == 'structure':
structure_ = child_.text
structure_ = re_.sub(String_cleanup_pat_, " ", structure_).strip()
structure_ = self.gds_validate_string(structure_, node, 'structure')
self.structure = structure_
elif nodeName_ == 'synthetic_flag':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'synthetic_flag')
self.synthetic_flag = ival_
super(rna, self).buildChildren(child_, node, nodeName_, True)
# end class rna
[docs]class saccharide(base_macromolecule_type):
"""Is naturalExpression and recombinantExpression suitable for this
component?"""
member_data_items_ = [
MemberSpec_('enantiomer', ['enantiomerType66', 'xs:token'], 0),
MemberSpec_('formula', ['formulaType67', 'xs:token'], 0),
MemberSpec_('external_references', 'external_referencesType68', 1),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, enantiomer=None, formula=None, external_references=None):
self.original_tagname_ = None
super(saccharide, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.enantiomer = enantiomer
self.validate_enantiomerType66(self.enantiomer)
self.formula = formula
self.validate_formulaType67(self.formula)
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if saccharide.subclass:
return saccharide.subclass(*args_, **kwargs_)
else:
return saccharide(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_enantiomer(self): return self.enantiomer
[docs] def set_enantiomer(self, enantiomer): self.enantiomer = enantiomer
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def validate_enantiomerType66(self, value):
# Validate type enantiomerType66, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['LEVO', 'DEXTRO']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on enantiomerType66' % {"value" : value.encode("utf-8")} )
validate_formulaType67_patterns_ = [['^([\\[\\]\\(\\)]*[A-Z][a-z]?[\\+\\-\\d/\\[\\]\\(\\)]*)+$']]
[docs] def hasContent_(self):
if (
self.enantiomer is not None or
self.formula is not None or
self.external_references or
super(saccharide, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='saccharide', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='saccharide')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='saccharide', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='saccharide'):
super(saccharide, self).exportAttributes(outfile, level, already_processed, namespace_, name_='saccharide')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='saccharide', fromsubclass_=False, pretty_print=True):
super(saccharide, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.enantiomer is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%senantiomer>%s</%senantiomer>%s' % (namespace_, self.gds_format_string(quote_xml(self.enantiomer).encode(ExternalEncoding), input_name='enantiomer'), namespace_, eol_))
if self.formula is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sformula>%s</%sformula>%s' % (namespace_, self.gds_format_string(quote_xml(self.formula).encode(ExternalEncoding), input_name='formula'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(saccharide, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'enantiomer':
enantiomer_ = child_.text
enantiomer_ = re_.sub(String_cleanup_pat_, " ", enantiomer_).strip()
enantiomer_ = self.gds_validate_string(enantiomer_, node, 'enantiomer')
self.enantiomer = enantiomer_
# validate type enantiomerType66
self.validate_enantiomerType66(self.enantiomer)
elif nodeName_ == 'formula':
formula_ = child_.text
formula_ = re_.sub(String_cleanup_pat_, " ", formula_).strip()
formula_ = self.gds_validate_string(formula_, node, 'formula')
self.formula = formula_
# validate type formulaType67
self.validate_formulaType67(self.formula)
elif nodeName_ == 'external_references':
obj_ = external_referencesType68.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
super(saccharide, self).buildChildren(child_, node, nodeName_, True)
# end class saccharide
[docs]class lipid(base_macromolecule_type):
"""Is naturalExpression and recombinantExpression suitable for this
component?"""
member_data_items_ = [
MemberSpec_('formula', ['formulaType69', 'xs:token'], 0),
MemberSpec_('external_references', 'external_referencesType70', 1),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, formula=None, external_references=None):
self.original_tagname_ = None
super(lipid, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.formula = formula
self.validate_formulaType69(self.formula)
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if lipid.subclass:
return lipid.subclass(*args_, **kwargs_)
else:
return lipid(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
validate_formulaType69_patterns_ = [['^([\\[\\]\\(\\)]*[A-Z][a-z]?[\\+\\-\\d/\\[\\]\\(\\)]*)+$']]
[docs] def hasContent_(self):
if (
self.formula is not None or
self.external_references or
super(lipid, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='lipid', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='lipid')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='lipid', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='lipid'):
super(lipid, self).exportAttributes(outfile, level, already_processed, namespace_, name_='lipid')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='lipid', fromsubclass_=False, pretty_print=True):
super(lipid, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.formula is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sformula>%s</%sformula>%s' % (namespace_, self.gds_format_string(quote_xml(self.formula).encode(ExternalEncoding), input_name='formula'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(lipid, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'formula':
formula_ = child_.text
formula_ = re_.sub(String_cleanup_pat_, " ", formula_).strip()
formula_ = self.gds_validate_string(formula_, node, 'formula')
self.formula = formula_
# validate type formulaType69
self.validate_formulaType69(self.formula)
elif nodeName_ == 'external_references':
obj_ = external_referencesType70.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
super(lipid, self).buildChildren(child_, node, nodeName_, True)
# end class lipid
[docs]class ligand(base_macromolecule_type):
"""Is naturalExpression and recombinantExpression suitable for this
component?"""
member_data_items_ = [
MemberSpec_('formula', ['formulaType71', 'xs:token'], 0),
MemberSpec_('external_references', 'external_referencesType72', 1),
MemberSpec_('natural_source', 'natural_source_type', 0),
MemberSpec_('recombinant_expression', 'recombinant_source_type', 0),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, formula=None, external_references=None, recombinant_expression=None):
self.original_tagname_ = None
super(ligand, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.formula = formula
self.validate_formulaType71(self.formula)
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
self.natural_source = natural_source
self.recombinant_expression = recombinant_expression
[docs] def factory(*args_, **kwargs_):
if ligand.subclass:
return ligand.subclass(*args_, **kwargs_)
else:
return ligand(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
validate_formulaType71_patterns_ = [['^([\\[\\]\\(\\)]*[A-Z][a-z]?[\\+\\-\\d/\\[\\]\\(\\)]*)+$']]
[docs] def hasContent_(self):
if (
self.formula is not None or
self.external_references or
self.natural_source is not None or
self.recombinant_expression is not None or
super(ligand, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='ligand', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='ligand')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='ligand', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ligand'):
super(ligand, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ligand')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ligand', fromsubclass_=False, pretty_print=True):
super(ligand, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.formula is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sformula>%s</%sformula>%s' % (namespace_, self.gds_format_string(quote_xml(self.formula).encode(ExternalEncoding), input_name='formula'), namespace_, eol_))
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
if self.recombinant_expression is not None:
self.recombinant_expression.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(ligand, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'formula':
formula_ = child_.text
formula_ = re_.sub(String_cleanup_pat_, " ", formula_).strip()
formula_ = self.gds_validate_string(formula_, node, 'formula')
self.formula = formula_
# validate type formulaType71
self.validate_formulaType71(self.formula)
elif nodeName_ == 'external_references':
obj_ = external_referencesType72.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
elif nodeName_ == 'natural_source':
obj_ = natural_source_type.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression = obj_
obj_.original_tagname_ = 'recombinant_expression'
super(ligand, self).buildChildren(child_, node, nodeName_, True)
# end class ligand
[docs]class em_label(base_macromolecule_type):
member_data_items_ = [
MemberSpec_('formula', ['formulaType73', 'xs:token'], 0),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, formula=None):
self.original_tagname_ = None
super(em_label, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.formula = formula
self.validate_formulaType73(self.formula)
[docs] def factory(*args_, **kwargs_):
if em_label.subclass:
return em_label.subclass(*args_, **kwargs_)
else:
return em_label(*args_, **kwargs_)
factory = staticmethod(factory)
validate_formulaType73_patterns_ = [['^([\\[\\]\\(\\)]*[A-Z][a-z]?[\\+\\-\\d/\\[\\]\\(\\)]*)+$']]
[docs] def hasContent_(self):
if (
self.formula is not None or
super(em_label, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='em_label', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='em_label')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='em_label', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='em_label'):
super(em_label, self).exportAttributes(outfile, level, already_processed, namespace_, name_='em_label')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='em_label', fromsubclass_=False, pretty_print=True):
super(em_label, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.formula is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sformula>%s</%sformula>%s' % (namespace_, self.gds_format_string(quote_xml(self.formula).encode(ExternalEncoding), input_name='formula'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(em_label, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'formula':
formula_ = child_.text
formula_ = re_.sub(String_cleanup_pat_, " ", formula_).strip()
formula_ = self.gds_validate_string(formula_, node, 'formula')
self.formula = formula_
# validate type formulaType73
self.validate_formulaType73(self.formula)
super(em_label, self).buildChildren(child_, node, nodeName_, True)
# end class em_label
[docs]class map_statistics_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('minimum', 'xs:float', 0),
MemberSpec_('maximum', 'xs:float', 0),
MemberSpec_('average', 'xs:float', 0),
MemberSpec_('std', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, minimum=None, maximum=None, average=None, std=None):
self.original_tagname_ = None
self.minimum = minimum
self.maximum = maximum
self.average = average
self.std = std
[docs] def factory(*args_, **kwargs_):
if map_statistics_type.subclass:
return map_statistics_type.subclass(*args_, **kwargs_)
else:
return map_statistics_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_minimum(self): return self.minimum
[docs] def set_minimum(self, minimum): self.minimum = minimum
[docs] def get_maximum(self): return self.maximum
[docs] def set_maximum(self, maximum): self.maximum = maximum
[docs] def get_average(self): return self.average
[docs] def set_average(self, average): self.average = average
[docs] def get_std(self): return self.std
[docs] def set_std(self, std): self.std = std
[docs] def hasContent_(self):
if (
self.minimum is not None or
self.maximum is not None or
self.average is not None or
self.std is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='map_statistics_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='map_statistics_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='map_statistics_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='map_statistics_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='map_statistics_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.minimum is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sminimum>%s</%sminimum>%s' % (namespace_, self.gds_format_float(self.minimum, input_name='minimum'), namespace_, eol_))
if self.maximum is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smaximum>%s</%smaximum>%s' % (namespace_, self.gds_format_float(self.maximum, input_name='maximum'), namespace_, eol_))
if self.average is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saverage>%s</%saverage>%s' % (namespace_, self.gds_format_float(self.average, input_name='average'), namespace_, eol_))
if self.std is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstd>%s</%sstd>%s' % (namespace_, self.gds_format_float(self.std, input_name='std'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'minimum':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'minimum')
self.minimum = fval_
elif nodeName_ == 'maximum':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'maximum')
self.maximum = fval_
elif nodeName_ == 'average':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'average')
self.average = fval_
elif nodeName_ == 'std':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'std')
self.std = fval_
# end class map_statistics_type
[docs]class pixel_spacing_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_pixel_sampling', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if pixel_spacing_type.subclass:
return pixel_spacing_type.subclass(*args_, **kwargs_)
else:
return pixel_spacing_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pixel_spacing_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pixel_spacing_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='pixel_spacing_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pixel_spacing_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pixel_spacing_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class pixel_spacing_type
[docs]class fiducial_marker_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('fiducial_type', 'xs:token', 0),
MemberSpec_('manufacturer', 'xs:token', 0),
MemberSpec_('diameter', 'diameterType74', 0),
]
subclass = None
superclass = None
def __init__(self, fiducial_type=None, manufacturer=None, diameter=None):
self.original_tagname_ = None
self.fiducial_type = fiducial_type
self.manufacturer = manufacturer
self.diameter = diameter
[docs] def factory(*args_, **kwargs_):
if fiducial_marker_type.subclass:
return fiducial_marker_type.subclass(*args_, **kwargs_)
else:
return fiducial_marker_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_fiducial_type(self): return self.fiducial_type
[docs] def set_fiducial_type(self, fiducial_type): self.fiducial_type = fiducial_type
[docs] def get_manufacturer(self): return self.manufacturer
[docs] def set_manufacturer(self, manufacturer): self.manufacturer = manufacturer
[docs] def get_diameter(self): return self.diameter
[docs] def set_diameter(self, diameter): self.diameter = diameter
[docs] def hasContent_(self):
if (
self.fiducial_type is not None or
self.manufacturer is not None or
self.diameter is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fiducial_marker_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fiducial_marker_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='fiducial_marker_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fiducial_marker_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fiducial_marker_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.fiducial_type is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfiducial_type>%s</%sfiducial_type>%s' % (namespace_, self.gds_format_string(quote_xml(self.fiducial_type).encode(ExternalEncoding), input_name='fiducial_type'), namespace_, eol_))
if self.manufacturer is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smanufacturer>%s</%smanufacturer>%s' % (namespace_, self.gds_format_string(quote_xml(self.manufacturer).encode(ExternalEncoding), input_name='manufacturer'), namespace_, eol_))
if self.diameter is not None:
self.diameter.export(outfile, level, namespace_, name_='diameter', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'fiducial_type':
fiducial_type_ = child_.text
fiducial_type_ = re_.sub(String_cleanup_pat_, " ", fiducial_type_).strip()
fiducial_type_ = self.gds_validate_string(fiducial_type_, node, 'fiducial_type')
self.fiducial_type = fiducial_type_
elif nodeName_ == 'manufacturer':
manufacturer_ = child_.text
manufacturer_ = re_.sub(String_cleanup_pat_, " ", manufacturer_).strip()
manufacturer_ = self.gds_validate_string(manufacturer_, node, 'manufacturer')
self.manufacturer = manufacturer_
elif nodeName_ == 'diameter':
obj_ = diameterType74.factory()
obj_.build(child_)
self.diameter = obj_
obj_.original_tagname_ = 'diameter'
# end class fiducial_marker_type
[docs]class ultramicrotomy_final_thickness_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_microtome_thickness', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units='nm', valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if ultramicrotomy_final_thickness_type.subclass:
return ultramicrotomy_final_thickness_type.subclass(*args_, **kwargs_)
else:
return ultramicrotomy_final_thickness_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='ultramicrotomy_final_thickness_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='ultramicrotomy_final_thickness_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='ultramicrotomy_final_thickness_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ultramicrotomy_final_thickness_type'):
if self.units != "nm" and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ultramicrotomy_final_thickness_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class ultramicrotomy_final_thickness_type
[docs]class fib_voltage_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_focus_ion_voltage', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_voltage_type.subclass:
return fib_voltage_type.subclass(*args_, **kwargs_)
else:
return fib_voltage_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_voltage_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_voltage_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_voltage_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_voltage_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_voltage_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_voltage_type
[docs]class fib_current_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_focus_ion_current', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_current_type.subclass:
return fib_current_type.subclass(*args_, **kwargs_)
else:
return fib_current_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_current_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_current_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_current_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_current_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_current_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_current_type
[docs]class fib_dose_rate_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_focus_ion_dose_rate', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units='ions/nm^2/s', valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_dose_rate_type.subclass:
return fib_dose_rate_type.subclass(*args_, **kwargs_)
else:
return fib_dose_rate_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_dose_rate_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_dose_rate_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_dose_rate_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_dose_rate_type'):
if self.units != "ions/nm^2/s" and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_dose_rate_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_dose_rate_type
[docs]class fib_duration_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_duration_type.subclass:
return fib_duration_type.subclass(*args_, **kwargs_)
else:
return fib_duration_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_duration_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_duration_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_duration_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_duration_type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_duration_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_duration_type
[docs]class fib_initial_thickness_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_focus_ion_initial_thickness', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units='nm', valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_initial_thickness_type.subclass:
return fib_initial_thickness_type.subclass(*args_, **kwargs_)
else:
return fib_initial_thickness_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_initial_thickness_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_initial_thickness_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_initial_thickness_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_initial_thickness_type'):
if self.units != "nm" and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_initial_thickness_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_initial_thickness_type
[docs]class fib_final_thickness_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_focus_ion_final_thickness', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units='nm', valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if fib_final_thickness_type.subclass:
return fib_final_thickness_type.subclass(*args_, **kwargs_)
else:
return fib_final_thickness_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fib_final_thickness_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fib_final_thickness_type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='fib_final_thickness_type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fib_final_thickness_type'):
if self.units != "nm" and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fib_final_thickness_type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class fib_final_thickness_type
[docs]class subtomogram_reconstruction_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_subtomograms_used', 'xs:positiveInteger', 0),
MemberSpec_('applied_symmetry', 'applied_symmetry_type', 0),
MemberSpec_('number_classes_used', 'xs:positiveInteger', 0),
MemberSpec_('algorithm', ['reconstruction_algorithm_type', 'xs:token'], 0),
MemberSpec_('resolution', 'resolutionType75', 0),
MemberSpec_('resolution_method', ['resolution_methodType76', 'xs:token'], 0),
MemberSpec_('reconstruction_filtering', 'reconstruction_filtering_type', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_subtomograms_used=None, applied_symmetry=None, number_classes_used=None, algorithm=None, resolution=None, resolution_method=None, reconstruction_filtering=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_subtomograms_used = number_subtomograms_used
self.applied_symmetry = applied_symmetry
self.number_classes_used = number_classes_used
self.algorithm = algorithm
self.validate_reconstruction_algorithm_type(self.algorithm)
self.resolution = resolution
self.resolution_method = resolution_method
self.validate_resolution_methodType76(self.resolution_method)
self.reconstruction_filtering = reconstruction_filtering
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if subtomogram_reconstruction_type.subclass:
return subtomogram_reconstruction_type.subclass(*args_, **kwargs_)
else:
return subtomogram_reconstruction_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_subtomograms_used(self): return self.number_subtomograms_used
[docs] def set_number_subtomograms_used(self, number_subtomograms_used): self.number_subtomograms_used = number_subtomograms_used
[docs] def get_applied_symmetry(self): return self.applied_symmetry
[docs] def set_applied_symmetry(self, applied_symmetry): self.applied_symmetry = applied_symmetry
[docs] def get_number_classes_used(self): return self.number_classes_used
[docs] def set_number_classes_used(self, number_classes_used): self.number_classes_used = number_classes_used
[docs] def get_algorithm(self): return self.algorithm
[docs] def set_algorithm(self, algorithm): self.algorithm = algorithm
[docs] def get_resolution(self): return self.resolution
[docs] def set_resolution(self, resolution): self.resolution = resolution
[docs] def get_resolution_method(self): return self.resolution_method
[docs] def set_resolution_method(self, resolution_method): self.resolution_method = resolution_method
[docs] def get_reconstruction_filtering(self): return self.reconstruction_filtering
[docs] def set_reconstruction_filtering(self, reconstruction_filtering): self.reconstruction_filtering = reconstruction_filtering
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_reconstruction_algorithm_type(self, value):
# Validate type reconstruction_algorithm_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['ARTS', 'SIRT', 'BACK-PROJECTION RECONSTRUCTION', 'EXACT BACK-PROJECTION RECONSTRUCTION', 'FOURIER SPACE RECONSTRUCTION']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on reconstruction_algorithm_type' % {"value" : value.encode("utf-8")} )
[docs] def validate_resolution_methodType76(self, value):
# Validate type resolution_methodType76, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['FSC 0.5 CUT-OFF', 'FSC 0.33 CUT-OFF', 'FSC 0.143 CUT-OFF', u'3\u03c3']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on resolution_methodType76' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.number_subtomograms_used is not None or
self.applied_symmetry is not None or
self.number_classes_used is not None or
self.algorithm is not None or
self.resolution is not None or
self.resolution_method is not None or
self.reconstruction_filtering is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='subtomogram_reconstruction_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='subtomogram_reconstruction_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='subtomogram_reconstruction_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='subtomogram_reconstruction_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='subtomogram_reconstruction_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_subtomograms_used is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_subtomograms_used>%s</%snumber_subtomograms_used>%s' % (namespace_, self.gds_format_integer(self.number_subtomograms_used, input_name='number_subtomograms_used'), namespace_, eol_))
if self.applied_symmetry is not None:
self.applied_symmetry.export(outfile, level, namespace_, name_='applied_symmetry', pretty_print=pretty_print)
if self.number_classes_used is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_classes_used>%s</%snumber_classes_used>%s' % (namespace_, self.gds_format_integer(self.number_classes_used, input_name='number_classes_used'), namespace_, eol_))
if self.algorithm is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%salgorithm>%s</%salgorithm>%s' % (namespace_, self.gds_format_string(quote_xml(self.algorithm).encode(ExternalEncoding), input_name='algorithm'), namespace_, eol_))
if self.resolution is not None:
self.resolution.export(outfile, level, namespace_, name_='resolution', pretty_print=pretty_print)
if self.resolution_method is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sresolution_method>%s</%sresolution_method>%s' % (namespace_, self.gds_format_string(quote_xml(self.resolution_method).encode(ExternalEncoding), input_name='resolution_method'), namespace_, eol_))
if self.reconstruction_filtering is not None:
self.reconstruction_filtering.export(outfile, level, namespace_, name_='reconstruction_filtering', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_subtomograms_used':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_subtomograms_used')
self.number_subtomograms_used = ival_
elif nodeName_ == 'applied_symmetry':
obj_ = applied_symmetry_type.factory()
obj_.build(child_)
self.applied_symmetry = obj_
obj_.original_tagname_ = 'applied_symmetry'
elif nodeName_ == 'number_classes_used':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_classes_used')
self.number_classes_used = ival_
elif nodeName_ == 'algorithm':
algorithm_ = child_.text
algorithm_ = re_.sub(String_cleanup_pat_, " ", algorithm_).strip()
algorithm_ = self.gds_validate_string(algorithm_, node, 'algorithm')
self.algorithm = algorithm_
# validate type reconstruction_algorithm_type
self.validate_reconstruction_algorithm_type(self.algorithm)
elif nodeName_ == 'resolution':
obj_ = resolutionType75.factory()
obj_.build(child_)
self.resolution = obj_
obj_.original_tagname_ = 'resolution'
elif nodeName_ == 'resolution_method':
resolution_method_ = child_.text
resolution_method_ = re_.sub(String_cleanup_pat_, " ", resolution_method_).strip()
resolution_method_ = self.gds_validate_string(resolution_method_, node, 'resolution_method')
self.resolution_method = resolution_method_
# validate type resolution_methodType76
self.validate_resolution_methodType76(self.resolution_method)
elif nodeName_ == 'reconstruction_filtering':
obj_ = reconstruction_filtering_type.factory()
obj_.build(child_)
self.reconstruction_filtering = obj_
obj_.original_tagname_ = 'reconstruction_filtering'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class subtomogram_reconstruction_type
[docs]class other_macromolecule(base_macromolecule_type):
"""Use to cater for cyclic-pseudo-peptide, other, peptide nucleic acid
and polydeoxyribonucleotide/polyribonucleotide hybrid
categories. Most items are optional and there is no checking
done"""
member_data_items_ = [
MemberSpec_('sequence', 'sequenceType77', 0),
MemberSpec_('classification', 'xs:token', 0),
MemberSpec_('recombinant_expression', 'recombinant_source_type', 0),
MemberSpec_('structure', 'xs:token', 0),
MemberSpec_('synthetic_flag', 'xs:boolean', 0),
]
subclass = None
superclass = base_macromolecule_type
def __init__(self, mutant=None, chimera=None, id=None, name=None, natural_source=None, molecular_weight=None, details=None, number_of_copies=None, oligomeric_state=None, recombinant_exp_flag=None, sequence=None, classification=None, recombinant_expression=None, structure=None, synthetic_flag=None):
self.original_tagname_ = None
super(other_macromolecule, self).__init__(mutant, chimera, id, name, natural_source, molecular_weight, details, number_of_copies, oligomeric_state, recombinant_exp_flag, )
self.sequence = sequence
self.classification = classification
self.recombinant_expression = recombinant_expression
self.structure = structure
self.synthetic_flag = synthetic_flag
[docs] def factory(*args_, **kwargs_):
if other_macromolecule.subclass:
return other_macromolecule.subclass(*args_, **kwargs_)
else:
return other_macromolecule(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_sequence(self): return self.sequence
[docs] def set_sequence(self, sequence): self.sequence = sequence
[docs] def get_classification(self): return self.classification
[docs] def set_classification(self, classification): self.classification = classification
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
[docs] def get_structure(self): return self.structure
[docs] def set_structure(self, structure): self.structure = structure
[docs] def get_synthetic_flag(self): return self.synthetic_flag
[docs] def set_synthetic_flag(self, synthetic_flag): self.synthetic_flag = synthetic_flag
[docs] def hasContent_(self):
if (
self.sequence is not None or
self.classification is not None or
self.recombinant_expression is not None or
self.structure is not None or
self.synthetic_flag is not None or
super(other_macromolecule, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='other_macromolecule', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='other_macromolecule')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='other_macromolecule', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='other_macromolecule'):
super(other_macromolecule, self).exportAttributes(outfile, level, already_processed, namespace_, name_='other_macromolecule')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='other_macromolecule', fromsubclass_=False, pretty_print=True):
super(other_macromolecule, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.sequence is not None:
self.sequence.export(outfile, level, namespace_, name_='sequence', pretty_print=pretty_print)
if self.classification is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sclassification>%s</%sclassification>%s' % (namespace_, self.gds_format_string(quote_xml(self.classification).encode(ExternalEncoding), input_name='classification'), namespace_, eol_))
if self.recombinant_expression is not None:
self.recombinant_expression.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
if self.structure is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstructure>%s</%sstructure>%s' % (namespace_, self.gds_format_string(quote_xml(self.structure).encode(ExternalEncoding), input_name='structure'), namespace_, eol_))
if self.synthetic_flag is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssynthetic_flag>%s</%ssynthetic_flag>%s' % (namespace_, self.gds_format_boolean(self.synthetic_flag, input_name='synthetic_flag'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(other_macromolecule, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'sequence':
obj_ = sequenceType77.factory()
obj_.build(child_)
self.sequence = obj_
obj_.original_tagname_ = 'sequence'
elif nodeName_ == 'classification':
classification_ = child_.text
classification_ = re_.sub(String_cleanup_pat_, " ", classification_).strip()
classification_ = self.gds_validate_string(classification_, node, 'classification')
self.classification = classification_
elif nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression = obj_
obj_.original_tagname_ = 'recombinant_expression'
elif nodeName_ == 'structure':
structure_ = child_.text
structure_ = re_.sub(String_cleanup_pat_, " ", structure_).strip()
structure_ = self.gds_validate_string(structure_, node, 'structure')
self.structure = structure_
elif nodeName_ == 'synthetic_flag':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'synthetic_flag')
self.synthetic_flag = ival_
super(other_macromolecule, self).buildChildren(child_, node, nodeName_, True)
# end class other_macromolecule
[docs]class unit_cell_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('a', 'cell_type', 0),
MemberSpec_('b', 'cell_type', 0),
MemberSpec_('c', 'cell_type', 0),
MemberSpec_('c_sampling_length', 'cell_type', 0),
MemberSpec_('gamma', 'cell_angle_type', 0),
MemberSpec_('alpha', 'cell_angle_type', 0),
MemberSpec_('beta', 'cell_angle_type', 0),
]
subclass = None
superclass = None
def __init__(self, a=None, b=None, c=None, c_sampling_length=None, gamma=None, alpha=None, beta=None):
self.original_tagname_ = None
self.a = a
self.b = b
self.c = c
self.c_sampling_length = c_sampling_length
self.gamma = gamma
self.alpha = alpha
self.beta = beta
[docs] def factory(*args_, **kwargs_):
if unit_cell_type.subclass:
return unit_cell_type.subclass(*args_, **kwargs_)
else:
return unit_cell_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_a(self): return self.a
[docs] def set_a(self, a): self.a = a
[docs] def get_b(self): return self.b
[docs] def set_b(self, b): self.b = b
[docs] def get_c(self): return self.c
[docs] def set_c(self, c): self.c = c
[docs] def get_c_sampling_length(self): return self.c_sampling_length
[docs] def set_c_sampling_length(self, c_sampling_length): self.c_sampling_length = c_sampling_length
[docs] def get_gamma(self): return self.gamma
[docs] def set_gamma(self, gamma): self.gamma = gamma
[docs] def get_alpha(self): return self.alpha
[docs] def set_alpha(self, alpha): self.alpha = alpha
[docs] def get_beta(self): return self.beta
[docs] def set_beta(self, beta): self.beta = beta
[docs] def hasContent_(self):
if (
self.a is not None or
self.b is not None or
self.c is not None or
self.c_sampling_length is not None or
self.gamma is not None or
self.alpha is not None or
self.beta is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='unit_cell_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='unit_cell_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='unit_cell_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='unit_cell_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='unit_cell_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.a is not None:
self.a.export(outfile, level, namespace_, name_='a', pretty_print=pretty_print)
if self.b is not None:
self.b.export(outfile, level, namespace_, name_='b', pretty_print=pretty_print)
if self.c is not None:
self.c.export(outfile, level, namespace_, name_='c', pretty_print=pretty_print)
if self.c_sampling_length is not None:
self.c_sampling_length.export(outfile, level, namespace_, name_='c_sampling_length', pretty_print=pretty_print)
if self.gamma is not None:
self.gamma.export(outfile, level, namespace_, name_='gamma', pretty_print=pretty_print)
if self.alpha is not None:
self.alpha.export(outfile, level, namespace_, name_='alpha', pretty_print=pretty_print)
if self.beta is not None:
self.beta.export(outfile, level, namespace_, name_='beta', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'a':
obj_ = cell_type.factory()
obj_.build(child_)
self.a = obj_
obj_.original_tagname_ = 'a'
elif nodeName_ == 'b':
obj_ = cell_type.factory()
obj_.build(child_)
self.b = obj_
obj_.original_tagname_ = 'b'
elif nodeName_ == 'c':
obj_ = cell_type.factory()
obj_.build(child_)
self.c = obj_
obj_.original_tagname_ = 'c'
elif nodeName_ == 'c_sampling_length':
obj_ = cell_type.factory()
obj_.build(child_)
self.c_sampling_length = obj_
obj_.original_tagname_ = 'c_sampling_length'
elif nodeName_ == 'gamma':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.gamma = obj_
obj_.original_tagname_ = 'gamma'
elif nodeName_ == 'alpha':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.alpha = obj_
obj_.original_tagname_ = 'alpha'
elif nodeName_ == 'beta':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.beta = obj_
obj_.original_tagname_ = 'beta'
# end class unit_cell_type
[docs]class crystal_parameters_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('unit_cell', 'unit_cell_type', 0),
MemberSpec_('plane_group', ['plane_groupType', 'xs:token'], 0),
MemberSpec_('space_group', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, unit_cell=None, plane_group=None, space_group=None):
self.original_tagname_ = None
self.unit_cell = unit_cell
self.plane_group = plane_group
self.validate_plane_groupType(self.plane_group)
self.space_group = space_group
[docs] def factory(*args_, **kwargs_):
if crystal_parameters_type.subclass:
return crystal_parameters_type.subclass(*args_, **kwargs_)
else:
return crystal_parameters_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_unit_cell(self): return self.unit_cell
[docs] def set_unit_cell(self, unit_cell): self.unit_cell = unit_cell
[docs] def get_plane_group(self): return self.plane_group
[docs] def set_plane_group(self, plane_group): self.plane_group = plane_group
[docs] def get_space_group(self): return self.space_group
[docs] def set_space_group(self, space_group): self.space_group = space_group
[docs] def validate_plane_groupType(self, value):
# Validate type plane_groupType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['P 1', 'P 2', 'P 1 2', 'P 1 21', 'C 1 2', 'P 2 2 2', 'P 2 2 21', 'P2 21 21', 'C 2 2 2', 'P 4', 'P 4 2 2', 'P 4 21 2', 'P 3', 'P 3 1 2', 'P 3 2 1', 'P 6', 'P 6 2 2']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on plane_groupType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.unit_cell is not None or
self.plane_group is not None or
self.space_group is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystal_parameters_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystal_parameters_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystal_parameters_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystal_parameters_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystal_parameters_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.unit_cell is not None:
self.unit_cell.export(outfile, level, namespace_, name_='unit_cell', pretty_print=pretty_print)
if self.plane_group is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%splane_group>%s</%splane_group>%s' % (namespace_, self.gds_format_string(quote_xml(self.plane_group).encode(ExternalEncoding), input_name='plane_group'), namespace_, eol_))
if self.space_group is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sspace_group>%s</%sspace_group>%s' % (namespace_, self.gds_format_string(quote_xml(self.space_group).encode(ExternalEncoding), input_name='space_group'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'unit_cell':
obj_ = unit_cell_type.factory()
obj_.build(child_)
self.unit_cell = obj_
obj_.original_tagname_ = 'unit_cell'
elif nodeName_ == 'plane_group':
plane_group_ = child_.text
plane_group_ = re_.sub(String_cleanup_pat_, " ", plane_group_).strip()
plane_group_ = self.gds_validate_string(plane_group_, node, 'plane_group')
self.plane_group = plane_group_
# validate type plane_groupType
self.validate_plane_groupType(self.plane_group)
elif nodeName_ == 'space_group':
space_group_ = child_.text
space_group_ = re_.sub(String_cleanup_pat_, " ", space_group_).strip()
space_group_ = self.gds_validate_string(space_group_, node, 'space_group')
self.space_group = space_group_
# end class crystal_parameters_type
[docs]class crystallography_statistics_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_intensities_measured', 'xs:positiveInteger', 0),
MemberSpec_('number_structure_factors', 'xs:positiveInteger', 0),
MemberSpec_('fourier_space_coverage', 'xs:float', 0),
MemberSpec_('r_sym', 'xs:float', 0),
MemberSpec_('r_merge', 'xs:float', 0),
MemberSpec_('overall_phase_error', 'xs:float', 0),
MemberSpec_('overall_phase_residual', 'xs:float', 0),
MemberSpec_('phase_error_rejection_criteria', 'xs:float', 0),
MemberSpec_('high_resolution', 'high_resolutionType82', 0),
MemberSpec_('shell_list', 'shell_listType', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_intensities_measured=None, number_structure_factors=None, fourier_space_coverage=None, r_sym=None, r_merge=None, overall_phase_error=None, overall_phase_residual=None, phase_error_rejection_criteria=None, high_resolution=None, shell_list=None, details=None):
self.original_tagname_ = None
self.number_intensities_measured = number_intensities_measured
self.number_structure_factors = number_structure_factors
self.fourier_space_coverage = fourier_space_coverage
self.r_sym = r_sym
self.r_merge = r_merge
self.overall_phase_error = overall_phase_error
self.overall_phase_residual = overall_phase_residual
self.phase_error_rejection_criteria = phase_error_rejection_criteria
self.high_resolution = high_resolution
self.shell_list = shell_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if crystallography_statistics_type.subclass:
return crystallography_statistics_type.subclass(*args_, **kwargs_)
else:
return crystallography_statistics_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_intensities_measured(self): return self.number_intensities_measured
[docs] def set_number_intensities_measured(self, number_intensities_measured): self.number_intensities_measured = number_intensities_measured
[docs] def get_number_structure_factors(self): return self.number_structure_factors
[docs] def set_number_structure_factors(self, number_structure_factors): self.number_structure_factors = number_structure_factors
[docs] def get_fourier_space_coverage(self): return self.fourier_space_coverage
[docs] def set_fourier_space_coverage(self, fourier_space_coverage): self.fourier_space_coverage = fourier_space_coverage
[docs] def get_r_sym(self): return self.r_sym
[docs] def set_r_sym(self, r_sym): self.r_sym = r_sym
[docs] def get_r_merge(self): return self.r_merge
[docs] def set_r_merge(self, r_merge): self.r_merge = r_merge
[docs] def get_overall_phase_error(self): return self.overall_phase_error
[docs] def set_overall_phase_error(self, overall_phase_error): self.overall_phase_error = overall_phase_error
[docs] def get_overall_phase_residual(self): return self.overall_phase_residual
[docs] def set_overall_phase_residual(self, overall_phase_residual): self.overall_phase_residual = overall_phase_residual
[docs] def get_phase_error_rejection_criteria(self): return self.phase_error_rejection_criteria
[docs] def set_phase_error_rejection_criteria(self, phase_error_rejection_criteria): self.phase_error_rejection_criteria = phase_error_rejection_criteria
[docs] def get_high_resolution(self): return self.high_resolution
[docs] def set_high_resolution(self, high_resolution): self.high_resolution = high_resolution
[docs] def get_shell_list(self): return self.shell_list
[docs] def set_shell_list(self, shell_list): self.shell_list = shell_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_intensities_measured is not None or
self.number_structure_factors is not None or
self.fourier_space_coverage is not None or
self.r_sym is not None or
self.r_merge is not None or
self.overall_phase_error is not None or
self.overall_phase_residual is not None or
self.phase_error_rejection_criteria is not None or
self.high_resolution is not None or
self.shell_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='crystallography_statistics_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='crystallography_statistics_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='crystallography_statistics_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='crystallography_statistics_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='crystallography_statistics_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_intensities_measured is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_intensities_measured>%s</%snumber_intensities_measured>%s' % (namespace_, self.gds_format_integer(self.number_intensities_measured, input_name='number_intensities_measured'), namespace_, eol_))
if self.number_structure_factors is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_structure_factors>%s</%snumber_structure_factors>%s' % (namespace_, self.gds_format_integer(self.number_structure_factors, input_name='number_structure_factors'), namespace_, eol_))
if self.fourier_space_coverage is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfourier_space_coverage>%s</%sfourier_space_coverage>%s' % (namespace_, self.gds_format_float(self.fourier_space_coverage, input_name='fourier_space_coverage'), namespace_, eol_))
if self.r_sym is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sr_sym>%s</%sr_sym>%s' % (namespace_, self.gds_format_float(self.r_sym, input_name='r_sym'), namespace_, eol_))
if self.r_merge is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sr_merge>%s</%sr_merge>%s' % (namespace_, self.gds_format_float(self.r_merge, input_name='r_merge'), namespace_, eol_))
if self.overall_phase_error is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soverall_phase_error>%s</%soverall_phase_error>%s' % (namespace_, self.gds_format_float(self.overall_phase_error, input_name='overall_phase_error'), namespace_, eol_))
if self.overall_phase_residual is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soverall_phase_residual>%s</%soverall_phase_residual>%s' % (namespace_, self.gds_format_float(self.overall_phase_residual, input_name='overall_phase_residual'), namespace_, eol_))
if self.phase_error_rejection_criteria is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sphase_error_rejection_criteria>%s</%sphase_error_rejection_criteria>%s' % (namespace_, self.gds_format_float(self.phase_error_rejection_criteria, input_name='phase_error_rejection_criteria'), namespace_, eol_))
if self.high_resolution is not None:
self.high_resolution.export(outfile, level, namespace_, name_='high_resolution', pretty_print=pretty_print)
if self.shell_list is not None:
self.shell_list.export(outfile, level, namespace_, name_='shell_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_intensities_measured':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_intensities_measured')
self.number_intensities_measured = ival_
elif nodeName_ == 'number_structure_factors':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_structure_factors')
self.number_structure_factors = ival_
elif nodeName_ == 'fourier_space_coverage':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'fourier_space_coverage')
self.fourier_space_coverage = fval_
elif nodeName_ == 'r_sym':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'r_sym')
self.r_sym = fval_
elif nodeName_ == 'r_merge':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'r_merge')
self.r_merge = fval_
elif nodeName_ == 'overall_phase_error':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'overall_phase_error')
self.overall_phase_error = fval_
elif nodeName_ == 'overall_phase_residual':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'overall_phase_residual')
self.overall_phase_residual = fval_
elif nodeName_ == 'phase_error_rejection_criteria':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'phase_error_rejection_criteria')
self.phase_error_rejection_criteria = fval_
elif nodeName_ == 'high_resolution':
obj_ = high_resolutionType82.factory()
obj_.build(child_)
self.high_resolution = obj_
obj_.original_tagname_ = 'high_resolution'
elif nodeName_ == 'shell_list':
obj_ = shell_listType.factory()
obj_.build(child_)
self.shell_list = obj_
obj_.original_tagname_ = 'shell_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class crystallography_statistics_type
[docs]class classification_type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_classes', 'xs:positiveInteger', 0),
MemberSpec_('average_number_members_per_class', ['average_number_members_per_classType', 'xs:float'], 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_classes=None, average_number_members_per_class=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_classes = number_classes
self.average_number_members_per_class = average_number_members_per_class
self.validate_average_number_members_per_classType(self.average_number_members_per_class)
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if classification_type.subclass:
return classification_type.subclass(*args_, **kwargs_)
else:
return classification_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_classes(self): return self.number_classes
[docs] def set_number_classes(self, number_classes): self.number_classes = number_classes
[docs] def get_average_number_members_per_class(self): return self.average_number_members_per_class
[docs] def set_average_number_members_per_class(self, average_number_members_per_class): self.average_number_members_per_class = average_number_members_per_class
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_average_number_members_per_classType(self, value):
# Validate type average_number_members_per_classType, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value <= 0:
warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on average_number_members_per_classType' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.number_classes is not None or
self.average_number_members_per_class is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='classification_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='classification_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='classification_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='classification_type'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='classification_type', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_classes is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_classes>%s</%snumber_classes>%s' % (namespace_, self.gds_format_integer(self.number_classes, input_name='number_classes'), namespace_, eol_))
if self.average_number_members_per_class is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saverage_number_members_per_class>%s</%saverage_number_members_per_class>%s' % (namespace_, self.gds_format_float(self.average_number_members_per_class, input_name='average_number_members_per_class'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_classes':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_classes')
self.number_classes = ival_
elif nodeName_ == 'average_number_members_per_class':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'average_number_members_per_class')
self.average_number_members_per_class = fval_
# validate type average_number_members_per_classType
self.validate_average_number_members_per_classType(self.average_number_members_per_class)
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class classification_type
[docs]class structure_determination_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('structure_determination', 'structure_determination_type', 1),
]
subclass = None
superclass = None
def __init__(self, structure_determination=None):
self.original_tagname_ = None
if structure_determination is None:
self.structure_determination = []
else:
self.structure_determination = structure_determination
[docs] def factory(*args_, **kwargs_):
if structure_determination_listType.subclass:
return structure_determination_listType.subclass(*args_, **kwargs_)
else:
return structure_determination_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_structure_determination(self): return self.structure_determination
[docs] def set_structure_determination(self, structure_determination): self.structure_determination = structure_determination
[docs] def add_structure_determination(self, value): self.structure_determination.append(value)
[docs] def insert_structure_determination_at(self, index, value): self.structure_determination.insert(index, value)
[docs] def replace_structure_determination_at(self, index, value): self.structure_determination[index] = value
[docs] def hasContent_(self):
if (
self.structure_determination
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='structure_determination_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='structure_determination_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='structure_determination_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='structure_determination_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='structure_determination_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for structure_determination_ in self.structure_determination:
structure_determination_.export(outfile, level, namespace_, name_='structure_determination', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'structure_determination':
obj_ = structure_determination_type.factory()
obj_.build(child_)
self.structure_determination.append(obj_)
obj_.original_tagname_ = 'structure_determination'
# end class structure_determination_listType
[docs]class validationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('validation_type', 'validation_type', 1),
]
subclass = None
superclass = None
def __init__(self, validation_type=None):
self.original_tagname_ = None
if validation_type is None:
self.validation_type = []
else:
self.validation_type = validation_type
[docs] def factory(*args_, **kwargs_):
if validationType.subclass:
return validationType.subclass(*args_, **kwargs_)
else:
return validationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_validation_type(self): return self.validation_type
[docs] def set_validation_type(self, validation_type): self.validation_type = validation_type
[docs] def add_validation_type(self, value): self.validation_type.append(value)
[docs] def insert_validation_type_at(self, index, value): self.validation_type.insert(index, value)
[docs] def replace_validation_type_at(self, index, value): self.validation_type[index] = value
[docs] def hasContent_(self):
if (
self.validation_type
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='validationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='validationType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='validationType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='validationType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='validationType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for validation_type_ in self.validation_type:
validation_type_.export(outfile, level, namespace_, name_='validation_type', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'validation_type':
obj_ = validation_type.factory()
obj_.build(child_)
self.validation_type.append(obj_)
obj_.original_tagname_ = 'validation_type'
elif nodeName_ == 'fsc_curve':
obj_ = fsc_curve.factory()
obj_.build(child_)
self.validation_type.append(obj_)
obj_.original_tagname_ = 'fsc_curve'
elif nodeName_ == 'layer_lines':
obj_ = layer_lines.factory()
obj_.build(child_)
self.validation_type.append(obj_)
obj_.original_tagname_ = 'layer_lines'
elif nodeName_ == 'structure_factors':
obj_ = structure_factors.factory()
obj_.build(child_)
self.validation_type.append(obj_)
obj_.original_tagname_ = 'structure_factors'
elif nodeName_ == 'crystallography_validation':
obj_ = crystallography_validation.factory()
obj_.build(child_)
self.validation_type.append(obj_)
obj_.original_tagname_ = 'crystallography_validation'
# end class validationType
[docs]class sitesType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('deposition', ['depositionType', 'xs:token'], 0),
MemberSpec_('last_processing', ['last_processingType', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, deposition=None, last_processing=None):
self.original_tagname_ = None
self.deposition = deposition
self.validate_depositionType(self.deposition)
self.last_processing = last_processing
self.validate_last_processingType(self.last_processing)
[docs] def factory(*args_, **kwargs_):
if sitesType.subclass:
return sitesType.subclass(*args_, **kwargs_)
else:
return sitesType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_deposition(self): return self.deposition
[docs] def set_deposition(self, deposition): self.deposition = deposition
[docs] def get_last_processing(self): return self.last_processing
[docs] def set_last_processing(self, last_processing): self.last_processing = last_processing
[docs] def validate_depositionType(self, value):
# Validate type depositionType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['PDBe', 'PDBj', 'RCSB']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on depositionType' % {"value" : value.encode("utf-8")} )
[docs] def validate_last_processingType(self, value):
# Validate type last_processingType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['PDBe', 'PDBj', 'RCSB']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on last_processingType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.deposition is not None or
self.last_processing is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sitesType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sitesType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sitesType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sitesType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sitesType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.deposition is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdeposition>%s</%sdeposition>%s' % (namespace_, self.gds_format_string(quote_xml(self.deposition).encode(ExternalEncoding), input_name='deposition'), namespace_, eol_))
if self.last_processing is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slast_processing>%s</%slast_processing>%s' % (namespace_, self.gds_format_string(quote_xml(self.last_processing).encode(ExternalEncoding), input_name='last_processing'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'deposition':
deposition_ = child_.text
deposition_ = re_.sub(String_cleanup_pat_, " ", deposition_).strip()
deposition_ = self.gds_validate_string(deposition_, node, 'deposition')
self.deposition = deposition_
# validate type depositionType
self.validate_depositionType(self.deposition)
elif nodeName_ == 'last_processing':
last_processing_ = child_.text
last_processing_ = re_.sub(String_cleanup_pat_, " ", last_processing_).strip()
last_processing_ = self.gds_validate_string(last_processing_, node, 'last_processing')
self.last_processing = last_processing_
# validate type last_processingType
self.validate_last_processingType(self.last_processing)
# end class sitesType
[docs]class key_datesType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('deposition', 'xs:date', 0),
MemberSpec_('header_release', 'xs:date', 0),
MemberSpec_('map_release', 'xs:date', 0),
MemberSpec_('obsolete', 'xs:date', 0),
MemberSpec_('update', 'xs:date', 0),
]
subclass = None
superclass = None
def __init__(self, deposition=None, header_release=None, map_release=None, obsolete=None, update=None):
self.original_tagname_ = None
if isinstance(deposition, basestring):
initvalue_ = datetime_.datetime.strptime(deposition, '%Y-%m-%d').date()
else:
initvalue_ = deposition
self.deposition = initvalue_
if isinstance(header_release, basestring):
initvalue_ = datetime_.datetime.strptime(header_release, '%Y-%m-%d').date()
else:
initvalue_ = header_release
self.header_release = initvalue_
if isinstance(map_release, basestring):
initvalue_ = datetime_.datetime.strptime(map_release, '%Y-%m-%d').date()
else:
initvalue_ = map_release
self.map_release = initvalue_
if isinstance(obsolete, basestring):
initvalue_ = datetime_.datetime.strptime(obsolete, '%Y-%m-%d').date()
else:
initvalue_ = obsolete
self.obsolete = initvalue_
if isinstance(update, basestring):
initvalue_ = datetime_.datetime.strptime(update, '%Y-%m-%d').date()
else:
initvalue_ = update
self.update = initvalue_
[docs] def factory(*args_, **kwargs_):
if key_datesType.subclass:
return key_datesType.subclass(*args_, **kwargs_)
else:
return key_datesType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_deposition(self): return self.deposition
[docs] def set_deposition(self, deposition): self.deposition = deposition
[docs] def get_map_release(self): return self.map_release
[docs] def set_map_release(self, map_release): self.map_release = map_release
[docs] def get_obsolete(self): return self.obsolete
[docs] def set_obsolete(self, obsolete): self.obsolete = obsolete
[docs] def get_update(self): return self.update
[docs] def set_update(self, update): self.update = update
[docs] def hasContent_(self):
if (
self.deposition is not None or
self.header_release is not None or
self.map_release is not None or
self.obsolete is not None or
self.update is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='key_datesType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='key_datesType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='key_datesType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='key_datesType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='key_datesType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.deposition is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdeposition>%s</%sdeposition>%s' % (namespace_, self.gds_format_date(self.deposition, input_name='deposition'), namespace_, eol_))
if self.header_release is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sheader_release>%s</%sheader_release>%s' % (namespace_, self.gds_format_date(self.header_release, input_name='header_release'), namespace_, eol_))
if self.map_release is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smap_release>%s</%smap_release>%s' % (namespace_, self.gds_format_date(self.map_release, input_name='map_release'), namespace_, eol_))
if self.obsolete is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sobsolete>%s</%sobsolete>%s' % (namespace_, self.gds_format_date(self.obsolete, input_name='obsolete'), namespace_, eol_))
if self.update is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%supdate>%s</%supdate>%s' % (namespace_, self.gds_format_date(self.update, input_name='update'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'deposition':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.deposition = dval_
elif nodeName_ == 'header_release':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.header_release = dval_
elif nodeName_ == 'map_release':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.map_release = dval_
elif nodeName_ == 'obsolete':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.obsolete = dval_
elif nodeName_ == 'update':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.update = dval_
# end class key_datesType
[docs]class obsolete_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('entry', 'supersedes_type', 1),
]
subclass = None
superclass = None
def __init__(self, entry=None):
self.original_tagname_ = None
if entry is None:
self.entry = []
else:
self.entry = entry
[docs] def factory(*args_, **kwargs_):
if obsolete_listType.subclass:
return obsolete_listType.subclass(*args_, **kwargs_)
else:
return obsolete_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_entry(self): return self.entry
[docs] def set_entry(self, entry): self.entry = entry
[docs] def add_entry(self, value): self.entry.append(value)
[docs] def insert_entry_at(self, index, value): self.entry.insert(index, value)
[docs] def replace_entry_at(self, index, value): self.entry[index] = value
[docs] def hasContent_(self):
if (
self.entry
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='obsolete_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='obsolete_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='obsolete_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='obsolete_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='obsolete_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for entry_ in self.entry:
entry_.export(outfile, level, namespace_, name_='entry', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'entry':
obj_ = supersedes_type.factory()
obj_.build(child_)
self.entry.append(obj_)
obj_.original_tagname_ = 'entry'
# end class obsolete_listType
[docs]class superseded_by_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('entry', 'supersedes_type', 1),
]
subclass = None
superclass = None
def __init__(self, entry=None):
self.original_tagname_ = None
if entry is None:
self.entry = []
else:
self.entry = entry
[docs] def factory(*args_, **kwargs_):
if superseded_by_listType.subclass:
return superseded_by_listType.subclass(*args_, **kwargs_)
else:
return superseded_by_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_entry(self): return self.entry
[docs] def set_entry(self, entry): self.entry = entry
[docs] def add_entry(self, value): self.entry.append(value)
[docs] def insert_entry_at(self, index, value): self.entry.insert(index, value)
[docs] def replace_entry_at(self, index, value): self.entry[index] = value
[docs] def hasContent_(self):
if (
self.entry
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='superseded_by_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='superseded_by_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='superseded_by_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='superseded_by_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='superseded_by_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for entry_ in self.entry:
entry_.export(outfile, level, namespace_, name_='entry', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'entry':
obj_ = supersedes_type.factory()
obj_.build(child_)
self.entry.append(obj_)
obj_.original_tagname_ = 'entry'
# end class superseded_by_listType
[docs]class grant_supportType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('grant_reference', 'grant_reference_type', 1),
]
subclass = None
superclass = None
def __init__(self, grant_reference=None):
self.original_tagname_ = None
if grant_reference is None:
self.grant_reference = []
else:
self.grant_reference = grant_reference
[docs] def factory(*args_, **kwargs_):
if grant_supportType.subclass:
return grant_supportType.subclass(*args_, **kwargs_)
else:
return grant_supportType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_grant_reference(self): return self.grant_reference
[docs] def set_grant_reference(self, grant_reference): self.grant_reference = grant_reference
[docs] def add_grant_reference(self, value): self.grant_reference.append(value)
[docs] def insert_grant_reference_at(self, index, value): self.grant_reference.insert(index, value)
[docs] def replace_grant_reference_at(self, index, value): self.grant_reference[index] = value
[docs] def hasContent_(self):
if (
self.grant_reference
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='grant_supportType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='grant_supportType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='grant_supportType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='grant_supportType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='grant_supportType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for grant_reference_ in self.grant_reference:
grant_reference_.export(outfile, level, namespace_, name_='grant_reference', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'grant_reference':
obj_ = grant_reference_type.factory()
obj_.build(child_)
self.grant_reference.append(obj_)
obj_.original_tagname_ = 'grant_reference'
# end class grant_supportType
[docs]class authors_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('author', ['author_type', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, author=None):
self.original_tagname_ = None
if author is None:
self.author = []
else:
self.author = author
[docs] def factory(*args_, **kwargs_):
if authors_listType.subclass:
return authors_listType.subclass(*args_, **kwargs_)
else:
return authors_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def validate_author_type(self, value):
# Validate type author_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_author_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_author_type_patterns_, ))
validate_author_type_patterns_ = [["^[A-Za-z '\\-]+ [A-Z\\-]+$"]]
[docs] def hasContent_(self):
if (
self.author
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='authors_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='authors_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='authors_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='authors_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='authors_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for author_ in self.author:
showIndent(outfile, level, pretty_print)
outfile.write('<%sauthor>%s</%sauthor>%s' % (namespace_, self.gds_format_string(quote_xml(author_).encode(ExternalEncoding), input_name='author'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'author':
author_ = child_.text
author_ = re_.sub(String_cleanup_pat_, " ", author_).strip()
author_ = self.gds_validate_string(author_, node, 'author')
self.author.append(author_)
# validate type author_type
self.validate_author_type(self.author[-1])
# end class authors_listType
[docs]class statusType(version_type):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
]
subclass = None
superclass = version_type
def __init__(self, date=None, code=None, processing_site=None, annotator=None, details=None, id=None):
self.original_tagname_ = None
super(statusType, self).__init__(date, code, processing_site, annotator, details, )
self.id = _cast(int, id)
[docs] def factory(*args_, **kwargs_):
if statusType.subclass:
return statusType.subclass(*args_, **kwargs_)
else:
return statusType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def hasContent_(self):
if (
super(statusType, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='statusType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='statusType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='statusType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='statusType'):
super(statusType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='statusType')
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='statusType', fromsubclass_=False, pretty_print=True):
super(statusType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
super(statusType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
super(statusType, self).buildChildren(child_, node, nodeName_, True)
pass
# end class statusType
[docs]class annotatorType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('private', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, private=None, valueOf_=None):
self.original_tagname_ = None
self.private = _cast(None, private)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if annotatorType.subclass:
return annotatorType.subclass(*args_, **kwargs_)
else:
return annotatorType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_private(self): return self.private
[docs] def set_private(self, private): self.private = private
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='annotatorType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='annotatorType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='annotatorType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='annotatorType'):
if self.private is not None and 'private' not in already_processed:
already_processed.add('private')
outfile.write(' private=%s' % (self.gds_format_string(quote_attrib(self.private).encode(ExternalEncoding), input_name='private'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='annotatorType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('private', node)
if value is not None and 'private' not in already_processed:
already_processed.add('private')
self.private = value
self.private = ' '.join(self.private.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class annotatorType
[docs]class organizationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if organizationType.subclass:
return organizationType.subclass(*args_, **kwargs_)
else:
return organizationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='organizationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='organizationType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='organizationType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='organizationType'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='organizationType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class organizationType
[docs]class citation_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('primary_citation', 'primary_citationType', 0),
MemberSpec_('secondary_citation', 'secondary_citationType', 1),
]
subclass = None
superclass = None
def __init__(self, primary_citation=None, secondary_citation=None):
self.original_tagname_ = None
self.primary_citation = primary_citation
if secondary_citation is None:
self.secondary_citation = []
else:
self.secondary_citation = secondary_citation
[docs] def factory(*args_, **kwargs_):
if citation_listType.subclass:
return citation_listType.subclass(*args_, **kwargs_)
else:
return citation_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_primary_citation(self): return self.primary_citation
[docs] def set_primary_citation(self, primary_citation): self.primary_citation = primary_citation
[docs] def get_secondary_citation(self): return self.secondary_citation
[docs] def set_secondary_citation(self, secondary_citation): self.secondary_citation = secondary_citation
[docs] def add_secondary_citation(self, value): self.secondary_citation.append(value)
[docs] def insert_secondary_citation_at(self, index, value): self.secondary_citation.insert(index, value)
[docs] def replace_secondary_citation_at(self, index, value): self.secondary_citation[index] = value
[docs] def hasContent_(self):
if (
self.primary_citation is not None or
self.secondary_citation
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='citation_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='citation_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='citation_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='citation_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='citation_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.primary_citation is not None:
self.primary_citation.export(outfile, level, namespace_, name_='primary_citation', pretty_print=pretty_print)
for secondary_citation_ in self.secondary_citation:
secondary_citation_.export(outfile, level, namespace_, name_='secondary_citation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'primary_citation':
obj_ = primary_citationType.factory()
obj_.build(child_)
self.primary_citation = obj_
obj_.original_tagname_ = 'primary_citation'
elif nodeName_ == 'secondary_citation':
obj_ = secondary_citationType.factory()
obj_.build(child_)
self.secondary_citation.append(obj_)
obj_.original_tagname_ = 'secondary_citation'
# end class citation_listType
[docs]class primary_citationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('citation_type', 'citation_type', 0),
]
subclass = None
superclass = None
def __init__(self, citation_type=None):
self.original_tagname_ = None
self.citation_type = citation_type
[docs] def factory(*args_, **kwargs_):
if primary_citationType.subclass:
return primary_citationType.subclass(*args_, **kwargs_)
else:
return primary_citationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_citation_type(self): return self.citation_type
[docs] def set_citation_type(self, citation_type): self.citation_type = citation_type
[docs] def hasContent_(self):
if (
self.citation_type is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='primary_citationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='primary_citationType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='primary_citationType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='primary_citationType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='primary_citationType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.citation_type is not None:
self.citation_type.export(outfile, level, namespace_, name_='citation_type', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'citation_type':
obj_ = citation_type.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'citation_type'
elif nodeName_ == 'non_journal_citation':
obj_ = non_journal_citation.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'non_journal_citation'
elif nodeName_ == 'journal_citation':
obj_ = journal_citation.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'journal_citation'
# end class primary_citationType
[docs]class secondary_citationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('citation_type', 'citation_type', 0),
]
subclass = None
superclass = None
def __init__(self, citation_type=None):
self.original_tagname_ = None
self.citation_type = citation_type
[docs] def factory(*args_, **kwargs_):
if secondary_citationType.subclass:
return secondary_citationType.subclass(*args_, **kwargs_)
else:
return secondary_citationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_citation_type(self): return self.citation_type
[docs] def set_citation_type(self, citation_type): self.citation_type = citation_type
[docs] def hasContent_(self):
if (
self.citation_type is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='secondary_citationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='secondary_citationType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='secondary_citationType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='secondary_citationType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='secondary_citationType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.citation_type is not None:
self.citation_type.export(outfile, level, namespace_, name_='citation_type', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'citation_type':
obj_ = citation_type.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'citation_type'
elif nodeName_ == 'non_journal_citation':
obj_ = non_journal_citation.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'non_journal_citation'
elif nodeName_ == 'journal_citation':
obj_ = journal_citation.factory()
obj_.build(child_)
self.citation_type = obj_
obj_.original_tagname_ = 'journal_citation'
# end class secondary_citationType
[docs]class auxiliary_link_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('auxiliary_link', 'auxiliary_link_type', 1),
]
subclass = None
superclass = None
def __init__(self, auxiliary_link=None):
self.original_tagname_ = None
if auxiliary_link is None:
self.auxiliary_link = []
else:
self.auxiliary_link = auxiliary_link
[docs] def factory(*args_, **kwargs_):
if auxiliary_link_listType.subclass:
return auxiliary_link_listType.subclass(*args_, **kwargs_)
else:
return auxiliary_link_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_auxiliary_link(self): return self.auxiliary_link
[docs] def set_auxiliary_link(self, auxiliary_link): self.auxiliary_link = auxiliary_link
[docs] def add_auxiliary_link(self, value): self.auxiliary_link.append(value)
[docs] def insert_auxiliary_link_at(self, index, value): self.auxiliary_link.insert(index, value)
[docs] def replace_auxiliary_link_at(self, index, value): self.auxiliary_link[index] = value
[docs] def hasContent_(self):
if (
self.auxiliary_link
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='auxiliary_link_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='auxiliary_link_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='auxiliary_link_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='auxiliary_link_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='auxiliary_link_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for auxiliary_link_ in self.auxiliary_link:
auxiliary_link_.export(outfile, level, namespace_, name_='auxiliary_link', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'auxiliary_link':
obj_ = auxiliary_link_type.factory()
obj_.build(child_)
self.auxiliary_link.append(obj_)
obj_.original_tagname_ = 'auxiliary_link'
# end class auxiliary_link_listType
[docs]class relationshipType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('in_frame', ['in_frameType', 'xs:token'], 0),
MemberSpec_('other', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, in_frame=None, other=None):
self.original_tagname_ = None
self.in_frame = in_frame
self.validate_in_frameType(self.in_frame)
self.other = other
[docs] def factory(*args_, **kwargs_):
if relationshipType.subclass:
return relationshipType.subclass(*args_, **kwargs_)
else:
return relationshipType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_in_frame(self): return self.in_frame
[docs] def set_in_frame(self, in_frame): self.in_frame = in_frame
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def validate_in_frameType(self, value):
# Validate type in_frameType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['NOOVERLAP', 'PARTIALOVERLAP', 'FULLOVERLAP']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on in_frameType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.in_frame is not None or
self.other is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='relationshipType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationshipType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='relationshipType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='relationshipType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='relationshipType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.in_frame is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sin_frame>%s</%sin_frame>%s' % (namespace_, self.gds_format_string(quote_xml(self.in_frame).encode(ExternalEncoding), input_name='in_frame'), namespace_, eol_))
if self.other is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother>%s</%sother>%s' % (namespace_, self.gds_format_string(quote_xml(self.other).encode(ExternalEncoding), input_name='other'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'in_frame':
in_frame_ = child_.text
in_frame_ = re_.sub(String_cleanup_pat_, " ", in_frame_).strip()
in_frame_ = self.gds_validate_string(in_frame_, node, 'in_frame')
self.in_frame = in_frame_
# validate type in_frameType
self.validate_in_frameType(self.in_frame)
elif nodeName_ == 'other':
other_ = child_.text
other_ = self.gds_validate_string(other_, node, 'other')
self.other = other_
# end class relationshipType
[docs]class relationshipType1(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('in_frame', ['in_frameType2', 'xs:token'], 0),
MemberSpec_('other', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, in_frame=None, other=None):
self.original_tagname_ = None
self.in_frame = in_frame
self.validate_in_frameType2(self.in_frame)
self.other = other
[docs] def factory(*args_, **kwargs_):
if relationshipType1.subclass:
return relationshipType1.subclass(*args_, **kwargs_)
else:
return relationshipType1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_in_frame(self): return self.in_frame
[docs] def set_in_frame(self, in_frame): self.in_frame = in_frame
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def validate_in_frameType2(self, value):
# Validate type in_frameType2, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['NOOVERLAP', 'PARTIALOVERLAP', 'FULLOVERLAP']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on in_frameType2' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.in_frame is not None or
self.other is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='relationshipType1', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationshipType1')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='relationshipType1', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='relationshipType1'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='relationshipType1', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.in_frame is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sin_frame>%s</%sin_frame>%s' % (namespace_, self.gds_format_string(quote_xml(self.in_frame).encode(ExternalEncoding), input_name='in_frame'), namespace_, eol_))
if self.other is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother>%s</%sother>%s' % (namespace_, self.gds_format_string(quote_xml(self.other).encode(ExternalEncoding), input_name='other'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'in_frame':
in_frame_ = child_.text
in_frame_ = re_.sub(String_cleanup_pat_, " ", in_frame_).strip()
in_frame_ = self.gds_validate_string(in_frame_, node, 'in_frame')
self.in_frame = in_frame_
# validate type in_frameType2
self.validate_in_frameType2(self.in_frame)
elif nodeName_ == 'other':
other_ = child_.text
other_ = self.gds_validate_string(other_, node, 'other')
self.other = other_
# end class relationshipType1
[docs]class specimen_preparation_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('specimen_preparation', 'base_preparation_type', 1),
]
subclass = None
superclass = None
def __init__(self, specimen_preparation=None):
self.original_tagname_ = None
if specimen_preparation is None:
self.specimen_preparation = []
else:
self.specimen_preparation = specimen_preparation
[docs] def factory(*args_, **kwargs_):
if specimen_preparation_listType.subclass:
return specimen_preparation_listType.subclass(*args_, **kwargs_)
else:
return specimen_preparation_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_specimen_preparation(self): return self.specimen_preparation
[docs] def set_specimen_preparation(self, specimen_preparation): self.specimen_preparation = specimen_preparation
[docs] def add_specimen_preparation(self, value): self.specimen_preparation.append(value)
[docs] def insert_specimen_preparation_at(self, index, value): self.specimen_preparation.insert(index, value)
[docs] def replace_specimen_preparation_at(self, index, value): self.specimen_preparation[index] = value
[docs] def hasContent_(self):
if (
self.specimen_preparation
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='specimen_preparation_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='specimen_preparation_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='specimen_preparation_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='specimen_preparation_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='specimen_preparation_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for specimen_preparation_ in self.specimen_preparation:
specimen_preparation_.export(outfile, level, namespace_, name_='specimen_preparation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'specimen_preparation':
class_obj_ = self.get_class_obj_(child_, base_preparation_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.specimen_preparation.append(obj_)
obj_.original_tagname_ = 'specimen_preparation'
elif nodeName_ == 'tomography_preparation':
obj_ = tomography_preparation_type.factory()
obj_.build(child_)
self.specimen_preparation.append(obj_)
obj_.original_tagname_ = 'tomography_preparation'
elif nodeName_ == 'crystallography_preparation':
obj_ = crystallography_preparation_type.factory()
obj_.build(child_)
self.specimen_preparation.append(obj_)
obj_.original_tagname_ = 'crystallography_preparation'
# end class specimen_preparation_listType
[docs]class microscopy_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('microscopy', 'base_microscopy_type', 1),
]
subclass = None
superclass = None
def __init__(self, microscopy=None):
self.original_tagname_ = None
if microscopy is None:
self.microscopy = []
else:
self.microscopy = microscopy
[docs] def factory(*args_, **kwargs_):
if microscopy_listType.subclass:
return microscopy_listType.subclass(*args_, **kwargs_)
else:
return microscopy_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_microscopy(self): return self.microscopy
[docs] def set_microscopy(self, microscopy): self.microscopy = microscopy
[docs] def add_microscopy(self, value): self.microscopy.append(value)
[docs] def insert_microscopy_at(self, index, value): self.microscopy.insert(index, value)
[docs] def replace_microscopy_at(self, index, value): self.microscopy[index] = value
[docs] def hasContent_(self):
if (
self.microscopy
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='microscopy_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='microscopy_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='microscopy_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='microscopy_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='microscopy_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for microscopy_ in self.microscopy:
microscopy_.export(outfile, level, namespace_, name_='microscopy', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'microscopy':
class_obj_ = self.get_class_obj_(child_, base_microscopy_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.microscopy.append(obj_)
obj_.original_tagname_ = 'microscopy'
elif nodeName_ == 'tomography_microscopy':
obj_ = tomography_microscopy_type.factory()
obj_.build(child_)
self.microscopy.append(obj_)
obj_.original_tagname_ = 'tomography_microscopy'
elif nodeName_ == 'crystallography_microscopy':
obj_ = crystallography_microscopy_type.factory()
obj_.build(child_)
self.microscopy.append(obj_)
obj_.original_tagname_ = 'crystallography_microscopy'
# end class microscopy_listType
[docs]class supramolecule_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('supramolecule', 'base_supramolecule_type', 1),
]
subclass = None
superclass = None
def __init__(self, supramolecule=None):
self.original_tagname_ = None
if supramolecule is None:
self.supramolecule = []
else:
self.supramolecule = supramolecule
[docs] def factory(*args_, **kwargs_):
if supramolecule_listType.subclass:
return supramolecule_listType.subclass(*args_, **kwargs_)
else:
return supramolecule_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_supramolecule(self): return self.supramolecule
[docs] def set_supramolecule(self, supramolecule): self.supramolecule = supramolecule
[docs] def add_supramolecule(self, value): self.supramolecule.append(value)
[docs] def insert_supramolecule_at(self, index, value): self.supramolecule.insert(index, value)
[docs] def replace_supramolecule_at(self, index, value): self.supramolecule[index] = value
[docs] def hasContent_(self):
if (
self.supramolecule
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='supramolecule_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='supramolecule_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='supramolecule_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='supramolecule_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='supramolecule_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for supramolecule_ in self.supramolecule:
supramolecule_.export(outfile, level, namespace_, name_='supramolecule', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'supramolecule':
class_obj_ = self.get_class_obj_(child_, base_supramolecule_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'supramolecule'
elif nodeName_ == 'sample':
obj_ = sample.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'sample'
elif nodeName_ == 'cell':
obj_ = cell.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'cell'
elif nodeName_ == 'tissue':
obj_ = tissue.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'tissue'
elif nodeName_ == 'organelle_or_cellular_component':
obj_ = organelle_or_cellular_component.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'organelle_or_cellular_component'
elif nodeName_ == 'virus':
obj_ = virus.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'virus'
elif nodeName_ == 'complex':
obj_ = complex.factory()
obj_.build(child_)
self.supramolecule.append(obj_)
obj_.original_tagname_ = 'complex'
# end class supramolecule_listType
[docs]class glow_dischargeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('glow_discharge_params', 'glow_discharge_params_type', 0),
]
subclass = None
superclass = None
def __init__(self, glow_discharge_params=None):
self.original_tagname_ = None
self.glow_discharge_params = glow_discharge_params
[docs] def factory(*args_, **kwargs_):
if glow_dischargeType.subclass:
return glow_dischargeType.subclass(*args_, **kwargs_)
else:
return glow_dischargeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_glow_discharge_params(self): return self.glow_discharge_params
[docs] def set_glow_discharge_params(self, glow_discharge_params): self.glow_discharge_params = glow_discharge_params
[docs] def hasContent_(self):
if (
self.glow_discharge_params is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='glow_dischargeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='glow_dischargeType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='glow_dischargeType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='glow_dischargeType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='glow_dischargeType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.glow_discharge_params is not None:
self.glow_discharge_params.export(outfile, level, namespace_, name_='glow_discharge_params', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'glow_discharge_params':
obj_ = glow_discharge_params_type.factory()
obj_.build(child_)
self.glow_discharge_params = obj_
obj_.original_tagname_ = 'glow_discharge_params'
# end class glow_dischargeType
[docs]class timeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_time_glow_discharge', 'xs:positiveInteger'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if timeType.subclass:
return timeType.subclass(*args_, **kwargs_)
else:
return timeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='timeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='timeType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='timeType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='timeType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class timeType
[docs]class pressureType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_pressure_glow_discharge', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if pressureType.subclass:
return pressureType.subclass(*args_, **kwargs_)
else:
return pressureType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pressureType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pressureType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='pressureType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pressureType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pressureType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class pressureType
[docs]class energy_filterType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('lower_energy_threshold', 'lower_energy_thresholdType', 0),
MemberSpec_('upper_energy_threshold', 'upper_energy_thresholdType', 0),
]
subclass = None
superclass = None
def __init__(self, name=None, lower_energy_threshold=None, upper_energy_threshold=None):
self.original_tagname_ = None
self.name = name
self.lower_energy_threshold = lower_energy_threshold
self.upper_energy_threshold = upper_energy_threshold
[docs] def factory(*args_, **kwargs_):
if energy_filterType.subclass:
return energy_filterType.subclass(*args_, **kwargs_)
else:
return energy_filterType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_lower_energy_threshold(self): return self.lower_energy_threshold
[docs] def set_lower_energy_threshold(self, lower_energy_threshold): self.lower_energy_threshold = lower_energy_threshold
[docs] def get_upper_energy_threshold(self): return self.upper_energy_threshold
[docs] def set_upper_energy_threshold(self, upper_energy_threshold): self.upper_energy_threshold = upper_energy_threshold
[docs] def hasContent_(self):
if (
self.name is not None or
self.lower_energy_threshold is not None or
self.upper_energy_threshold is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='energy_filterType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='energy_filterType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='energy_filterType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='energy_filterType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='energy_filterType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.lower_energy_threshold is not None:
self.lower_energy_threshold.export(outfile, level, namespace_, name_='lower_energy_threshold', pretty_print=pretty_print)
if self.upper_energy_threshold is not None:
self.upper_energy_threshold.export(outfile, level, namespace_, name_='upper_energy_threshold', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'lower_energy_threshold':
obj_ = lower_energy_thresholdType.factory()
obj_.build(child_)
self.lower_energy_threshold = obj_
obj_.original_tagname_ = 'lower_energy_threshold'
elif nodeName_ == 'upper_energy_threshold':
obj_ = upper_energy_thresholdType.factory()
obj_.build(child_)
self.upper_energy_threshold = obj_
obj_.original_tagname_ = 'upper_energy_threshold'
# end class energy_filterType
[docs]class lower_energy_thresholdType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_energy_window', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if lower_energy_thresholdType.subclass:
return lower_energy_thresholdType.subclass(*args_, **kwargs_)
else:
return lower_energy_thresholdType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='lower_energy_thresholdType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='lower_energy_thresholdType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='lower_energy_thresholdType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='lower_energy_thresholdType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='lower_energy_thresholdType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class lower_energy_thresholdType
[docs]class upper_energy_thresholdType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_energy_window', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if upper_energy_thresholdType.subclass:
return upper_energy_thresholdType.subclass(*args_, **kwargs_)
else:
return upper_energy_thresholdType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='upper_energy_thresholdType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='upper_energy_thresholdType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='upper_energy_thresholdType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='upper_energy_thresholdType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='upper_energy_thresholdType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class upper_energy_thresholdType
[docs]class validation_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('soft_validation_regexp', 'soft_validation_regexpType', 1),
MemberSpec_('hard_validation_regexp', 'hard_validation_regexpType', 1),
]
subclass = None
superclass = None
def __init__(self, soft_validation_regexp=None, hard_validation_regexp=None):
self.original_tagname_ = None
if soft_validation_regexp is None:
self.soft_validation_regexp = []
else:
self.soft_validation_regexp = soft_validation_regexp
if hard_validation_regexp is None:
self.hard_validation_regexp = []
else:
self.hard_validation_regexp = hard_validation_regexp
[docs] def factory(*args_, **kwargs_):
if validation_listType.subclass:
return validation_listType.subclass(*args_, **kwargs_)
else:
return validation_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_soft_validation_regexp(self): return self.soft_validation_regexp
[docs] def set_soft_validation_regexp(self, soft_validation_regexp): self.soft_validation_regexp = soft_validation_regexp
[docs] def add_soft_validation_regexp(self, value): self.soft_validation_regexp.append(value)
[docs] def insert_soft_validation_regexp_at(self, index, value): self.soft_validation_regexp.insert(index, value)
[docs] def replace_soft_validation_regexp_at(self, index, value): self.soft_validation_regexp[index] = value
[docs] def get_hard_validation_regexp(self): return self.hard_validation_regexp
[docs] def set_hard_validation_regexp(self, hard_validation_regexp): self.hard_validation_regexp = hard_validation_regexp
[docs] def add_hard_validation_regexp(self, value): self.hard_validation_regexp.append(value)
[docs] def insert_hard_validation_regexp_at(self, index, value): self.hard_validation_regexp.insert(index, value)
[docs] def replace_hard_validation_regexp_at(self, index, value): self.hard_validation_regexp[index] = value
[docs] def hasContent_(self):
if (
self.soft_validation_regexp or
self.hard_validation_regexp
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='validation_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='validation_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='validation_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='validation_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='validation_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for soft_validation_regexp_ in self.soft_validation_regexp:
soft_validation_regexp_.export(outfile, level, namespace_, name_='soft_validation_regexp', pretty_print=pretty_print)
for hard_validation_regexp_ in self.hard_validation_regexp:
hard_validation_regexp_.export(outfile, level, namespace_, name_='hard_validation_regexp', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'soft_validation_regexp':
obj_ = soft_validation_regexpType.factory()
obj_.build(child_)
self.soft_validation_regexp.append(obj_)
obj_.original_tagname_ = 'soft_validation_regexp'
elif nodeName_ == 'hard_validation_regexp':
obj_ = hard_validation_regexpType.factory()
obj_.build(child_)
self.hard_validation_regexp.append(obj_)
obj_.original_tagname_ = 'hard_validation_regexp'
# end class validation_listType
[docs]class soft_validation_regexpType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('warning_text', 'xs:string', 0),
MemberSpec_('regexp', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, warning_text=None, regexp=None):
self.original_tagname_ = None
self.warning_text = warning_text
self.regexp = regexp
[docs] def factory(*args_, **kwargs_):
if soft_validation_regexpType.subclass:
return soft_validation_regexpType.subclass(*args_, **kwargs_)
else:
return soft_validation_regexpType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_warning_text(self): return self.warning_text
[docs] def set_warning_text(self, warning_text): self.warning_text = warning_text
[docs] def get_regexp(self): return self.regexp
[docs] def set_regexp(self, regexp): self.regexp = regexp
[docs] def hasContent_(self):
if (
self.warning_text is not None or
self.regexp is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='soft_validation_regexpType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='soft_validation_regexpType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='soft_validation_regexpType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='soft_validation_regexpType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='soft_validation_regexpType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.warning_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%swarning_text>%s</%swarning_text>%s' % (namespace_, self.gds_format_string(quote_xml(self.warning_text).encode(ExternalEncoding), input_name='warning_text'), namespace_, eol_))
if self.regexp is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sregexp>%s</%sregexp>%s' % (namespace_, self.gds_format_string(quote_xml(self.regexp).encode(ExternalEncoding), input_name='regexp'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'warning_text':
warning_text_ = child_.text
warning_text_ = self.gds_validate_string(warning_text_, node, 'warning_text')
self.warning_text = warning_text_
elif nodeName_ == 'regexp':
regexp_ = child_.text
regexp_ = self.gds_validate_string(regexp_, node, 'regexp')
self.regexp = regexp_
# end class soft_validation_regexpType
[docs]class hard_validation_regexpType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('_error_text', 'xs:string', 0),
MemberSpec_('regexp', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, _error_text=None, regexp=None):
self.original_tagname_ = None
self._error_text = _error_text
self.regexp = regexp
[docs] def factory(*args_, **kwargs_):
if hard_validation_regexpType.subclass:
return hard_validation_regexpType.subclass(*args_, **kwargs_)
else:
return hard_validation_regexpType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get__error_text(self): return self._error_text
[docs] def set__error_text(self, _error_text): self._error_text = _error_text
[docs] def get_regexp(self): return self.regexp
[docs] def set_regexp(self, regexp): self.regexp = regexp
[docs] def hasContent_(self):
if (
self._error_text is not None or
self.regexp is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='hard_validation_regexpType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='hard_validation_regexpType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='hard_validation_regexpType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='hard_validation_regexpType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='hard_validation_regexpType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self._error_text is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%s_error_text>%s</%s_error_text>%s' % (namespace_, self.gds_format_string(quote_xml(self._error_text).encode(ExternalEncoding), input_name='_error_text'), namespace_, eol_))
if self.regexp is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sregexp>%s</%sregexp>%s' % (namespace_, self.gds_format_string(quote_xml(self.regexp).encode(ExternalEncoding), input_name='regexp'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == '_error_text':
_error_text_ = child_.text
_error_text_ = self.gds_validate_string(_error_text_, node, '_error_text')
self._error_text = _error_text_
elif nodeName_ == 'regexp':
regexp_ = child_.text
regexp_ = self.gds_validate_string(regexp_, node, 'regexp')
self.regexp = regexp_
# end class hard_validation_regexpType
[docs]class componentType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('concentration', 'concentrationType', 0),
MemberSpec_('formula', ['formulaType', 'xs:token'], 0),
MemberSpec_('name', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, concentration=None, formula=None, name=None):
self.original_tagname_ = None
self.concentration = concentration
self.formula = formula
self.validate_formulaType(self.formula)
self.name = name
[docs] def factory(*args_, **kwargs_):
if componentType.subclass:
return componentType.subclass(*args_, **kwargs_)
else:
return componentType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_concentration(self): return self.concentration
[docs] def set_concentration(self, concentration): self.concentration = concentration
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
validate_formulaType_patterns_ = [['^([\\[\\]\\(\\)]*[A-Z][a-z]?[\\+\\-\\d/\\[\\]\\(\\)]*)+$']]
[docs] def hasContent_(self):
if (
self.concentration is not None or
self.formula is not None or
self.name is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='componentType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='componentType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.concentration is not None:
self.concentration.export(outfile, level, namespace_, name_='concentration', pretty_print=pretty_print)
if self.formula is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sformula>%s</%sformula>%s' % (namespace_, self.gds_format_string(quote_xml(self.formula).encode(ExternalEncoding), input_name='formula'), namespace_, eol_))
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'concentration':
obj_ = concentrationType.factory()
obj_.build(child_)
self.concentration = obj_
obj_.original_tagname_ = 'concentration'
elif nodeName_ == 'formula':
formula_ = child_.text
formula_ = re_.sub(String_cleanup_pat_, " ", formula_).strip()
formula_ = self.gds_validate_string(formula_, node, 'formula')
self.formula = formula_
# validate type formulaType
self.validate_formulaType(self.formula)
elif nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
# end class componentType
[docs]class concentrationType(GeneratedsSuper):
"""_emd_buffer_component.concentration_units"""
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_concentration', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if concentrationType.subclass:
return concentrationType.subclass(*args_, **kwargs_)
else:
return concentrationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='concentrationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='concentrationType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='concentrationType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='concentrationType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='concentrationType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class concentrationType
[docs]class chamber_humidityType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_humidity_vitrification', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if chamber_humidityType.subclass:
return chamber_humidityType.subclass(*args_, **kwargs_)
else:
return chamber_humidityType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chamber_humidityType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chamber_humidityType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='chamber_humidityType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chamber_humidityType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chamber_humidityType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
[docs]class chamber_temperatureType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_temperature_vitrification', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if chamber_temperatureType.subclass:
return chamber_temperatureType.subclass(*args_, **kwargs_)
else:
return chamber_temperatureType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chamber_temperatureType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chamber_temperatureType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='chamber_temperatureType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chamber_temperatureType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chamber_temperatureType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class chamber_temperatureType
[docs]class concentrationType3(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_concentration', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if concentrationType3.subclass:
return concentrationType3.subclass(*args_, **kwargs_)
else:
return concentrationType3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='concentrationType3', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='concentrationType3')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='concentrationType3', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='concentrationType3'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='concentrationType3', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class concentrationType3
[docs]class stainingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type_', ['typeType', 'xs:token'], 0),
MemberSpec_('material', 'xs:token', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, material=None, details=None):
self.original_tagname_ = None
self.type_ = type_
self.validate_typeType(self.type_)
self.material = material
self.details = details
[docs] def factory(*args_, **kwargs_):
if stainingType.subclass:
return stainingType.subclass(*args_, **kwargs_)
else:
return stainingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_material(self): return self.material
[docs] def set_material(self, material): self.material = material
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_typeType(self, value):
# Validate type typeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['NEGATIVE', 'POSITIVE']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on typeType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.type_ is not None or
self.material is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='stainingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='stainingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='stainingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='stainingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='stainingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.type_ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_))
if self.material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smaterial>%s</%smaterial>%s' % (namespace_, self.gds_format_string(quote_xml(self.material).encode(ExternalEncoding), input_name='material'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'type':
type_ = child_.text
type_ = re_.sub(String_cleanup_pat_, " ", type_).strip()
type_ = self.gds_validate_string(type_, node, 'type')
self.type_ = type_
# validate type typeType
self.validate_typeType(self.type_)
elif nodeName_ == 'material':
material_ = child_.text
material_ = re_.sub(String_cleanup_pat_, " ", material_).strip()
material_ = self.gds_validate_string(material_, node, 'material')
self.material = material_
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class stainingType
[docs]class sugar_embeddingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('material', ['materialType4', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, material=None, details=None):
self.original_tagname_ = None
self.material = material
self.validate_materialType4(self.material)
self.details = details
[docs] def factory(*args_, **kwargs_):
if sugar_embeddingType.subclass:
return sugar_embeddingType.subclass(*args_, **kwargs_)
else:
return sugar_embeddingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_material(self): return self.material
[docs] def set_material(self, material): self.material = material
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_materialType4(self, value):
# Validate type materialType4, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['GLUCOSE', 'TREHALOSE', 'TANNIC ACID']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on materialType4' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.material is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sugar_embeddingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sugar_embeddingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sugar_embeddingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sugar_embeddingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sugar_embeddingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smaterial>%s</%smaterial>%s' % (namespace_, self.gds_format_string(quote_xml(self.material).encode(ExternalEncoding), input_name='material'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'material':
material_ = child_.text
material_ = re_.sub(String_cleanup_pat_, " ", material_).strip()
material_ = self.gds_validate_string(material_, node, 'material')
self.material = material_
# validate type materialType4
self.validate_materialType4(self.material)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class sugar_embeddingType
[docs]class shadowingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('material', 'xs:token', 0),
MemberSpec_('angle', 'angleType', 0),
MemberSpec_('thickness', 'thicknessType', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, material=None, angle=None, thickness=None, details=None):
self.original_tagname_ = None
self.material = material
self.angle = angle
self.thickness = thickness
self.details = details
[docs] def factory(*args_, **kwargs_):
if shadowingType.subclass:
return shadowingType.subclass(*args_, **kwargs_)
else:
return shadowingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_material(self): return self.material
[docs] def set_material(self, material): self.material = material
[docs] def get_angle(self): return self.angle
[docs] def set_angle(self, angle): self.angle = angle
[docs] def get_thickness(self): return self.thickness
[docs] def set_thickness(self, thickness): self.thickness = thickness
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.material is not None or
self.angle is not None or
self.thickness is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='shadowingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='shadowingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='shadowingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='shadowingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='shadowingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.material is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smaterial>%s</%smaterial>%s' % (namespace_, self.gds_format_string(quote_xml(self.material).encode(ExternalEncoding), input_name='material'), namespace_, eol_))
if self.angle is not None:
self.angle.export(outfile, level, namespace_, name_='angle', pretty_print=pretty_print)
if self.thickness is not None:
self.thickness.export(outfile, level, namespace_, name_='thickness', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'material':
material_ = child_.text
material_ = re_.sub(String_cleanup_pat_, " ", material_).strip()
material_ = self.gds_validate_string(material_, node, 'material')
self.material = material_
elif nodeName_ == 'angle':
obj_ = angleType.factory()
obj_.build(child_)
self.angle = obj_
obj_.original_tagname_ = 'angle'
elif nodeName_ == 'thickness':
obj_ = thicknessType.factory()
obj_.build(child_)
self.thickness = obj_
obj_.original_tagname_ = 'thickness'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class shadowingType
[docs]class angleType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_angle_shadowing', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if angleType.subclass:
return angleType.subclass(*args_, **kwargs_)
else:
return angleType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angleType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angleType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='angleType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angleType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angleType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class angleType
[docs]class thicknessType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_thickness_shadowing', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if thicknessType.subclass:
return thicknessType.subclass(*args_, **kwargs_)
else:
return thicknessType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='thicknessType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='thicknessType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='thicknessType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='thicknessType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='thicknessType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class thicknessType
[docs]class fiducial_markers_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('fiducial_marker', 'fiducial_marker_type', 1),
]
subclass = None
superclass = None
def __init__(self, fiducial_marker=None):
self.original_tagname_ = None
if fiducial_marker is None:
self.fiducial_marker = []
else:
self.fiducial_marker = fiducial_marker
[docs] def factory(*args_, **kwargs_):
if fiducial_markers_listType.subclass:
return fiducial_markers_listType.subclass(*args_, **kwargs_)
else:
return fiducial_markers_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_fiducial_marker(self): return self.fiducial_marker
[docs] def set_fiducial_marker(self, fiducial_marker): self.fiducial_marker = fiducial_marker
[docs] def add_fiducial_marker(self, value): self.fiducial_marker.append(value)
[docs] def insert_fiducial_marker_at(self, index, value): self.fiducial_marker.insert(index, value)
[docs] def replace_fiducial_marker_at(self, index, value): self.fiducial_marker[index] = value
[docs] def hasContent_(self):
if (
self.fiducial_marker
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='fiducial_markers_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='fiducial_markers_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='fiducial_markers_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='fiducial_markers_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='fiducial_markers_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for fiducial_marker_ in self.fiducial_marker:
fiducial_marker_.export(outfile, level, namespace_, name_='fiducial_marker', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'fiducial_marker':
obj_ = fiducial_marker_type.factory()
obj_.build(child_)
self.fiducial_marker.append(obj_)
obj_.original_tagname_ = 'fiducial_marker'
# end class fiducial_markers_listType
[docs]class high_pressure_freezingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('instrument', ['instrumentType5', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, instrument=None, details=None):
self.original_tagname_ = None
self.instrument = instrument
self.validate_instrumentType5(self.instrument)
self.details = details
[docs] def factory(*args_, **kwargs_):
if high_pressure_freezingType.subclass:
return high_pressure_freezingType.subclass(*args_, **kwargs_)
else:
return high_pressure_freezingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_instrument(self): return self.instrument
[docs] def set_instrument(self, instrument): self.instrument = instrument
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_instrumentType5(self, value):
# Validate type instrumentType5, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['BAL-TEC HPM 010', 'EMS-002 RAPID IMMERSION FREEZER', 'LEICA EM HPM100', 'LEICA EM PACT', 'LEICA EM PACT2']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on instrumentType5' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.instrument is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_pressure_freezingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_pressure_freezingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_pressure_freezingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_pressure_freezingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_pressure_freezingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.instrument is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sinstrument>%s</%sinstrument>%s' % (namespace_, self.gds_format_string(quote_xml(self.instrument).encode(ExternalEncoding), input_name='instrument'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'instrument':
instrument_ = child_.text
instrument_ = re_.sub(String_cleanup_pat_, " ", instrument_).strip()
instrument_ = self.gds_validate_string(instrument_, node, 'instrument')
self.instrument = instrument_
# validate type instrumentType5
self.validate_instrumentType5(self.instrument)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class high_pressure_freezingType
[docs]class sectioningType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('ultramicrotomy', 'ultramicrotomyType', 0),
MemberSpec_('focused_ion_beam', 'focused_ion_beamType', 0),
MemberSpec_('other_sectioning', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, ultramicrotomy=None, focused_ion_beam=None, other_sectioning=None):
self.original_tagname_ = None
self.ultramicrotomy = ultramicrotomy
self.focused_ion_beam = focused_ion_beam
self.other_sectioning = other_sectioning
[docs] def factory(*args_, **kwargs_):
if sectioningType.subclass:
return sectioningType.subclass(*args_, **kwargs_)
else:
return sectioningType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ultramicrotomy(self): return self.ultramicrotomy
[docs] def set_ultramicrotomy(self, ultramicrotomy): self.ultramicrotomy = ultramicrotomy
[docs] def get_focused_ion_beam(self): return self.focused_ion_beam
[docs] def set_focused_ion_beam(self, focused_ion_beam): self.focused_ion_beam = focused_ion_beam
[docs] def get_other_sectioning(self): return self.other_sectioning
[docs] def set_other_sectioning(self, other_sectioning): self.other_sectioning = other_sectioning
[docs] def hasContent_(self):
if (
self.ultramicrotomy is not None or
self.focused_ion_beam is not None or
self.other_sectioning is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sectioningType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sectioningType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sectioningType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sectioningType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sectioningType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.ultramicrotomy is not None:
self.ultramicrotomy.export(outfile, level, namespace_, name_='ultramicrotomy', pretty_print=pretty_print)
if self.focused_ion_beam is not None:
self.focused_ion_beam.export(outfile, level, namespace_, name_='focused_ion_beam', pretty_print=pretty_print)
if self.other_sectioning is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother_sectioning>%s</%sother_sectioning>%s' % (namespace_, self.gds_format_string(quote_xml(self.other_sectioning).encode(ExternalEncoding), input_name='other_sectioning'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'ultramicrotomy':
obj_ = ultramicrotomyType.factory()
obj_.build(child_)
self.ultramicrotomy = obj_
obj_.original_tagname_ = 'ultramicrotomy'
elif nodeName_ == 'focused_ion_beam':
obj_ = focused_ion_beamType.factory()
obj_.build(child_)
self.focused_ion_beam = obj_
obj_.original_tagname_ = 'focused_ion_beam'
elif nodeName_ == 'other_sectioning':
other_sectioning_ = child_.text
other_sectioning_ = self.gds_validate_string(other_sectioning_, node, 'other_sectioning')
self.other_sectioning = other_sectioning_
# end class sectioningType
[docs]class ultramicrotomyType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('instrument', 'xs:token', 0),
MemberSpec_('temperature', 'temperature_type', 0),
MemberSpec_('final_thickness', 'ultramicrotomy_final_thickness_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, instrument=None, temperature=None, final_thickness=None, details=None):
self.original_tagname_ = None
self.instrument = instrument
self.temperature = temperature
self.final_thickness = final_thickness
self.details = details
[docs] def factory(*args_, **kwargs_):
if ultramicrotomyType.subclass:
return ultramicrotomyType.subclass(*args_, **kwargs_)
else:
return ultramicrotomyType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_instrument(self): return self.instrument
[docs] def set_instrument(self, instrument): self.instrument = instrument
[docs] def get_temperature(self): return self.temperature
[docs] def set_temperature(self, temperature): self.temperature = temperature
[docs] def get_final_thickness(self): return self.final_thickness
[docs] def set_final_thickness(self, final_thickness): self.final_thickness = final_thickness
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.instrument is not None or
self.temperature is not None or
self.final_thickness is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='ultramicrotomyType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='ultramicrotomyType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='ultramicrotomyType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ultramicrotomyType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ultramicrotomyType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.instrument is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sinstrument>%s</%sinstrument>%s' % (namespace_, self.gds_format_string(quote_xml(self.instrument).encode(ExternalEncoding), input_name='instrument'), namespace_, eol_))
if self.temperature is not None:
self.temperature.export(outfile, level, namespace_, name_='temperature', pretty_print=pretty_print)
if self.final_thickness is not None:
self.final_thickness.export(outfile, level, namespace_, name_='final_thickness', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'instrument':
instrument_ = child_.text
instrument_ = re_.sub(String_cleanup_pat_, " ", instrument_).strip()
instrument_ = self.gds_validate_string(instrument_, node, 'instrument')
self.instrument = instrument_
elif nodeName_ == 'temperature':
obj_ = temperature_type.factory()
obj_.build(child_)
self.temperature = obj_
obj_.original_tagname_ = 'temperature'
elif nodeName_ == 'final_thickness':
obj_ = ultramicrotomy_final_thickness_type.factory()
obj_.build(child_)
self.final_thickness = obj_
obj_.original_tagname_ = 'final_thickness'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class ultramicrotomyType
[docs]class focused_ion_beamType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('instrument', ['instrumentType6', 'xs:token'], 0),
MemberSpec_('ion', ['ionType', 'xs:token'], 0),
MemberSpec_('voltage', 'fib_voltage_type', 0),
MemberSpec_('current', 'fib_current_type', 0),
MemberSpec_('dose_rate', 'fib_dose_rate_type', 0),
MemberSpec_('duration', 'fib_duration_type', 0),
MemberSpec_('temperature', 'temperature_type', 0),
MemberSpec_('initial_thickness', 'fib_initial_thickness_type', 0),
MemberSpec_('final_thickness', 'fib_final_thickness_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, instrument=None, ion=None, voltage=None, current=None, dose_rate=None, duration=None, temperature=None, initial_thickness=None, final_thickness=None, details=None):
self.original_tagname_ = None
self.instrument = instrument
self.validate_instrumentType6(self.instrument)
self.ion = ion
self.validate_ionType(self.ion)
self.voltage = voltage
self.current = current
self.dose_rate = dose_rate
self.duration = duration
self.temperature = temperature
self.initial_thickness = initial_thickness
self.final_thickness = final_thickness
self.details = details
[docs] def factory(*args_, **kwargs_):
if focused_ion_beamType.subclass:
return focused_ion_beamType.subclass(*args_, **kwargs_)
else:
return focused_ion_beamType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_instrument(self): return self.instrument
[docs] def set_instrument(self, instrument): self.instrument = instrument
[docs] def get_ion(self): return self.ion
[docs] def set_ion(self, ion): self.ion = ion
[docs] def get_voltage(self): return self.voltage
[docs] def set_voltage(self, voltage): self.voltage = voltage
[docs] def get_current(self): return self.current
[docs] def set_current(self, current): self.current = current
[docs] def get_dose_rate(self): return self.dose_rate
[docs] def set_dose_rate(self, dose_rate): self.dose_rate = dose_rate
[docs] def get_duration(self): return self.duration
[docs] def set_duration(self, duration): self.duration = duration
[docs] def get_temperature(self): return self.temperature
[docs] def set_temperature(self, temperature): self.temperature = temperature
[docs] def get_initial_thickness(self): return self.initial_thickness
[docs] def set_initial_thickness(self, initial_thickness): self.initial_thickness = initial_thickness
[docs] def get_final_thickness(self): return self.final_thickness
[docs] def set_final_thickness(self, final_thickness): self.final_thickness = final_thickness
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_instrumentType6(self, value):
# Validate type instrumentType6, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['DB235']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on instrumentType6' % {"value" : value.encode("utf-8")} )
[docs] def validate_ionType(self, value):
# Validate type ionType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['GALLIUM+']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ionType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.instrument is not None or
self.ion is not None or
self.voltage is not None or
self.current is not None or
self.dose_rate is not None or
self.duration is not None or
self.temperature is not None or
self.initial_thickness is not None or
self.final_thickness is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='focused_ion_beamType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='focused_ion_beamType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='focused_ion_beamType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='focused_ion_beamType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='focused_ion_beamType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.instrument is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sinstrument>%s</%sinstrument>%s' % (namespace_, self.gds_format_string(quote_xml(self.instrument).encode(ExternalEncoding), input_name='instrument'), namespace_, eol_))
if self.ion is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sion>%s</%sion>%s' % (namespace_, self.gds_format_string(quote_xml(self.ion).encode(ExternalEncoding), input_name='ion'), namespace_, eol_))
if self.voltage is not None:
self.voltage.export(outfile, level, namespace_, name_='voltage', pretty_print=pretty_print)
if self.current is not None:
self.current.export(outfile, level, namespace_, name_='current', pretty_print=pretty_print)
if self.dose_rate is not None:
self.dose_rate.export(outfile, level, namespace_, name_='dose_rate', pretty_print=pretty_print)
if self.duration is not None:
self.duration.export(outfile, level, namespace_, name_='duration', pretty_print=pretty_print)
if self.temperature is not None:
self.temperature.export(outfile, level, namespace_, name_='temperature', pretty_print=pretty_print)
if self.initial_thickness is not None:
self.initial_thickness.export(outfile, level, namespace_, name_='initial_thickness', pretty_print=pretty_print)
if self.final_thickness is not None:
self.final_thickness.export(outfile, level, namespace_, name_='final_thickness', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'instrument':
instrument_ = child_.text
instrument_ = re_.sub(String_cleanup_pat_, " ", instrument_).strip()
instrument_ = self.gds_validate_string(instrument_, node, 'instrument')
self.instrument = instrument_
# validate type instrumentType6
self.validate_instrumentType6(self.instrument)
elif nodeName_ == 'ion':
ion_ = child_.text
ion_ = re_.sub(String_cleanup_pat_, " ", ion_).strip()
ion_ = self.gds_validate_string(ion_, node, 'ion')
self.ion = ion_
# validate type ionType
self.validate_ionType(self.ion)
elif nodeName_ == 'voltage':
obj_ = fib_voltage_type.factory()
obj_.build(child_)
self.voltage = obj_
obj_.original_tagname_ = 'voltage'
elif nodeName_ == 'current':
obj_ = fib_current_type.factory()
obj_.build(child_)
self.current = obj_
obj_.original_tagname_ = 'current'
elif nodeName_ == 'dose_rate':
obj_ = fib_dose_rate_type.factory()
obj_.build(child_)
self.dose_rate = obj_
obj_.original_tagname_ = 'dose_rate'
elif nodeName_ == 'duration':
obj_ = fib_duration_type.factory()
obj_.build(child_)
self.duration = obj_
obj_.original_tagname_ = 'duration'
elif nodeName_ == 'temperature':
obj_ = temperature_type.factory()
obj_.build(child_)
self.temperature = obj_
obj_.original_tagname_ = 'temperature'
elif nodeName_ == 'initial_thickness':
obj_ = fib_initial_thickness_type.factory()
obj_.build(child_)
self.initial_thickness = obj_
obj_.original_tagname_ = 'initial_thickness'
elif nodeName_ == 'final_thickness':
obj_ = fib_final_thickness_type.factory()
obj_.build(child_)
self.final_thickness = obj_
obj_.original_tagname_ = 'final_thickness'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class focused_ion_beamType
[docs]class specimen_preparationsType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('specimen_preparation_id', 'xs:positiveInteger', 1),
]
subclass = None
superclass = None
def __init__(self, specimen_preparation_id=None):
self.original_tagname_ = None
if specimen_preparation_id is None:
self.specimen_preparation_id = []
else:
self.specimen_preparation_id = specimen_preparation_id
[docs] def factory(*args_, **kwargs_):
if specimen_preparationsType.subclass:
return specimen_preparationsType.subclass(*args_, **kwargs_)
else:
return specimen_preparationsType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_specimen_preparation_id(self): return self.specimen_preparation_id
[docs] def set_specimen_preparation_id(self, specimen_preparation_id): self.specimen_preparation_id = specimen_preparation_id
[docs] def add_specimen_preparation_id(self, value): self.specimen_preparation_id.append(value)
[docs] def insert_specimen_preparation_id_at(self, index, value): self.specimen_preparation_id.insert(index, value)
[docs] def replace_specimen_preparation_id_at(self, index, value): self.specimen_preparation_id[index] = value
[docs] def hasContent_(self):
if (
self.specimen_preparation_id
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='specimen_preparationsType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='specimen_preparationsType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='specimen_preparationsType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='specimen_preparationsType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='specimen_preparationsType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for specimen_preparation_id_ in self.specimen_preparation_id:
showIndent(outfile, level, pretty_print)
outfile.write('<%sspecimen_preparation_id>%s</%sspecimen_preparation_id>%s' % (namespace_, self.gds_format_integer(specimen_preparation_id_, input_name='specimen_preparation_id'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'specimen_preparation_id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'specimen_preparation_id')
self.specimen_preparation_id.append(ival_)
# end class specimen_preparationsType
[docs]class acceleration_voltageType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_acceleration_voltage', 'xs:positiveInteger'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if acceleration_voltageType.subclass:
return acceleration_voltageType.subclass(*args_, **kwargs_)
else:
return acceleration_voltageType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='acceleration_voltageType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='acceleration_voltageType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='acceleration_voltageType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='acceleration_voltageType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='acceleration_voltageType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class acceleration_voltageType
[docs]class c2_aperture_diameterType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_c2_aperture_diameter', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if c2_aperture_diameterType.subclass:
return c2_aperture_diameterType.subclass(*args_, **kwargs_)
else:
return c2_aperture_diameterType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='c2_aperture_diameterType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='c2_aperture_diameterType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='c2_aperture_diameterType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='c2_aperture_diameterType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='c2_aperture_diameterType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class c2_aperture_diameterType
[docs]class nominal_csType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_nominal_cs', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if nominal_csType.subclass:
return nominal_csType.subclass(*args_, **kwargs_)
else:
return nominal_csType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='nominal_csType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='nominal_csType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='nominal_csType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='nominal_csType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='nominal_csType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class nominal_csType
[docs]class nominal_defocus_minType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_defocus_min', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if nominal_defocus_minType.subclass:
return nominal_defocus_minType.subclass(*args_, **kwargs_)
else:
return nominal_defocus_minType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='nominal_defocus_minType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='nominal_defocus_minType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='nominal_defocus_minType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='nominal_defocus_minType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='nominal_defocus_minType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class nominal_defocus_minType
[docs]class calibrated_defocus_minType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_defocus_min', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if calibrated_defocus_minType.subclass:
return calibrated_defocus_minType.subclass(*args_, **kwargs_)
else:
return calibrated_defocus_minType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='calibrated_defocus_minType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='calibrated_defocus_minType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='calibrated_defocus_minType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='calibrated_defocus_minType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='calibrated_defocus_minType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class calibrated_defocus_minType
[docs]class nominal_defocus_maxType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_defocus_max', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if nominal_defocus_maxType.subclass:
return nominal_defocus_maxType.subclass(*args_, **kwargs_)
else:
return nominal_defocus_maxType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='nominal_defocus_maxType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='nominal_defocus_maxType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='nominal_defocus_maxType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='nominal_defocus_maxType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='nominal_defocus_maxType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class nominal_defocus_maxType
[docs]class calibrated_defocus_maxType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_defocus_max', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if calibrated_defocus_maxType.subclass:
return calibrated_defocus_maxType.subclass(*args_, **kwargs_)
else:
return calibrated_defocus_maxType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='calibrated_defocus_maxType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='calibrated_defocus_maxType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='calibrated_defocus_maxType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='calibrated_defocus_maxType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='calibrated_defocus_maxType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class calibrated_defocus_maxType
[docs]class temperatureType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('temperature_min', 'temperature_minType', 0),
MemberSpec_('temperature_max', 'temperature_maxType', 0),
MemberSpec_('temperature_average', 'temperature_averageType', 0),
]
subclass = None
superclass = None
def __init__(self, temperature_min=None, temperature_max=None, temperature_average=None):
self.original_tagname_ = None
self.temperature_min = temperature_min
self.temperature_max = temperature_max
self.temperature_average = temperature_average
[docs] def factory(*args_, **kwargs_):
if temperatureType.subclass:
return temperatureType.subclass(*args_, **kwargs_)
else:
return temperatureType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_temperature_min(self): return self.temperature_min
[docs] def set_temperature_min(self, temperature_min): self.temperature_min = temperature_min
[docs] def get_temperature_max(self): return self.temperature_max
[docs] def set_temperature_max(self, temperature_max): self.temperature_max = temperature_max
[docs] def get_temperature_average(self): return self.temperature_average
[docs] def set_temperature_average(self, temperature_average): self.temperature_average = temperature_average
[docs] def hasContent_(self):
if (
self.temperature_min is not None or
self.temperature_max is not None or
self.temperature_average is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='temperatureType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='temperatureType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='temperatureType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='temperatureType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='temperatureType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.temperature_min is not None:
self.temperature_min.export(outfile, level, namespace_, name_='temperature_min', pretty_print=pretty_print)
if self.temperature_max is not None:
self.temperature_max.export(outfile, level, namespace_, name_='temperature_max', pretty_print=pretty_print)
if self.temperature_average is not None:
self.temperature_average.export(outfile, level, namespace_, name_='temperature_average', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'temperature_min':
obj_ = temperature_minType.factory()
obj_.build(child_)
self.temperature_min = obj_
obj_.original_tagname_ = 'temperature_min'
elif nodeName_ == 'temperature_max':
obj_ = temperature_maxType.factory()
obj_.build(child_)
self.temperature_max = obj_
obj_.original_tagname_ = 'temperature_max'
elif nodeName_ == 'temperature_average':
obj_ = temperature_averageType.factory()
obj_.build(child_)
self.temperature_average = obj_
obj_.original_tagname_ = 'temperature_average'
# end class temperatureType
[docs]class temperature_minType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['complex_category_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if temperature_minType.subclass:
return temperature_minType.subclass(*args_, **kwargs_)
else:
return temperature_minType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='temperature_minType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='temperature_minType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='temperature_minType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='temperature_minType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='temperature_minType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class temperature_minType
[docs]class temperature_maxType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['complex_category_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if temperature_maxType.subclass:
return temperature_maxType.subclass(*args_, **kwargs_)
else:
return temperature_maxType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='temperature_maxType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='temperature_maxType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='temperature_maxType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='temperature_maxType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='temperature_maxType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class temperature_maxType
[docs]class temperature_averageType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['complex_category_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if temperature_averageType.subclass:
return temperature_averageType.subclass(*args_, **kwargs_)
else:
return temperature_averageType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='temperature_averageType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='temperature_averageType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='temperature_averageType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='temperature_averageType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='temperature_averageType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class temperature_averageType
[docs]class alignment_procedureType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('none', 'noneType', 0),
MemberSpec_('basic', 'basicType', 0),
MemberSpec_('zemlin_tableau', 'zemlin_tableauType', 0),
MemberSpec_('coma_free', 'coma_freeType', 0),
MemberSpec_('other', 'otherType', 0),
MemberSpec_('legacy', 'legacyType', 0),
]
subclass = None
superclass = None
def __init__(self, none=None, basic=None, zemlin_tableau=None, coma_free=None, other=None, legacy=None):
self.original_tagname_ = None
self.none = none
self.basic = basic
self.zemlin_tableau = zemlin_tableau
self.coma_free = coma_free
self.other = other
self.legacy = legacy
[docs] def factory(*args_, **kwargs_):
if alignment_procedureType.subclass:
return alignment_procedureType.subclass(*args_, **kwargs_)
else:
return alignment_procedureType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_none(self): return self.none
[docs] def set_none(self, none): self.none = none
[docs] def get_basic(self): return self.basic
[docs] def set_basic(self, basic): self.basic = basic
[docs] def get_zemlin_tableau(self): return self.zemlin_tableau
[docs] def set_zemlin_tableau(self, zemlin_tableau): self.zemlin_tableau = zemlin_tableau
[docs] def get_coma_free(self): return self.coma_free
[docs] def set_coma_free(self, coma_free): self.coma_free = coma_free
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def get_legacy(self): return self.legacy
[docs] def set_legacy(self, legacy): self.legacy = legacy
[docs] def hasContent_(self):
if (
self.none is not None or
self.basic is not None or
self.zemlin_tableau is not None or
self.coma_free is not None or
self.other is not None or
self.legacy is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='alignment_procedureType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='alignment_procedureType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='alignment_procedureType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='alignment_procedureType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='alignment_procedureType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.none is not None:
self.none.export(outfile, level, namespace_, name_='none', pretty_print=pretty_print)
if self.basic is not None:
self.basic.export(outfile, level, namespace_, name_='basic', pretty_print=pretty_print)
if self.zemlin_tableau is not None:
self.zemlin_tableau.export(outfile, level, namespace_, name_='zemlin_tableau', pretty_print=pretty_print)
if self.coma_free is not None:
self.coma_free.export(outfile, level, namespace_, name_='coma_free', pretty_print=pretty_print)
if self.other is not None:
self.other.export(outfile, level, namespace_, name_='other', pretty_print=pretty_print)
if self.legacy is not None:
self.legacy.export(outfile, level, namespace_, name_='legacy', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'none':
obj_ = noneType.factory()
obj_.build(child_)
self.none = obj_
obj_.original_tagname_ = 'none'
elif nodeName_ == 'basic':
obj_ = basicType.factory()
obj_.build(child_)
self.basic = obj_
obj_.original_tagname_ = 'basic'
elif nodeName_ == 'zemlin_tableau':
obj_ = zemlin_tableauType.factory()
obj_.build(child_)
self.zemlin_tableau = obj_
obj_.original_tagname_ = 'zemlin_tableau'
elif nodeName_ == 'coma_free':
obj_ = coma_freeType.factory()
obj_.build(child_)
self.coma_free = obj_
obj_.original_tagname_ = 'coma_free'
elif nodeName_ == 'other':
obj_ = otherType.factory()
obj_.build(child_)
self.other = obj_
obj_.original_tagname_ = 'other'
elif nodeName_ == 'legacy':
obj_ = legacyType.factory()
obj_.build(child_)
self.legacy = obj_
obj_.original_tagname_ = 'legacy'
# end class alignment_procedureType
[docs]class noneType(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if noneType.subclass:
return noneType.subclass(*args_, **kwargs_)
else:
return noneType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='noneType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='noneType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='noneType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='noneType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='noneType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class noneType
[docs]class basicType(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if basicType.subclass:
return basicType.subclass(*args_, **kwargs_)
else:
return basicType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='basicType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='basicType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='basicType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='basicType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='basicType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class basicType
[docs]class zemlin_tableauType(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if zemlin_tableauType.subclass:
return zemlin_tableauType.subclass(*args_, **kwargs_)
else:
return zemlin_tableauType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='zemlin_tableauType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='zemlin_tableauType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='zemlin_tableauType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='zemlin_tableauType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='zemlin_tableauType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class zemlin_tableauType
[docs]class coma_freeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('residual_tilt', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, residual_tilt=None):
self.original_tagname_ = None
self.residual_tilt = residual_tilt
[docs] def factory(*args_, **kwargs_):
if coma_freeType.subclass:
return coma_freeType.subclass(*args_, **kwargs_)
else:
return coma_freeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_residual_tilt(self): return self.residual_tilt
[docs] def set_residual_tilt(self, residual_tilt): self.residual_tilt = residual_tilt
[docs] def hasContent_(self):
if (
self.residual_tilt is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='coma_freeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='coma_freeType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='coma_freeType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='coma_freeType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='coma_freeType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.residual_tilt is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sresidual_tilt>%s</%sresidual_tilt>%s' % (namespace_, self.gds_format_float(self.residual_tilt, input_name='residual_tilt'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'residual_tilt':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'residual_tilt')
self.residual_tilt = fval_
# end class coma_freeType
[docs]class otherType(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if otherType.subclass:
return otherType.subclass(*args_, **kwargs_)
else:
return otherType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='otherType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='otherType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='otherType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='otherType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='otherType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class otherType
[docs]class legacyType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('astigmatism', 'xs:string', 0),
MemberSpec_('electron_beam_tilt_params', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, astigmatism=None, electron_beam_tilt_params=None):
self.original_tagname_ = None
self.astigmatism = astigmatism
self.electron_beam_tilt_params = electron_beam_tilt_params
[docs] def factory(*args_, **kwargs_):
if legacyType.subclass:
return legacyType.subclass(*args_, **kwargs_)
else:
return legacyType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_astigmatism(self): return self.astigmatism
[docs] def set_astigmatism(self, astigmatism): self.astigmatism = astigmatism
[docs] def get_electron_beam_tilt_params(self): return self.electron_beam_tilt_params
[docs] def set_electron_beam_tilt_params(self, electron_beam_tilt_params): self.electron_beam_tilt_params = electron_beam_tilt_params
[docs] def hasContent_(self):
if (
self.astigmatism is not None or
self.electron_beam_tilt_params is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='legacyType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='legacyType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='legacyType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='legacyType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='legacyType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.astigmatism is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sastigmatism>%s</%sastigmatism>%s' % (namespace_, self.gds_format_string(quote_xml(self.astigmatism).encode(ExternalEncoding), input_name='astigmatism'), namespace_, eol_))
if self.electron_beam_tilt_params is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%selectron_beam_tilt_params>%s</%selectron_beam_tilt_params>%s' % (namespace_, self.gds_format_string(quote_xml(self.electron_beam_tilt_params).encode(ExternalEncoding), input_name='electron_beam_tilt_params'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'astigmatism':
astigmatism_ = child_.text
astigmatism_ = self.gds_validate_string(astigmatism_, node, 'astigmatism')
self.astigmatism = astigmatism_
elif nodeName_ == 'electron_beam_tilt_params':
electron_beam_tilt_params_ = child_.text
electron_beam_tilt_params_ = self.gds_validate_string(electron_beam_tilt_params_, node, 'electron_beam_tilt_params')
self.electron_beam_tilt_params = electron_beam_tilt_params_
# end class legacyType
[docs]class image_recording_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('image_recording', 'image_recordingType', 1),
]
subclass = None
superclass = None
def __init__(self, image_recording=None):
self.original_tagname_ = None
if image_recording is None:
self.image_recording = []
else:
self.image_recording = image_recording
[docs] def factory(*args_, **kwargs_):
if image_recording_listType.subclass:
return image_recording_listType.subclass(*args_, **kwargs_)
else:
return image_recording_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_image_recording(self): return self.image_recording
[docs] def set_image_recording(self, image_recording): self.image_recording = image_recording
[docs] def add_image_recording(self, value): self.image_recording.append(value)
[docs] def insert_image_recording_at(self, index, value): self.image_recording.insert(index, value)
[docs] def replace_image_recording_at(self, index, value): self.image_recording[index] = value
[docs] def hasContent_(self):
if (
self.image_recording
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='image_recording_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='image_recording_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='image_recording_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='image_recording_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='image_recording_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for image_recording_ in self.image_recording:
image_recording_.export(outfile, level, namespace_, name_='image_recording', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'image_recording':
obj_ = image_recordingType.factory()
obj_.build(child_)
self.image_recording.append(obj_)
obj_.original_tagname_ = 'image_recording'
# end class image_recording_listType
[docs]class image_recordingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('film_or_detector_model', 'film_or_detector_modelType', 0),
MemberSpec_('detector_mode', ['detector_modeType', 'xs:token'], 0),
MemberSpec_('digitization_details', 'digitization_detailsType', 0),
MemberSpec_('number_grids_imaged', 'xs:positiveInteger', 0),
MemberSpec_('number_real_images', 'xs:positiveInteger', 0),
MemberSpec_('number_diffraction_images', 'xs:positiveInteger', 0),
MemberSpec_('average_exposure_time', 'average_exposure_timeType', 0),
MemberSpec_('average_electron_dose_per_image', 'average_electron_dose_per_imageType', 0),
MemberSpec_('detector_distance', 'xs:string', 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('od_range', 'xs:float', 0),
MemberSpec_('bits_per_pixel', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, film_or_detector_model=None, detector_mode=None, digitization_details=None, number_grids_imaged=None, number_real_images=None, number_diffraction_images=None, average_exposure_time=None, average_electron_dose_per_image=None, detector_distance=None, details=None, od_range=None, bits_per_pixel=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.film_or_detector_model = film_or_detector_model
self.detector_mode = detector_mode
self.validate_detector_modeType(self.detector_mode)
self.digitization_details = digitization_details
self.number_grids_imaged = number_grids_imaged
self.number_real_images = number_real_images
self.number_diffraction_images = number_diffraction_images
self.average_exposure_time = average_exposure_time
self.average_electron_dose_per_image = average_electron_dose_per_image
self.detector_distance = detector_distance
self.details = details
self.od_range = od_range
self.bits_per_pixel = bits_per_pixel
[docs] def factory(*args_, **kwargs_):
if image_recordingType.subclass:
return image_recordingType.subclass(*args_, **kwargs_)
else:
return image_recordingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_film_or_detector_model(self): return self.film_or_detector_model
[docs] def set_film_or_detector_model(self, film_or_detector_model): self.film_or_detector_model = film_or_detector_model
[docs] def get_detector_mode(self): return self.detector_mode
[docs] def set_detector_mode(self, detector_mode): self.detector_mode = detector_mode
[docs] def get_digitization_details(self): return self.digitization_details
[docs] def set_digitization_details(self, digitization_details): self.digitization_details = digitization_details
[docs] def get_number_grids_imaged(self): return self.number_grids_imaged
[docs] def set_number_grids_imaged(self, number_grids_imaged): self.number_grids_imaged = number_grids_imaged
[docs] def get_number_real_images(self): return self.number_real_images
[docs] def set_number_real_images(self, number_real_images): self.number_real_images = number_real_images
[docs] def get_number_diffraction_images(self): return self.number_diffraction_images
[docs] def set_number_diffraction_images(self, number_diffraction_images): self.number_diffraction_images = number_diffraction_images
[docs] def get_average_exposure_time(self): return self.average_exposure_time
[docs] def set_average_exposure_time(self, average_exposure_time): self.average_exposure_time = average_exposure_time
[docs] def get_average_electron_dose_per_image(self): return self.average_electron_dose_per_image
[docs] def set_average_electron_dose_per_image(self, average_electron_dose_per_image): self.average_electron_dose_per_image = average_electron_dose_per_image
[docs] def get_detector_distance(self): return self.detector_distance
[docs] def set_detector_distance(self, detector_distance): self.detector_distance = detector_distance
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_od_range(self): return self.od_range
[docs] def set_od_range(self, od_range): self.od_range = od_range
[docs] def get_bits_per_pixel(self): return self.bits_per_pixel
[docs] def set_bits_per_pixel(self, bits_per_pixel): self.bits_per_pixel = bits_per_pixel
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def validate_detector_modeType(self, value):
# Validate type detector_modeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['COUNTING', 'INTEGRATING', 'SUPER-RESOLUTION']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on detector_modeType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.film_or_detector_model is not None or
self.detector_mode is not None or
self.digitization_details is not None or
self.number_grids_imaged is not None or
self.number_real_images is not None or
self.number_diffraction_images is not None or
self.average_exposure_time is not None or
self.average_electron_dose_per_image is not None or
self.detector_distance is not None or
self.details is not None or
self.od_range is not None or
self.bits_per_pixel is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='image_recordingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='image_recordingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='image_recordingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='image_recordingType'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='image_recordingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.film_or_detector_model is not None:
self.film_or_detector_model.export(outfile, level, namespace_, name_='film_or_detector_model', pretty_print=pretty_print)
if self.detector_mode is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetector_mode>%s</%sdetector_mode>%s' % (namespace_, self.gds_format_string(quote_xml(self.detector_mode).encode(ExternalEncoding), input_name='detector_mode'), namespace_, eol_))
if self.digitization_details is not None:
self.digitization_details.export(outfile, level, namespace_, name_='digitization_details', pretty_print=pretty_print)
if self.number_grids_imaged is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_grids_imaged>%s</%snumber_grids_imaged>%s' % (namespace_, self.gds_format_integer(self.number_grids_imaged, input_name='number_grids_imaged'), namespace_, eol_))
if self.number_real_images is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_real_images>%s</%snumber_real_images>%s' % (namespace_, self.gds_format_integer(self.number_real_images, input_name='number_real_images'), namespace_, eol_))
if self.number_diffraction_images is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_diffraction_images>%s</%snumber_diffraction_images>%s' % (namespace_, self.gds_format_integer(self.number_diffraction_images, input_name='number_diffraction_images'), namespace_, eol_))
if self.average_exposure_time is not None:
self.average_exposure_time.export(outfile, level, namespace_, name_='average_exposure_time', pretty_print=pretty_print)
if self.average_electron_dose_per_image is not None:
self.average_electron_dose_per_image.export(outfile, level, namespace_, name_='average_electron_dose_per_image', pretty_print=pretty_print)
if self.detector_distance is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetector_distance>%s</%sdetector_distance>%s' % (namespace_, self.gds_format_string(quote_xml(self.detector_distance).encode(ExternalEncoding), input_name='detector_distance'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.od_range is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sod_range>%s</%sod_range>%s' % (namespace_, self.gds_format_float(self.od_range, input_name='od_range'), namespace_, eol_))
if self.bits_per_pixel is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sbits_per_pixel>%s</%sbits_per_pixel>%s' % (namespace_, self.gds_format_float(self.bits_per_pixel, input_name='bits_per_pixel'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'film_or_detector_model':
obj_ = film_or_detector_modelType.factory()
obj_.build(child_)
self.film_or_detector_model = obj_
obj_.original_tagname_ = 'film_or_detector_model'
elif nodeName_ == 'detector_mode':
detector_mode_ = child_.text
detector_mode_ = re_.sub(String_cleanup_pat_, " ", detector_mode_).strip()
detector_mode_ = self.gds_validate_string(detector_mode_, node, 'detector_mode')
self.detector_mode = detector_mode_
# validate type detector_modeType
self.validate_detector_modeType(self.detector_mode)
elif nodeName_ == 'digitization_details':
obj_ = digitization_detailsType.factory()
obj_.build(child_)
self.digitization_details = obj_
obj_.original_tagname_ = 'digitization_details'
elif nodeName_ == 'number_grids_imaged':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_grids_imaged')
self.number_grids_imaged = ival_
elif nodeName_ == 'number_real_images':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_real_images')
self.number_real_images = ival_
elif nodeName_ == 'number_diffraction_images':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_diffraction_images')
self.number_diffraction_images = ival_
elif nodeName_ == 'average_exposure_time':
obj_ = average_exposure_timeType.factory()
obj_.build(child_)
self.average_exposure_time = obj_
obj_.original_tagname_ = 'average_exposure_time'
elif nodeName_ == 'average_electron_dose_per_image':
obj_ = average_electron_dose_per_imageType.factory()
obj_.build(child_)
self.average_electron_dose_per_image = obj_
obj_.original_tagname_ = 'average_electron_dose_per_image'
elif nodeName_ == 'detector_distance':
detector_distance_ = child_.text
detector_distance_ = self.gds_validate_string(detector_distance_, node, 'detector_distance')
self.detector_distance = detector_distance_
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'od_range':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'od_range')
self.od_range = fval_
elif nodeName_ == 'bits_per_pixel':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'bits_per_pixel')
self.bits_per_pixel = fval_
# end class image_recordingType
[docs]class film_or_detector_modelType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('category', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_film_or_detector_model', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, category=None, valueOf_=None):
self.original_tagname_ = None
self.category = _cast(None, category)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if film_or_detector_modelType.subclass:
return film_or_detector_modelType.subclass(*args_, **kwargs_)
else:
return film_or_detector_modelType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_category(self): return self.category
[docs] def set_category(self, category): self.category = category
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='film_or_detector_modelType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='film_or_detector_modelType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='film_or_detector_modelType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='film_or_detector_modelType'):
if self.category is not None and 'category' not in already_processed:
already_processed.add('category')
outfile.write(' category=%s' % (self.gds_format_string(quote_attrib(self.category).encode(ExternalEncoding), input_name='category'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='film_or_detector_modelType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('category', node)
if value is not None and 'category' not in already_processed:
already_processed.add('category')
self.category = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class film_or_detector_modelType
[docs]class digitization_detailsType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('scanner', ['scannerType', 'xs:token'], 0),
MemberSpec_('dimensions', 'dimensionsType', 0),
MemberSpec_('sampling_interval', 'sampling_intervalType', 0),
MemberSpec_('frames_per_image', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, scanner=None, dimensions=None, sampling_interval=None, frames_per_image=None):
self.original_tagname_ = None
self.scanner = scanner
self.validate_scannerType(self.scanner)
self.dimensions = dimensions
self.sampling_interval = sampling_interval
self.frames_per_image = frames_per_image
[docs] def factory(*args_, **kwargs_):
if digitization_detailsType.subclass:
return digitization_detailsType.subclass(*args_, **kwargs_)
else:
return digitization_detailsType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_scanner(self): return self.scanner
[docs] def set_scanner(self, scanner): self.scanner = scanner
[docs] def get_dimensions(self): return self.dimensions
[docs] def set_dimensions(self, dimensions): self.dimensions = dimensions
[docs] def get_sampling_interval(self): return self.sampling_interval
[docs] def set_sampling_interval(self, sampling_interval): self.sampling_interval = sampling_interval
[docs] def get_frames_per_image(self): return self.frames_per_image
[docs] def set_frames_per_image(self, frames_per_image): self.frames_per_image = frames_per_image
[docs] def validate_scannerType(self, value):
# Validate type scannerType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['EIKONIX IEEE 488', 'EMIL 10', 'NIKON COOLSCAN', 'NIKON SUPER COOLSCAN 9000', 'OPTRONICS', 'PATCHWORK DENSITOMETER', 'PERKIN ELMER', 'PRIMESCAN', 'TEMSCAN', 'ZEISS SCAI', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on scannerType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.scanner is not None or
self.dimensions is not None or
self.sampling_interval is not None or
self.frames_per_image is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='digitization_detailsType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='digitization_detailsType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='digitization_detailsType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='digitization_detailsType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='digitization_detailsType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.scanner is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sscanner>%s</%sscanner>%s' % (namespace_, self.gds_format_string(quote_xml(self.scanner).encode(ExternalEncoding), input_name='scanner'), namespace_, eol_))
if self.dimensions is not None:
self.dimensions.export(outfile, level, namespace_, name_='dimensions', pretty_print=pretty_print)
if self.sampling_interval is not None:
self.sampling_interval.export(outfile, level, namespace_, name_='sampling_interval', pretty_print=pretty_print)
if self.frames_per_image is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sframes_per_image>%s</%sframes_per_image>%s' % (namespace_, self.gds_format_integer(self.frames_per_image, input_name='frames_per_image'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'scanner':
scanner_ = child_.text
scanner_ = re_.sub(String_cleanup_pat_, " ", scanner_).strip()
scanner_ = self.gds_validate_string(scanner_, node, 'scanner')
self.scanner = scanner_
# validate type scannerType
self.validate_scannerType(self.scanner)
elif nodeName_ == 'dimensions':
obj_ = dimensionsType.factory()
obj_.build(child_)
self.dimensions = obj_
obj_.original_tagname_ = 'dimensions'
elif nodeName_ == 'sampling_interval':
obj_ = sampling_intervalType.factory()
obj_.build(child_)
self.sampling_interval = obj_
obj_.original_tagname_ = 'sampling_interval'
elif nodeName_ == 'frames_per_image':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'frames_per_image')
self.frames_per_image = ival_
# end class digitization_detailsType
[docs]class dimensionsType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('width', 'widthType', 0),
MemberSpec_('height', 'heightType', 0),
]
subclass = None
superclass = None
def __init__(self, width=None, height=None):
self.original_tagname_ = None
self.width = width
self.height = height
[docs] def factory(*args_, **kwargs_):
if dimensionsType.subclass:
return dimensionsType.subclass(*args_, **kwargs_)
else:
return dimensionsType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_height(self): return self.height
[docs] def set_height(self, height): self.height = height
[docs] def hasContent_(self):
if (
self.width is not None or
self.height is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='dimensionsType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='dimensionsType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='dimensionsType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='dimensionsType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='dimensionsType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.width is not None:
self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
if self.height is not None:
self.height.export(outfile, level, namespace_, name_='height', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'width':
obj_ = widthType.factory()
obj_.build(child_)
self.width = obj_
obj_.original_tagname_ = 'width'
elif nodeName_ == 'height':
obj_ = heightType.factory()
obj_.build(child_)
self.height = obj_
obj_.original_tagname_ = 'height'
# end class dimensionsType
[docs]class widthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if widthType.subclass:
return widthType.subclass(*args_, **kwargs_)
else:
return widthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='widthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='widthType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='widthType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='widthType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='widthType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class widthType
[docs]class heightType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if heightType.subclass:
return heightType.subclass(*args_, **kwargs_)
else:
return heightType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='heightType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='heightType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='heightType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='heightType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='heightType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class heightType
[docs]class sampling_intervalType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_scaning_interval', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if sampling_intervalType.subclass:
return sampling_intervalType.subclass(*args_, **kwargs_)
else:
return sampling_intervalType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sampling_intervalType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sampling_intervalType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='sampling_intervalType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sampling_intervalType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sampling_intervalType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class sampling_intervalType
[docs]class average_exposure_timeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_average_exposure_time_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if average_exposure_timeType.subclass:
return average_exposure_timeType.subclass(*args_, **kwargs_)
else:
return average_exposure_timeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='average_exposure_timeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='average_exposure_timeType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='average_exposure_timeType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='average_exposure_timeType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='average_exposure_timeType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class average_exposure_timeType
[docs]class average_electron_dose_per_imageType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_electron_dose', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if average_electron_dose_per_imageType.subclass:
return average_electron_dose_per_imageType.subclass(*args_, **kwargs_)
else:
return average_electron_dose_per_imageType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='average_electron_dose_per_imageType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='average_electron_dose_per_imageType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='average_electron_dose_per_imageType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='average_electron_dose_per_imageType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='average_electron_dose_per_imageType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class average_electron_dose_per_imageType
[docs]class min_angleType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_angle_tomography', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if min_angleType.subclass:
return min_angleType.subclass(*args_, **kwargs_)
else:
return min_angleType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='min_angleType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='min_angleType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='min_angleType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='min_angleType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='min_angleType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class min_angleType
[docs]class max_angleType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_angle_tomography', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if max_angleType.subclass:
return max_angleType.subclass(*args_, **kwargs_)
else:
return max_angleType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='max_angleType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='max_angleType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='max_angleType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='max_angleType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='max_angleType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class max_angleType
[docs]class angle_incrementType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_angle_increment', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if angle_incrementType.subclass:
return angle_incrementType.subclass(*args_, **kwargs_)
else:
return angle_incrementType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angle_incrementType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angle_incrementType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='angle_incrementType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angle_incrementType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angle_incrementType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class angle_incrementType
[docs]class axis2Type(axis_type):
member_data_items_ = [
MemberSpec_('axis_rotation', 'xs:string', 0),
]
subclass = None
superclass = axis_type
def __init__(self, min_angle=None, max_angle=None, angle_increment=None, axis_rotation=None):
self.original_tagname_ = None
super(axis2Type, self).__init__(min_angle, max_angle, angle_increment, )
self.axis_rotation = axis_rotation
[docs] def factory(*args_, **kwargs_):
if axis2Type.subclass:
return axis2Type.subclass(*args_, **kwargs_)
else:
return axis2Type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_axis_rotation(self): return self.axis_rotation
[docs] def set_axis_rotation(self, axis_rotation): self.axis_rotation = axis_rotation
[docs] def hasContent_(self):
if (
self.axis_rotation is not None or
super(axis2Type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='axis2Type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='axis2Type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='axis2Type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='axis2Type'):
super(axis2Type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='axis2Type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='axis2Type', fromsubclass_=False, pretty_print=True):
super(axis2Type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.axis_rotation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saxis_rotation>%s</%saxis_rotation>%s' % (namespace_, self.gds_format_string(quote_xml(self.axis_rotation).encode(ExternalEncoding), input_name='axis_rotation'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(axis2Type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'axis_rotation':
axis_rotation_ = child_.text
axis_rotation_ = self.gds_validate_string(axis_rotation_, node, 'axis_rotation')
self.axis_rotation = axis_rotation_
super(axis2Type, self).buildChildren(child_, node, nodeName_, True)
# end class axis2Type
[docs]class axis_rotation(GeneratedsSuper):
"""Rotation of axis relative to axis1"""
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if axis_rotation.subclass:
return axis_rotation.subclass(*args_, **kwargs_)
else:
return axis_rotation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='axis_rotation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='axis_rotation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='axis_rotation', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='axis_rotation'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='axis_rotation', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class axis_rotation
[docs]class axis_rotationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if axis_rotationType.subclass:
return axis_rotationType.subclass(*args_, **kwargs_)
else:
return axis_rotationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='axis_rotationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='axis_rotationType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='axis_rotationType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='axis_rotationType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='axis_rotationType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class axis_rotationType
[docs]class camera_lengthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_camera_length', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if camera_lengthType.subclass:
return camera_lengthType.subclass(*args_, **kwargs_)
else:
return camera_lengthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='camera_lengthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='camera_lengthType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='camera_lengthType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='camera_lengthType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='camera_lengthType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class camera_lengthType
[docs]class tilt_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('angle', ['angleType7', 'xs:float'], 1),
]
subclass = None
superclass = None
def __init__(self, angle=None):
self.original_tagname_ = None
if angle is None:
self.angle = []
else:
self.angle = angle
[docs] def factory(*args_, **kwargs_):
if tilt_listType.subclass:
return tilt_listType.subclass(*args_, **kwargs_)
else:
return tilt_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_angle(self): return self.angle
[docs] def set_angle(self, angle): self.angle = angle
[docs] def add_angle(self, value): self.angle.append(value)
[docs] def insert_angle_at(self, index, value): self.angle.insert(index, value)
[docs] def replace_angle_at(self, index, value): self.angle[index] = value
[docs] def validate_angleType7(self, value):
# Validate type angleType7, a restriction on xs:float.
if value is not None and Validate_simpletypes_:
if value < -70:
warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on angleType7' % {"value" : value} )
if value > 70:
warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on angleType7' % {"value" : value} )
[docs] def hasContent_(self):
if (
self.angle
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for angle_ in self.angle:
showIndent(outfile, level, pretty_print)
outfile.write('<%sangle>%s</%sangle>%s' % (namespace_, self.gds_format_float(angle_, input_name='angle'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'angle':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'angle')
self.angle.append(fval_)
# validate type angleType7
self.validate_angleType7(self.angle[-1])
# end class tilt_listType
[docs]class resolutionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, type_=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if resolutionType.subclass:
return resolutionType.subclass(*args_, **kwargs_)
else:
return resolutionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='resolutionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='resolutionType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='resolutionType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='resolutionType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='resolutionType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
[docs]class film_thicknessType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_film_thickness', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if film_thicknessType.subclass:
return film_thicknessType.subclass(*args_, **kwargs_)
else:
return film_thicknessType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='film_thicknessType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='film_thicknessType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='film_thicknessType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='film_thicknessType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='film_thicknessType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class film_thicknessType
[docs]class spatial_frequencyType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, valueOf_=None):
self.original_tagname_ = None
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if spatial_frequencyType.subclass:
return spatial_frequencyType.subclass(*args_, **kwargs_)
else:
return spatial_frequencyType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='spatial_frequencyType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='spatial_frequencyType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='spatial_frequencyType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='spatial_frequencyType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='spatial_frequencyType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class spatial_frequencyType
[docs]class phase_reversalType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('anisotropic', 'xs:boolean', 0),
MemberSpec_('correction_space', ['correction_space_type', 'xs:string'], 0),
]
subclass = None
superclass = None
def __init__(self, anisotropic=None, correction_space=None):
self.original_tagname_ = None
self.anisotropic = anisotropic
self.correction_space = correction_space
self.validate_correction_space_type(self.correction_space)
[docs] def factory(*args_, **kwargs_):
if phase_reversalType.subclass:
return phase_reversalType.subclass(*args_, **kwargs_)
else:
return phase_reversalType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_anisotropic(self): return self.anisotropic
[docs] def set_anisotropic(self, anisotropic): self.anisotropic = anisotropic
[docs] def get_correction_space(self): return self.correction_space
[docs] def set_correction_space(self, correction_space): self.correction_space = correction_space
[docs] def validate_correction_space_type(self, value):
# Validate type correction_space_type, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['2D', '3D']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on correction_space_type' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.anisotropic is not None or
self.correction_space is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='phase_reversalType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='phase_reversalType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='phase_reversalType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='phase_reversalType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='phase_reversalType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.anisotropic is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sanisotropic>%s</%sanisotropic>%s' % (namespace_, self.gds_format_boolean(self.anisotropic, input_name='anisotropic'), namespace_, eol_))
if self.correction_space is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scorrection_space>%s</%scorrection_space>%s' % (namespace_, self.gds_format_string(quote_xml(self.correction_space).encode(ExternalEncoding), input_name='correction_space'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'anisotropic':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'anisotropic')
self.anisotropic = ival_
elif nodeName_ == 'correction_space':
correction_space_ = child_.text
correction_space_ = self.gds_validate_string(correction_space_, node, 'correction_space')
self.correction_space = correction_space_
# validate type correction_space_type
self.validate_correction_space_type(self.correction_space)
# end class phase_reversalType
[docs]class amplitude_correctionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('factor', 'xs:float', 0),
MemberSpec_('correction_space', ['correction_space_type', 'xs:string'], 0),
]
subclass = None
superclass = None
def __init__(self, factor=None, correction_space=None):
self.original_tagname_ = None
self.factor = factor
self.correction_space = correction_space
self.validate_correction_space_type(self.correction_space)
[docs] def factory(*args_, **kwargs_):
if amplitude_correctionType.subclass:
return amplitude_correctionType.subclass(*args_, **kwargs_)
else:
return amplitude_correctionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_factor(self): return self.factor
[docs] def set_factor(self, factor): self.factor = factor
[docs] def get_correction_space(self): return self.correction_space
[docs] def set_correction_space(self, correction_space): self.correction_space = correction_space
[docs] def validate_correction_space_type(self, value):
# Validate type correction_space_type, a restriction on xs:string.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['2D', '3D']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on correction_space_type' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.factor is not None or
self.correction_space is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='amplitude_correctionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='amplitude_correctionType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='amplitude_correctionType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='amplitude_correctionType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='amplitude_correctionType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.factor is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfactor>%s</%sfactor>%s' % (namespace_, self.gds_format_float(self.factor, input_name='factor'), namespace_, eol_))
if self.correction_space is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scorrection_space>%s</%scorrection_space>%s' % (namespace_, self.gds_format_string(quote_xml(self.correction_space).encode(ExternalEncoding), input_name='correction_space'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'factor':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'factor')
self.factor = fval_
elif nodeName_ == 'correction_space':
correction_space_ = child_.text
correction_space_ = self.gds_validate_string(correction_space_, node, 'correction_space')
self.correction_space = correction_space_
# validate type correction_space_type
self.validate_correction_space_type(self.correction_space)
# end class amplitude_correctionType
[docs]class projection_matching_processingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_reference_projections', 'xs:positiveInteger', 0),
MemberSpec_('merit_function', 'xs:token', 0),
MemberSpec_('angular_sampling', 'angular_samplingType', 0),
]
subclass = None
superclass = None
def __init__(self, number_reference_projections=None, merit_function=None, angular_sampling=None):
self.original_tagname_ = None
self.number_reference_projections = number_reference_projections
self.merit_function = merit_function
self.angular_sampling = angular_sampling
[docs] def factory(*args_, **kwargs_):
if projection_matching_processingType.subclass:
return projection_matching_processingType.subclass(*args_, **kwargs_)
else:
return projection_matching_processingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_reference_projections(self): return self.number_reference_projections
[docs] def set_number_reference_projections(self, number_reference_projections): self.number_reference_projections = number_reference_projections
[docs] def get_merit_function(self): return self.merit_function
[docs] def set_merit_function(self, merit_function): self.merit_function = merit_function
[docs] def get_angular_sampling(self): return self.angular_sampling
[docs] def set_angular_sampling(self, angular_sampling): self.angular_sampling = angular_sampling
[docs] def hasContent_(self):
if (
self.number_reference_projections is not None or
self.merit_function is not None or
self.angular_sampling is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='projection_matching_processingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='projection_matching_processingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='projection_matching_processingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='projection_matching_processingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='projection_matching_processingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_reference_projections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_reference_projections>%s</%snumber_reference_projections>%s' % (namespace_, self.gds_format_integer(self.number_reference_projections, input_name='number_reference_projections'), namespace_, eol_))
if self.merit_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smerit_function>%s</%smerit_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.merit_function).encode(ExternalEncoding), input_name='merit_function'), namespace_, eol_))
if self.angular_sampling is not None:
self.angular_sampling.export(outfile, level, namespace_, name_='angular_sampling', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_reference_projections':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_reference_projections')
self.number_reference_projections = ival_
elif nodeName_ == 'merit_function':
merit_function_ = child_.text
merit_function_ = re_.sub(String_cleanup_pat_, " ", merit_function_).strip()
merit_function_ = self.gds_validate_string(merit_function_, node, 'merit_function')
self.merit_function = merit_function_
elif nodeName_ == 'angular_sampling':
obj_ = angular_samplingType.factory()
obj_.build(child_)
self.angular_sampling = obj_
obj_.original_tagname_ = 'angular_sampling'
# end class projection_matching_processingType
[docs]class angular_samplingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_angular_sampling', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if angular_samplingType.subclass:
return angular_samplingType.subclass(*args_, **kwargs_)
else:
return angular_samplingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angular_samplingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angular_samplingType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='angular_samplingType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angular_samplingType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angular_samplingType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class angular_samplingType
[docs]class initial_modelType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('access_code', ['access_codeType', 'pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain', 'chainType', 1),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, access_code=None, chain=None, details=None):
self.original_tagname_ = None
self.access_code = access_code
self.validate_access_codeType(self.access_code)
if chain is None:
self.chain = []
else:
self.chain = chain
self.details = details
[docs] def factory(*args_, **kwargs_):
if initial_modelType.subclass:
return initial_modelType.subclass(*args_, **kwargs_)
else:
return initial_modelType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_access_code(self): return self.access_code
[docs] def set_access_code(self, access_code): self.access_code = access_code
[docs] def get_chain(self): return self.chain
[docs] def set_chain(self, chain): self.chain = chain
[docs] def add_chain(self, value): self.chain.append(value)
[docs] def insert_chain_at(self, index, value): self.chain.insert(index, value)
[docs] def replace_chain_at(self, index, value): self.chain[index] = value
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_access_codeType(self, value):
# Validate type access_codeType, a restriction on pdb_code_type.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_access_codeType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_access_codeType_patterns_, ))
validate_access_codeType_patterns_ = [['^\\d[\\dA-Za-z]{3}$'], ['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.access_code is not None or
self.chain or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='initial_modelType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='initial_modelType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='initial_modelType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='initial_modelType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='initial_modelType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.access_code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saccess_code>%s</%saccess_code>%s' % (namespace_, self.gds_format_string(quote_xml(self.access_code).encode(ExternalEncoding), input_name='access_code'), namespace_, eol_))
for chain_ in self.chain:
chain_.export(outfile, level, namespace_, name_='chain', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'access_code':
access_code_ = child_.text
access_code_ = re_.sub(String_cleanup_pat_, " ", access_code_).strip()
access_code_ = self.gds_validate_string(access_code_, node, 'access_code')
self.access_code = access_code_
# validate type access_codeType
self.validate_access_codeType(self.access_code)
elif nodeName_ == 'chain':
obj_ = chainType.factory()
obj_.build(child_)
self.chain.append(obj_)
obj_.original_tagname_ = 'chain'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class initial_modelType
[docs]class chainType(chain_model_type):
member_data_items_ = [
MemberSpec_('number_of_copies_in_final_model', 'xs:positiveInteger', 0),
]
subclass = None
superclass = chain_model_type
def __init__(self, id=None, residue_range=None, number_of_copies_in_final_model=None):
self.original_tagname_ = None
super(chainType, self).__init__(id, residue_range, )
self.number_of_copies_in_final_model = number_of_copies_in_final_model
[docs] def factory(*args_, **kwargs_):
if chainType.subclass:
return chainType.subclass(*args_, **kwargs_)
else:
return chainType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_of_copies_in_final_model(self): return self.number_of_copies_in_final_model
[docs] def set_number_of_copies_in_final_model(self, number_of_copies_in_final_model): self.number_of_copies_in_final_model = number_of_copies_in_final_model
[docs] def hasContent_(self):
if (
self.number_of_copies_in_final_model is not None or
super(chainType, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chainType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chainType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='chainType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chainType'):
super(chainType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='chainType')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chainType', fromsubclass_=False, pretty_print=True):
super(chainType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_of_copies_in_final_model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_of_copies_in_final_model>%s</%snumber_of_copies_in_final_model>%s' % (namespace_, self.gds_format_integer(self.number_of_copies_in_final_model, input_name='number_of_copies_in_final_model'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(chainType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_of_copies_in_final_model':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_of_copies_in_final_model')
self.number_of_copies_in_final_model = ival_
super(chainType, self).buildChildren(child_, node, nodeName_, True)
# end class chainType
[docs]class final_modelType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('access_code', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain', 'chain_model_type', 1),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, access_code=None, chain=None, details=None):
self.original_tagname_ = None
self.access_code = access_code
self.validate_pdb_code_type(self.access_code)
if chain is None:
self.chain = []
else:
self.chain = chain
self.details = details
[docs] def factory(*args_, **kwargs_):
if final_modelType.subclass:
return final_modelType.subclass(*args_, **kwargs_)
else:
return final_modelType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_access_code(self): return self.access_code
[docs] def set_access_code(self, access_code): self.access_code = access_code
[docs] def get_chain(self): return self.chain
[docs] def set_chain(self, chain): self.chain = chain
[docs] def add_chain(self, value): self.chain.append(value)
[docs] def insert_chain_at(self, index, value): self.chain.insert(index, value)
[docs] def replace_chain_at(self, index, value): self.chain[index] = value
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.access_code is not None or
self.chain or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='final_modelType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='final_modelType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='final_modelType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='final_modelType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='final_modelType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.access_code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saccess_code>%s</%saccess_code>%s' % (namespace_, self.gds_format_string(quote_xml(self.access_code).encode(ExternalEncoding), input_name='access_code'), namespace_, eol_))
for chain_ in self.chain:
chain_.export(outfile, level, namespace_, name_='chain', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'access_code':
access_code_ = child_.text
access_code_ = re_.sub(String_cleanup_pat_, " ", access_code_).strip()
access_code_ = self.gds_validate_string(access_code_, node, 'access_code')
self.access_code = access_code_
# validate type pdb_code_type
self.validate_pdb_code_type(self.access_code)
elif nodeName_ == 'chain':
class_obj_ = self.get_class_obj_(child_, chain_model_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.chain.append(obj_)
obj_.original_tagname_ = 'chain'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class final_modelType
[docs]class parametersType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('in_plane_translation', 'xs:string', 0),
MemberSpec_('in_plane_rotation', 'xs:string', 0),
MemberSpec_('out_of_plane_rotation', 'xs:string', 0),
MemberSpec_('model_heterogeneity', 'model_heterogeneityType', 0),
MemberSpec_('other', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, in_plane_translation=None, in_plane_rotation=None, out_of_plane_rotation=None, model_heterogeneity=None, other=None):
self.original_tagname_ = None
self.in_plane_translation = in_plane_translation
self.in_plane_rotation = in_plane_rotation
self.out_of_plane_rotation = out_of_plane_rotation
self.model_heterogeneity = model_heterogeneity
self.other = other
[docs] def factory(*args_, **kwargs_):
if parametersType.subclass:
return parametersType.subclass(*args_, **kwargs_)
else:
return parametersType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_in_plane_translation(self): return self.in_plane_translation
[docs] def set_in_plane_translation(self, in_plane_translation): self.in_plane_translation = in_plane_translation
[docs] def get_in_plane_rotation(self): return self.in_plane_rotation
[docs] def set_in_plane_rotation(self, in_plane_rotation): self.in_plane_rotation = in_plane_rotation
[docs] def get_out_of_plane_rotation(self): return self.out_of_plane_rotation
[docs] def set_out_of_plane_rotation(self, out_of_plane_rotation): self.out_of_plane_rotation = out_of_plane_rotation
[docs] def get_model_heterogeneity(self): return self.model_heterogeneity
[docs] def set_model_heterogeneity(self, model_heterogeneity): self.model_heterogeneity = model_heterogeneity
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def hasContent_(self):
if (
self.in_plane_translation is not None or
self.in_plane_rotation is not None or
self.out_of_plane_rotation is not None or
self.model_heterogeneity is not None or
self.other is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='parametersType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='parametersType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='parametersType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='parametersType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='parametersType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.in_plane_translation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sin_plane_translation>%s</%sin_plane_translation>%s' % (namespace_, self.gds_format_string(quote_xml(self.in_plane_translation).encode(ExternalEncoding), input_name='in_plane_translation'), namespace_, eol_))
if self.in_plane_rotation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sin_plane_rotation>%s</%sin_plane_rotation>%s' % (namespace_, self.gds_format_string(quote_xml(self.in_plane_rotation).encode(ExternalEncoding), input_name='in_plane_rotation'), namespace_, eol_))
if self.out_of_plane_rotation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sout_of_plane_rotation>%s</%sout_of_plane_rotation>%s' % (namespace_, self.gds_format_string(quote_xml(self.out_of_plane_rotation).encode(ExternalEncoding), input_name='out_of_plane_rotation'), namespace_, eol_))
if self.model_heterogeneity is not None:
self.model_heterogeneity.export(outfile, level, namespace_, name_='model_heterogeneity', pretty_print=pretty_print)
if self.other is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother>%s</%sother>%s' % (namespace_, self.gds_format_string(quote_xml(self.other).encode(ExternalEncoding), input_name='other'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'in_plane_translation':
in_plane_translation_ = child_.text
in_plane_translation_ = self.gds_validate_string(in_plane_translation_, node, 'in_plane_translation')
self.in_plane_translation = in_plane_translation_
elif nodeName_ == 'in_plane_rotation':
in_plane_rotation_ = child_.text
in_plane_rotation_ = self.gds_validate_string(in_plane_rotation_, node, 'in_plane_rotation')
self.in_plane_rotation = in_plane_rotation_
elif nodeName_ == 'out_of_plane_rotation':
out_of_plane_rotation_ = child_.text
out_of_plane_rotation_ = self.gds_validate_string(out_of_plane_rotation_, node, 'out_of_plane_rotation')
self.out_of_plane_rotation = out_of_plane_rotation_
elif nodeName_ == 'model_heterogeneity':
obj_ = model_heterogeneityType.factory()
obj_.build(child_)
self.model_heterogeneity = obj_
obj_.original_tagname_ = 'model_heterogeneity'
elif nodeName_ == 'other':
other_ = child_.text
other_ = self.gds_validate_string(other_, node, 'other')
self.other = other_
# end class parametersType
[docs]class in_plane_translation(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if in_plane_translation.subclass:
return in_plane_translation.subclass(*args_, **kwargs_)
else:
return in_plane_translation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='in_plane_translation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='in_plane_translation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='in_plane_translation', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='in_plane_translation'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='in_plane_translation', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class in_plane_translation
[docs]class in_plane_rotation(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if in_plane_rotation.subclass:
return in_plane_rotation.subclass(*args_, **kwargs_)
else:
return in_plane_rotation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='in_plane_rotation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='in_plane_rotation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='in_plane_rotation', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='in_plane_rotation'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='in_plane_rotation', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class in_plane_rotation
[docs]class out_of_plane_rotation(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if out_of_plane_rotation.subclass:
return out_of_plane_rotation.subclass(*args_, **kwargs_)
else:
return out_of_plane_rotation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='out_of_plane_rotation', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='out_of_plane_rotation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='out_of_plane_rotation', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='out_of_plane_rotation'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='out_of_plane_rotation', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class out_of_plane_rotation
[docs]class other(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if other.subclass:
return other.subclass(*args_, **kwargs_)
else:
return other(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='other', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='other')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='other', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='other'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='other', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class other
[docs]class model_heterogeneityType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_classes', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_classes=None):
self.original_tagname_ = None
self.number_classes = number_classes
[docs] def factory(*args_, **kwargs_):
if model_heterogeneityType.subclass:
return model_heterogeneityType.subclass(*args_, **kwargs_)
else:
return model_heterogeneityType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_classes(self): return self.number_classes
[docs] def set_number_classes(self, number_classes): self.number_classes = number_classes
[docs] def hasContent_(self):
if (
self.number_classes is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='model_heterogeneityType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='model_heterogeneityType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='model_heterogeneityType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='model_heterogeneityType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='model_heterogeneityType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_classes is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_classes>%s</%snumber_classes>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_classes).encode(ExternalEncoding), input_name='number_classes'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_classes':
number_classes_ = child_.text
number_classes_ = self.gds_validate_string(number_classes_, node, 'number_classes')
self.number_classes = number_classes_
# end class model_heterogeneityType
[docs]class number_classes(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if number_classes.subclass:
return number_classes.subclass(*args_, **kwargs_)
else:
return number_classes(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='number_classes', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='number_classes')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='number_classes', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='number_classes'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='number_classes', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class number_classes
[docs]class noise_modelType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('white_gaussian', 'xs:string', 0),
MemberSpec_('coloured_gaussian', 'xs:string', 0),
MemberSpec_('other', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, white_gaussian=None, coloured_gaussian=None, other=None):
self.original_tagname_ = None
self.white_gaussian = white_gaussian
self.coloured_gaussian = coloured_gaussian
self.other = other
[docs] def factory(*args_, **kwargs_):
if noise_modelType.subclass:
return noise_modelType.subclass(*args_, **kwargs_)
else:
return noise_modelType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_white_gaussian(self): return self.white_gaussian
[docs] def set_white_gaussian(self, white_gaussian): self.white_gaussian = white_gaussian
[docs] def get_coloured_gaussian(self): return self.coloured_gaussian
[docs] def set_coloured_gaussian(self, coloured_gaussian): self.coloured_gaussian = coloured_gaussian
[docs] def get_other(self): return self.other
[docs] def set_other(self, other): self.other = other
[docs] def hasContent_(self):
if (
self.white_gaussian is not None or
self.coloured_gaussian is not None or
self.other is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='noise_modelType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='noise_modelType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='noise_modelType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='noise_modelType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='noise_modelType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.white_gaussian is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%swhite_gaussian>%s</%swhite_gaussian>%s' % (namespace_, self.gds_format_string(quote_xml(self.white_gaussian).encode(ExternalEncoding), input_name='white_gaussian'), namespace_, eol_))
if self.coloured_gaussian is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scoloured_gaussian>%s</%scoloured_gaussian>%s' % (namespace_, self.gds_format_string(quote_xml(self.coloured_gaussian).encode(ExternalEncoding), input_name='coloured_gaussian'), namespace_, eol_))
if self.other is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sother>%s</%sother>%s' % (namespace_, self.gds_format_string(quote_xml(self.other).encode(ExternalEncoding), input_name='other'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'white_gaussian':
white_gaussian_ = child_.text
white_gaussian_ = self.gds_validate_string(white_gaussian_, node, 'white_gaussian')
self.white_gaussian = white_gaussian_
elif nodeName_ == 'coloured_gaussian':
coloured_gaussian_ = child_.text
coloured_gaussian_ = self.gds_validate_string(coloured_gaussian_, node, 'coloured_gaussian')
self.coloured_gaussian = coloured_gaussian_
elif nodeName_ == 'other':
other_ = child_.text
other_ = self.gds_validate_string(other_, node, 'other')
self.other = other_
# end class noise_modelType
[docs]class white_gaussian(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if white_gaussian.subclass:
return white_gaussian.subclass(*args_, **kwargs_)
else:
return white_gaussian(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='white_gaussian', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='white_gaussian')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='white_gaussian', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='white_gaussian'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='white_gaussian', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class white_gaussian
[docs]class coloured_gaussian(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if coloured_gaussian.subclass:
return coloured_gaussian.subclass(*args_, **kwargs_)
else:
return coloured_gaussian(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='coloured_gaussian', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='coloured_gaussian')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='coloured_gaussian', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='coloured_gaussian'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='coloured_gaussian', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class coloured_gaussian
[docs]class final_multi_reference_alignmentType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_reference_projections', 'xs:positiveInteger', 0),
MemberSpec_('merit_function', 'xs:string', 0),
MemberSpec_('angular_sampling', 'angular_samplingType9', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_reference_projections=None, merit_function=None, angular_sampling=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_reference_projections = number_reference_projections
self.merit_function = merit_function
self.angular_sampling = angular_sampling
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if final_multi_reference_alignmentType.subclass:
return final_multi_reference_alignmentType.subclass(*args_, **kwargs_)
else:
return final_multi_reference_alignmentType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_reference_projections(self): return self.number_reference_projections
[docs] def set_number_reference_projections(self, number_reference_projections): self.number_reference_projections = number_reference_projections
[docs] def get_merit_function(self): return self.merit_function
[docs] def set_merit_function(self, merit_function): self.merit_function = merit_function
[docs] def get_angular_sampling(self): return self.angular_sampling
[docs] def set_angular_sampling(self, angular_sampling): self.angular_sampling = angular_sampling
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_reference_projections is not None or
self.merit_function is not None or
self.angular_sampling is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='final_multi_reference_alignmentType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='final_multi_reference_alignmentType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='final_multi_reference_alignmentType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_reference_projections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_reference_projections>%s</%snumber_reference_projections>%s' % (namespace_, self.gds_format_integer(self.number_reference_projections, input_name='number_reference_projections'), namespace_, eol_))
if self.merit_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smerit_function>%s</%smerit_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.merit_function).encode(ExternalEncoding), input_name='merit_function'), namespace_, eol_))
if self.angular_sampling is not None:
self.angular_sampling.export(outfile, level, namespace_, name_='angular_sampling', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_reference_projections':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_reference_projections')
self.number_reference_projections = ival_
elif nodeName_ == 'merit_function':
merit_function_ = child_.text
merit_function_ = self.gds_validate_string(merit_function_, node, 'merit_function')
self.merit_function = merit_function_
elif nodeName_ == 'angular_sampling':
obj_ = angular_samplingType9.factory()
obj_.build(child_)
self.angular_sampling = obj_
obj_.original_tagname_ = 'angular_sampling'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class final_multi_reference_alignmentType
[docs]class angular_samplingType9(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_angular_sampling', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if angular_samplingType9.subclass:
return angular_samplingType9.subclass(*args_, **kwargs_)
else:
return angular_samplingType9(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angular_samplingType9', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angular_samplingType9')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='angular_samplingType9', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angular_samplingType9'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angular_samplingType9', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class angular_samplingType9
[docs]class final_multi_reference_alignmentType10(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_reference_projections', 'xs:positiveInteger', 0),
MemberSpec_('merit_function', 'xs:string', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_reference_projections=None, merit_function=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_reference_projections = number_reference_projections
self.merit_function = merit_function
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if final_multi_reference_alignmentType10.subclass:
return final_multi_reference_alignmentType10.subclass(*args_, **kwargs_)
else:
return final_multi_reference_alignmentType10(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_reference_projections(self): return self.number_reference_projections
[docs] def set_number_reference_projections(self, number_reference_projections): self.number_reference_projections = number_reference_projections
[docs] def get_merit_function(self): return self.merit_function
[docs] def set_merit_function(self, merit_function): self.merit_function = merit_function
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_reference_projections is not None or
self.merit_function is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType10', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='final_multi_reference_alignmentType10')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='final_multi_reference_alignmentType10', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='final_multi_reference_alignmentType10'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType10', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_reference_projections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_reference_projections>%s</%snumber_reference_projections>%s' % (namespace_, self.gds_format_integer(self.number_reference_projections, input_name='number_reference_projections'), namespace_, eol_))
if self.merit_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smerit_function>%s</%smerit_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.merit_function).encode(ExternalEncoding), input_name='merit_function'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_reference_projections':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_reference_projections')
self.number_reference_projections = ival_
elif nodeName_ == 'merit_function':
merit_function_ = child_.text
merit_function_ = self.gds_validate_string(merit_function_, node, 'merit_function')
self.merit_function = merit_function_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class final_multi_reference_alignmentType10
[docs]class molecular_replacementType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('starting_model', 'starting_modelType', 1),
MemberSpec_('resolution_range', 'resolution_rangeType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, starting_model=None, resolution_range=None, software_list=None, details=None):
self.original_tagname_ = None
if starting_model is None:
self.starting_model = []
else:
self.starting_model = starting_model
self.resolution_range = resolution_range
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if molecular_replacementType.subclass:
return molecular_replacementType.subclass(*args_, **kwargs_)
else:
return molecular_replacementType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_starting_model(self): return self.starting_model
[docs] def set_starting_model(self, starting_model): self.starting_model = starting_model
[docs] def add_starting_model(self, value): self.starting_model.append(value)
[docs] def insert_starting_model_at(self, index, value): self.starting_model.insert(index, value)
[docs] def replace_starting_model_at(self, index, value): self.starting_model[index] = value
[docs] def get_resolution_range(self): return self.resolution_range
[docs] def set_resolution_range(self, resolution_range): self.resolution_range = resolution_range
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.starting_model or
self.resolution_range is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='molecular_replacementType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='molecular_replacementType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='molecular_replacementType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='molecular_replacementType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='molecular_replacementType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for starting_model_ in self.starting_model:
starting_model_.export(outfile, level, namespace_, name_='starting_model', pretty_print=pretty_print)
if self.resolution_range is not None:
self.resolution_range.export(outfile, level, namespace_, name_='resolution_range', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'starting_model':
obj_ = starting_modelType.factory()
obj_.build(child_)
self.starting_model.append(obj_)
obj_.original_tagname_ = 'starting_model'
elif nodeName_ == 'resolution_range':
obj_ = resolution_rangeType.factory()
obj_.build(child_)
self.resolution_range = obj_
obj_.original_tagname_ = 'resolution_range'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class molecular_replacementType
[docs]class starting_modelType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('access_code', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain', 'chain_type', 1),
]
subclass = None
superclass = None
def __init__(self, access_code=None, chain=None):
self.original_tagname_ = None
self.access_code = access_code
self.validate_pdb_code_type(self.access_code)
if chain is None:
self.chain = []
else:
self.chain = chain
[docs] def factory(*args_, **kwargs_):
if starting_modelType.subclass:
return starting_modelType.subclass(*args_, **kwargs_)
else:
return starting_modelType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_access_code(self): return self.access_code
[docs] def set_access_code(self, access_code): self.access_code = access_code
[docs] def get_chain(self): return self.chain
[docs] def set_chain(self, chain): self.chain = chain
[docs] def add_chain(self, value): self.chain.append(value)
[docs] def insert_chain_at(self, index, value): self.chain.insert(index, value)
[docs] def replace_chain_at(self, index, value): self.chain[index] = value
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.access_code is not None or
self.chain
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='starting_modelType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='starting_modelType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='starting_modelType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='starting_modelType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='starting_modelType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.access_code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saccess_code>%s</%saccess_code>%s' % (namespace_, self.gds_format_string(quote_xml(self.access_code).encode(ExternalEncoding), input_name='access_code'), namespace_, eol_))
for chain_ in self.chain:
chain_.export(outfile, level, namespace_, name_='chain', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'access_code':
access_code_ = child_.text
access_code_ = re_.sub(String_cleanup_pat_, " ", access_code_).strip()
access_code_ = self.gds_validate_string(access_code_, node, 'access_code')
self.access_code = access_code_
# validate type pdb_code_type
self.validate_pdb_code_type(self.access_code)
elif nodeName_ == 'chain':
class_obj_ = self.get_class_obj_(child_, chain_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.chain.append(obj_)
obj_.original_tagname_ = 'chain'
# end class starting_modelType
[docs]class resolution_rangeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('high_resolution', 'high_resolutionType', 0),
MemberSpec_('low_resolution', 'low_resolutionType', 0),
]
subclass = None
superclass = None
def __init__(self, high_resolution=None, low_resolution=None):
self.original_tagname_ = None
self.high_resolution = high_resolution
self.low_resolution = low_resolution
[docs] def factory(*args_, **kwargs_):
if resolution_rangeType.subclass:
return resolution_rangeType.subclass(*args_, **kwargs_)
else:
return resolution_rangeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_high_resolution(self): return self.high_resolution
[docs] def set_high_resolution(self, high_resolution): self.high_resolution = high_resolution
[docs] def get_low_resolution(self): return self.low_resolution
[docs] def set_low_resolution(self, low_resolution): self.low_resolution = low_resolution
[docs] def hasContent_(self):
if (
self.high_resolution is not None or
self.low_resolution is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='resolution_rangeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='resolution_rangeType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='resolution_rangeType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='resolution_rangeType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='resolution_rangeType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.high_resolution is not None:
self.high_resolution.export(outfile, level, namespace_, name_='high_resolution', pretty_print=pretty_print)
if self.low_resolution is not None:
self.low_resolution.export(outfile, level, namespace_, name_='low_resolution', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'high_resolution':
obj_ = high_resolutionType.factory()
obj_.build(child_)
self.high_resolution = obj_
obj_.original_tagname_ = 'high_resolution'
elif nodeName_ == 'low_resolution':
obj_ = low_resolutionType.factory()
obj_.build(child_)
self.low_resolution = obj_
obj_.original_tagname_ = 'low_resolution'
# end class resolution_rangeType
[docs]class high_resolutionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if high_resolutionType.subclass:
return high_resolutionType.subclass(*args_, **kwargs_)
else:
return high_resolutionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_resolutionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_resolutionType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_resolutionType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_resolutionType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_resolutionType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class high_resolutionType
[docs]class low_resolutionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if low_resolutionType.subclass:
return low_resolutionType.subclass(*args_, **kwargs_)
else:
return low_resolutionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='low_resolutionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='low_resolutionType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='low_resolutionType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='low_resolutionType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='low_resolutionType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class low_resolutionType
[docs]class lattice_distortion_correctionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if lattice_distortion_correctionType.subclass:
return lattice_distortion_correctionType.subclass(*args_, **kwargs_)
else:
return lattice_distortion_correctionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='lattice_distortion_correctionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='lattice_distortion_correctionType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='lattice_distortion_correctionType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='lattice_distortion_correctionType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='lattice_distortion_correctionType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class lattice_distortion_correctionType
[docs]class symmetry_determinationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if symmetry_determinationType.subclass:
return symmetry_determinationType.subclass(*args_, **kwargs_)
else:
return symmetry_determinationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='symmetry_determinationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='symmetry_determinationType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='symmetry_determinationType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='symmetry_determinationType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='symmetry_determinationType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class symmetry_determinationType
[docs]class mergingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if mergingType.subclass:
return mergingType.subclass(*args_, **kwargs_)
else:
return mergingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='mergingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='mergingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='mergingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='mergingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='mergingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class mergingType
[docs]class segment_selectionType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_segments', 'xs:positiveInteger', 0),
MemberSpec_('segment_length', 'segment_lengthType', 0),
MemberSpec_('segment_overlap', 'segment_overlapType', 0),
MemberSpec_('total_filament_length', 'total_filament_lengthType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_segments=None, segment_length=None, segment_overlap=None, total_filament_length=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_segments = number_segments
self.segment_length = segment_length
self.segment_overlap = segment_overlap
self.total_filament_length = total_filament_length
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if segment_selectionType.subclass:
return segment_selectionType.subclass(*args_, **kwargs_)
else:
return segment_selectionType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_segments(self): return self.number_segments
[docs] def set_number_segments(self, number_segments): self.number_segments = number_segments
[docs] def get_segment_length(self): return self.segment_length
[docs] def set_segment_length(self, segment_length): self.segment_length = segment_length
[docs] def get_segment_overlap(self): return self.segment_overlap
[docs] def set_segment_overlap(self, segment_overlap): self.segment_overlap = segment_overlap
[docs] def get_total_filament_length(self): return self.total_filament_length
[docs] def set_total_filament_length(self, total_filament_length): self.total_filament_length = total_filament_length
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_segments is not None or
self.segment_length is not None or
self.segment_overlap is not None or
self.total_filament_length is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_selectionType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_selectionType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_selectionType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_selectionType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_selectionType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_segments is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_segments>%s</%snumber_segments>%s' % (namespace_, self.gds_format_integer(self.number_segments, input_name='number_segments'), namespace_, eol_))
if self.segment_length is not None:
self.segment_length.export(outfile, level, namespace_, name_='segment_length', pretty_print=pretty_print)
if self.segment_overlap is not None:
self.segment_overlap.export(outfile, level, namespace_, name_='segment_overlap', pretty_print=pretty_print)
if self.total_filament_length is not None:
self.total_filament_length.export(outfile, level, namespace_, name_='total_filament_length', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_segments':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_segments')
self.number_segments = ival_
elif nodeName_ == 'segment_length':
obj_ = segment_lengthType.factory()
obj_.build(child_)
self.segment_length = obj_
obj_.original_tagname_ = 'segment_length'
elif nodeName_ == 'segment_overlap':
obj_ = segment_overlapType.factory()
obj_.build(child_)
self.segment_overlap = obj_
obj_.original_tagname_ = 'segment_overlap'
elif nodeName_ == 'total_filament_length':
obj_ = total_filament_lengthType.factory()
obj_.build(child_)
self.total_filament_length = obj_
obj_.original_tagname_ = 'total_filament_length'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class segment_selectionType
[docs]class segment_lengthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if segment_lengthType.subclass:
return segment_lengthType.subclass(*args_, **kwargs_)
else:
return segment_lengthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_lengthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_lengthType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_lengthType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_lengthType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_lengthType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class segment_lengthType
[docs]class segment_overlapType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if segment_overlapType.subclass:
return segment_overlapType.subclass(*args_, **kwargs_)
else:
return segment_overlapType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_overlapType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_overlapType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_overlapType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_overlapType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_overlapType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class segment_overlapType
[docs]class total_filament_lengthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if total_filament_lengthType.subclass:
return total_filament_lengthType.subclass(*args_, **kwargs_)
else:
return total_filament_lengthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='total_filament_lengthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='total_filament_lengthType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='total_filament_lengthType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='total_filament_lengthType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='total_filament_lengthType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class total_filament_lengthType
[docs]class refinementType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('startup_model', 'starting_map_type', 1),
MemberSpec_('starting_symmetry', 'starting_symmetryType', 1),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, startup_model=None, starting_symmetry=None, software_list=None, details=None):
self.original_tagname_ = None
if startup_model is None:
self.startup_model = []
else:
self.startup_model = startup_model
if starting_symmetry is None:
self.starting_symmetry = []
else:
self.starting_symmetry = starting_symmetry
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if refinementType.subclass:
return refinementType.subclass(*args_, **kwargs_)
else:
return refinementType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_startup_model(self): return self.startup_model
[docs] def set_startup_model(self, startup_model): self.startup_model = startup_model
[docs] def add_startup_model(self, value): self.startup_model.append(value)
[docs] def insert_startup_model_at(self, index, value): self.startup_model.insert(index, value)
[docs] def replace_startup_model_at(self, index, value): self.startup_model[index] = value
[docs] def get_starting_symmetry(self): return self.starting_symmetry
[docs] def set_starting_symmetry(self, starting_symmetry): self.starting_symmetry = starting_symmetry
[docs] def add_starting_symmetry(self, value): self.starting_symmetry.append(value)
[docs] def insert_starting_symmetry_at(self, index, value): self.starting_symmetry.insert(index, value)
[docs] def replace_starting_symmetry_at(self, index, value): self.starting_symmetry[index] = value
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.startup_model or
self.starting_symmetry or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='refinementType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='refinementType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='refinementType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='refinementType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='refinementType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for startup_model_ in self.startup_model:
startup_model_.export(outfile, level, namespace_, name_='startup_model', pretty_print=pretty_print)
for starting_symmetry_ in self.starting_symmetry:
starting_symmetry_.export(outfile, level, namespace_, name_='starting_symmetry', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'startup_model':
obj_ = starting_map_type.factory()
obj_.build(child_)
self.startup_model.append(obj_)
obj_.original_tagname_ = 'startup_model'
elif nodeName_ == 'starting_symmetry':
obj_ = starting_symmetryType.factory()
obj_.build(child_)
self.starting_symmetry.append(obj_)
obj_.original_tagname_ = 'starting_symmetry'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class refinementType
[docs]class starting_symmetryType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('helical_parameters', 'helical_parameters_type', 0),
]
subclass = None
superclass = None
def __init__(self, helical_parameters=None):
self.original_tagname_ = None
self.helical_parameters = helical_parameters
[docs] def factory(*args_, **kwargs_):
if starting_symmetryType.subclass:
return starting_symmetryType.subclass(*args_, **kwargs_)
else:
return starting_symmetryType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_helical_parameters(self): return self.helical_parameters
[docs] def set_helical_parameters(self, helical_parameters): self.helical_parameters = helical_parameters
[docs] def hasContent_(self):
if (
self.helical_parameters is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='starting_symmetryType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='starting_symmetryType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='starting_symmetryType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='starting_symmetryType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='starting_symmetryType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.helical_parameters is not None:
self.helical_parameters.export(outfile, level, namespace_, name_='helical_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'helical_parameters':
obj_ = helical_parameters_type.factory()
obj_.build(child_)
self.helical_parameters = obj_
obj_.original_tagname_ = 'helical_parameters'
# end class starting_symmetryType
[docs]class layer_linesType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_helices', 'xs:string', 0),
MemberSpec_('helix_length', 'helix_lengthType', 0),
MemberSpec_('straightening', 'xs:boolean', 0),
MemberSpec_('indexing', 'indexingType', 0),
]
subclass = None
superclass = None
def __init__(self, number_helices=None, helix_length=None, straightening=None, indexing=None):
self.original_tagname_ = None
self.number_helices = number_helices
self.helix_length = helix_length
self.straightening = straightening
self.indexing = indexing
[docs] def factory(*args_, **kwargs_):
if layer_linesType.subclass:
return layer_linesType.subclass(*args_, **kwargs_)
else:
return layer_linesType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_helices(self): return self.number_helices
[docs] def set_number_helices(self, number_helices): self.number_helices = number_helices
[docs] def get_helix_length(self): return self.helix_length
[docs] def set_helix_length(self, helix_length): self.helix_length = helix_length
[docs] def get_straightening(self): return self.straightening
[docs] def set_straightening(self, straightening): self.straightening = straightening
[docs] def get_indexing(self): return self.indexing
[docs] def set_indexing(self, indexing): self.indexing = indexing
[docs] def hasContent_(self):
if (
self.number_helices is not None or
self.helix_length is not None or
self.straightening is not None or
self.indexing is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='layer_linesType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='layer_linesType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='layer_linesType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='layer_linesType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='layer_linesType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_helices is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_helices>%s</%snumber_helices>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_helices).encode(ExternalEncoding), input_name='number_helices'), namespace_, eol_))
if self.helix_length is not None:
self.helix_length.export(outfile, level, namespace_, name_='helix_length', pretty_print=pretty_print)
if self.straightening is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstraightening>%s</%sstraightening>%s' % (namespace_, self.gds_format_boolean(self.straightening, input_name='straightening'), namespace_, eol_))
if self.indexing is not None:
self.indexing.export(outfile, level, namespace_, name_='indexing', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_helices':
number_helices_ = child_.text
number_helices_ = self.gds_validate_string(number_helices_, node, 'number_helices')
self.number_helices = number_helices_
elif nodeName_ == 'helix_length':
obj_ = helix_lengthType.factory()
obj_.build(child_)
self.helix_length = obj_
obj_.original_tagname_ = 'helix_length'
elif nodeName_ == 'straightening':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'straightening')
self.straightening = ival_
elif nodeName_ == 'indexing':
obj_ = indexingType.factory()
obj_.build(child_)
self.indexing = obj_
obj_.original_tagname_ = 'indexing'
# end class layer_linesType
[docs]class number_helices(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if number_helices.subclass:
return number_helices.subclass(*args_, **kwargs_)
else:
return number_helices(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='number_helices', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='number_helices')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='number_helices', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='number_helices'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='number_helices', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class number_helices
[docs]class helix_lengthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('min', 'xs:string', 0),
MemberSpec_('max', 'xs:string', 0),
MemberSpec_('average', 'xs:string', 0),
MemberSpec_('software_list', 'software_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, min=None, max=None, average=None, software_list=None):
self.original_tagname_ = None
self.min = min
self.max = max
self.average = average
self.software_list = software_list
[docs] def factory(*args_, **kwargs_):
if helix_lengthType.subclass:
return helix_lengthType.subclass(*args_, **kwargs_)
else:
return helix_lengthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_min(self): return self.min
[docs] def set_min(self, min): self.min = min
[docs] def get_max(self): return self.max
[docs] def set_max(self, max): self.max = max
[docs] def get_average(self): return self.average
[docs] def set_average(self, average): self.average = average
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def hasContent_(self):
if (
self.min is not None or
self.max is not None or
self.average is not None or
self.software_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='helix_lengthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='helix_lengthType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='helix_lengthType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='helix_lengthType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='helix_lengthType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.min is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smin>%s</%smin>%s' % (namespace_, self.gds_format_string(quote_xml(self.min).encode(ExternalEncoding), input_name='min'), namespace_, eol_))
if self.max is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smax>%s</%smax>%s' % (namespace_, self.gds_format_string(quote_xml(self.max).encode(ExternalEncoding), input_name='max'), namespace_, eol_))
if self.average is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saverage>%s</%saverage>%s' % (namespace_, self.gds_format_string(quote_xml(self.average).encode(ExternalEncoding), input_name='average'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'min':
min_ = child_.text
min_ = self.gds_validate_string(min_, node, 'min')
self.min = min_
elif nodeName_ == 'max':
max_ = child_.text
max_ = self.gds_validate_string(max_, node, 'max')
self.max = max_
elif nodeName_ == 'average':
average_ = child_.text
average_ = self.gds_validate_string(average_, node, 'average')
self.average = average_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
# end class helix_lengthType
[docs]class min(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if min.subclass:
return min.subclass(*args_, **kwargs_)
else:
return min(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='min', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='min')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='min', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='min'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='min', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class min
[docs]class max(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if max.subclass:
return max.subclass(*args_, **kwargs_)
else:
return max(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='max', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='max')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='max', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='max'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='max', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class max
[docs]class average(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if average.subclass:
return average.subclass(*args_, **kwargs_)
else:
return average(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='average', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='average')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='average', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='average'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='average', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class average
[docs]class indexingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None):
self.original_tagname_ = None
self.software_list = software_list
[docs] def factory(*args_, **kwargs_):
if indexingType.subclass:
return indexingType.subclass(*args_, **kwargs_)
else:
return indexingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def hasContent_(self):
if (
self.software_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='indexingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='indexingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='indexingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='indexingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='indexingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
# end class indexingType
[docs]class final_multi_reference_alignmentType11(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_reference_projections', 'xs:positiveInteger', 0),
MemberSpec_('merit_function', 'xs:string', 0),
MemberSpec_('angular_sampling', 'angular_samplingType12', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_reference_projections=None, merit_function=None, angular_sampling=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_reference_projections = number_reference_projections
self.merit_function = merit_function
self.angular_sampling = angular_sampling
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if final_multi_reference_alignmentType11.subclass:
return final_multi_reference_alignmentType11.subclass(*args_, **kwargs_)
else:
return final_multi_reference_alignmentType11(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_reference_projections(self): return self.number_reference_projections
[docs] def set_number_reference_projections(self, number_reference_projections): self.number_reference_projections = number_reference_projections
[docs] def get_merit_function(self): return self.merit_function
[docs] def set_merit_function(self, merit_function): self.merit_function = merit_function
[docs] def get_angular_sampling(self): return self.angular_sampling
[docs] def set_angular_sampling(self, angular_sampling): self.angular_sampling = angular_sampling
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_reference_projections is not None or
self.merit_function is not None or
self.angular_sampling is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType11', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='final_multi_reference_alignmentType11')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='final_multi_reference_alignmentType11', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='final_multi_reference_alignmentType11'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType11', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_reference_projections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_reference_projections>%s</%snumber_reference_projections>%s' % (namespace_, self.gds_format_integer(self.number_reference_projections, input_name='number_reference_projections'), namespace_, eol_))
if self.merit_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smerit_function>%s</%smerit_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.merit_function).encode(ExternalEncoding), input_name='merit_function'), namespace_, eol_))
if self.angular_sampling is not None:
self.angular_sampling.export(outfile, level, namespace_, name_='angular_sampling', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_reference_projections':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_reference_projections')
self.number_reference_projections = ival_
elif nodeName_ == 'merit_function':
merit_function_ = child_.text
merit_function_ = self.gds_validate_string(merit_function_, node, 'merit_function')
self.merit_function = merit_function_
elif nodeName_ == 'angular_sampling':
obj_ = angular_samplingType12.factory()
obj_.build(child_)
self.angular_sampling = obj_
obj_.original_tagname_ = 'angular_sampling'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class final_multi_reference_alignmentType11
[docs]class angular_samplingType12(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_angular_sampling', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if angular_samplingType12.subclass:
return angular_samplingType12.subclass(*args_, **kwargs_)
else:
return angular_samplingType12(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='angular_samplingType12', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='angular_samplingType12')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='angular_samplingType12', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='angular_samplingType12'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='angular_samplingType12', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class angular_samplingType12
[docs]class final_multi_reference_alignmentType14(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_reference_projections', 'xs:positiveInteger', 0),
MemberSpec_('merit_function', 'xs:string', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_reference_projections=None, merit_function=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_reference_projections = number_reference_projections
self.merit_function = merit_function
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if final_multi_reference_alignmentType14.subclass:
return final_multi_reference_alignmentType14.subclass(*args_, **kwargs_)
else:
return final_multi_reference_alignmentType14(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_reference_projections(self): return self.number_reference_projections
[docs] def set_number_reference_projections(self, number_reference_projections): self.number_reference_projections = number_reference_projections
[docs] def get_merit_function(self): return self.merit_function
[docs] def set_merit_function(self, merit_function): self.merit_function = merit_function
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_reference_projections is not None or
self.merit_function is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType14', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='final_multi_reference_alignmentType14')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='final_multi_reference_alignmentType14', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='final_multi_reference_alignmentType14'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='final_multi_reference_alignmentType14', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_reference_projections is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_reference_projections>%s</%snumber_reference_projections>%s' % (namespace_, self.gds_format_integer(self.number_reference_projections, input_name='number_reference_projections'), namespace_, eol_))
if self.merit_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smerit_function>%s</%smerit_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.merit_function).encode(ExternalEncoding), input_name='merit_function'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_reference_projections':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_reference_projections')
self.number_reference_projections = ival_
elif nodeName_ == 'merit_function':
merit_function_ = child_.text
merit_function_ = self.gds_validate_string(merit_function_, node, 'merit_function')
self.merit_function = merit_function_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class final_multi_reference_alignmentType14
[docs]class molecular_replacementType15(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('starting_model', 'starting_modelType16', 1),
MemberSpec_('resolution_range', 'resolution_rangeType17', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, starting_model=None, resolution_range=None, software_list=None, details=None):
self.original_tagname_ = None
if starting_model is None:
self.starting_model = []
else:
self.starting_model = starting_model
self.resolution_range = resolution_range
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if molecular_replacementType15.subclass:
return molecular_replacementType15.subclass(*args_, **kwargs_)
else:
return molecular_replacementType15(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_starting_model(self): return self.starting_model
[docs] def set_starting_model(self, starting_model): self.starting_model = starting_model
[docs] def add_starting_model(self, value): self.starting_model.append(value)
[docs] def insert_starting_model_at(self, index, value): self.starting_model.insert(index, value)
[docs] def replace_starting_model_at(self, index, value): self.starting_model[index] = value
[docs] def get_resolution_range(self): return self.resolution_range
[docs] def set_resolution_range(self, resolution_range): self.resolution_range = resolution_range
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.starting_model or
self.resolution_range is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='molecular_replacementType15', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='molecular_replacementType15')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='molecular_replacementType15', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='molecular_replacementType15'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='molecular_replacementType15', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for starting_model_ in self.starting_model:
starting_model_.export(outfile, level, namespace_, name_='starting_model', pretty_print=pretty_print)
if self.resolution_range is not None:
self.resolution_range.export(outfile, level, namespace_, name_='resolution_range', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'starting_model':
obj_ = starting_modelType16.factory()
obj_.build(child_)
self.starting_model.append(obj_)
obj_.original_tagname_ = 'starting_model'
elif nodeName_ == 'resolution_range':
obj_ = resolution_rangeType17.factory()
obj_.build(child_)
self.resolution_range = obj_
obj_.original_tagname_ = 'resolution_range'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class molecular_replacementType15
[docs]class starting_modelType16(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('access_code', ['pdb_code_type', 'xs:token'], 0),
MemberSpec_('chain', 'chain_type', 1),
]
subclass = None
superclass = None
def __init__(self, access_code=None, chain=None):
self.original_tagname_ = None
self.access_code = access_code
self.validate_pdb_code_type(self.access_code)
if chain is None:
self.chain = []
else:
self.chain = chain
[docs] def factory(*args_, **kwargs_):
if starting_modelType16.subclass:
return starting_modelType16.subclass(*args_, **kwargs_)
else:
return starting_modelType16(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_access_code(self): return self.access_code
[docs] def set_access_code(self, access_code): self.access_code = access_code
[docs] def get_chain(self): return self.chain
[docs] def set_chain(self, chain): self.chain = chain
[docs] def add_chain(self, value): self.chain.append(value)
[docs] def insert_chain_at(self, index, value): self.chain.insert(index, value)
[docs] def replace_chain_at(self, index, value): self.chain[index] = value
[docs] def validate_pdb_code_type(self, value):
# Validate type pdb_code_type, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_pdb_code_type_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pdb_code_type_patterns_, ))
validate_pdb_code_type_patterns_ = [['^\\d[\\dA-Za-z]{3}$']]
[docs] def hasContent_(self):
if (
self.access_code is not None or
self.chain
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='starting_modelType16', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='starting_modelType16')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='starting_modelType16', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='starting_modelType16'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='starting_modelType16', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.access_code is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saccess_code>%s</%saccess_code>%s' % (namespace_, self.gds_format_string(quote_xml(self.access_code).encode(ExternalEncoding), input_name='access_code'), namespace_, eol_))
for chain_ in self.chain:
chain_.export(outfile, level, namespace_, name_='chain', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'access_code':
access_code_ = child_.text
access_code_ = re_.sub(String_cleanup_pat_, " ", access_code_).strip()
access_code_ = self.gds_validate_string(access_code_, node, 'access_code')
self.access_code = access_code_
# validate type pdb_code_type
self.validate_pdb_code_type(self.access_code)
elif nodeName_ == 'chain':
class_obj_ = self.get_class_obj_(child_, chain_type)
obj_ = class_obj_.factory()
obj_.build(child_)
self.chain.append(obj_)
obj_.original_tagname_ = 'chain'
# end class starting_modelType16
[docs]class resolution_rangeType17(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('high_resolution', 'high_resolutionType18', 0),
MemberSpec_('low_resolution', 'low_resolutionType19', 0),
]
subclass = None
superclass = None
def __init__(self, high_resolution=None, low_resolution=None):
self.original_tagname_ = None
self.high_resolution = high_resolution
self.low_resolution = low_resolution
[docs] def factory(*args_, **kwargs_):
if resolution_rangeType17.subclass:
return resolution_rangeType17.subclass(*args_, **kwargs_)
else:
return resolution_rangeType17(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_high_resolution(self): return self.high_resolution
[docs] def set_high_resolution(self, high_resolution): self.high_resolution = high_resolution
[docs] def get_low_resolution(self): return self.low_resolution
[docs] def set_low_resolution(self, low_resolution): self.low_resolution = low_resolution
[docs] def hasContent_(self):
if (
self.high_resolution is not None or
self.low_resolution is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='resolution_rangeType17', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='resolution_rangeType17')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='resolution_rangeType17', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='resolution_rangeType17'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='resolution_rangeType17', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.high_resolution is not None:
self.high_resolution.export(outfile, level, namespace_, name_='high_resolution', pretty_print=pretty_print)
if self.low_resolution is not None:
self.low_resolution.export(outfile, level, namespace_, name_='low_resolution', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'high_resolution':
obj_ = high_resolutionType18.factory()
obj_.build(child_)
self.high_resolution = obj_
obj_.original_tagname_ = 'high_resolution'
elif nodeName_ == 'low_resolution':
obj_ = low_resolutionType19.factory()
obj_.build(child_)
self.low_resolution = obj_
obj_.original_tagname_ = 'low_resolution'
# end class resolution_rangeType17
[docs]class high_resolutionType18(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if high_resolutionType18.subclass:
return high_resolutionType18.subclass(*args_, **kwargs_)
else:
return high_resolutionType18(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_resolutionType18', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_resolutionType18')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_resolutionType18', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_resolutionType18'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_resolutionType18', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class high_resolutionType18
[docs]class low_resolutionType19(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if low_resolutionType19.subclass:
return low_resolutionType19.subclass(*args_, **kwargs_)
else:
return low_resolutionType19(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='low_resolutionType19', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='low_resolutionType19')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='low_resolutionType19', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='low_resolutionType19'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='low_resolutionType19', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class low_resolutionType19
[docs]class lattice_distortion_correctionType20(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if lattice_distortion_correctionType20.subclass:
return lattice_distortion_correctionType20.subclass(*args_, **kwargs_)
else:
return lattice_distortion_correctionType20(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='lattice_distortion_correctionType20', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='lattice_distortion_correctionType20')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='lattice_distortion_correctionType20', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='lattice_distortion_correctionType20'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='lattice_distortion_correctionType20', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class lattice_distortion_correctionType20
[docs]class symmetry_determinationType21(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if symmetry_determinationType21.subclass:
return symmetry_determinationType21.subclass(*args_, **kwargs_)
else:
return symmetry_determinationType21(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='symmetry_determinationType21', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='symmetry_determinationType21')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='symmetry_determinationType21', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='symmetry_determinationType21'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='symmetry_determinationType21', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class symmetry_determinationType21
[docs]class mergingType22(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if mergingType22.subclass:
return mergingType22.subclass(*args_, **kwargs_)
else:
return mergingType22(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='mergingType22', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='mergingType22')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='mergingType22', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='mergingType22'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='mergingType22', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class mergingType22
[docs]class segment_selectionType23(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_segments', 'xs:positiveInteger', 0),
MemberSpec_('segment_length', 'segment_lengthType24', 0),
MemberSpec_('segment_overlap', 'segment_overlapType25', 0),
MemberSpec_('total_filament_length', 'total_filament_lengthType26', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_segments=None, segment_length=None, segment_overlap=None, total_filament_length=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_segments = number_segments
self.segment_length = segment_length
self.segment_overlap = segment_overlap
self.total_filament_length = total_filament_length
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if segment_selectionType23.subclass:
return segment_selectionType23.subclass(*args_, **kwargs_)
else:
return segment_selectionType23(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_segments(self): return self.number_segments
[docs] def set_number_segments(self, number_segments): self.number_segments = number_segments
[docs] def get_segment_length(self): return self.segment_length
[docs] def set_segment_length(self, segment_length): self.segment_length = segment_length
[docs] def get_segment_overlap(self): return self.segment_overlap
[docs] def set_segment_overlap(self, segment_overlap): self.segment_overlap = segment_overlap
[docs] def get_total_filament_length(self): return self.total_filament_length
[docs] def set_total_filament_length(self, total_filament_length): self.total_filament_length = total_filament_length
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_segments is not None or
self.segment_length is not None or
self.segment_overlap is not None or
self.total_filament_length is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_selectionType23', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_selectionType23')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_selectionType23', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_selectionType23'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_selectionType23', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_segments is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_segments>%s</%snumber_segments>%s' % (namespace_, self.gds_format_integer(self.number_segments, input_name='number_segments'), namespace_, eol_))
if self.segment_length is not None:
self.segment_length.export(outfile, level, namespace_, name_='segment_length', pretty_print=pretty_print)
if self.segment_overlap is not None:
self.segment_overlap.export(outfile, level, namespace_, name_='segment_overlap', pretty_print=pretty_print)
if self.total_filament_length is not None:
self.total_filament_length.export(outfile, level, namespace_, name_='total_filament_length', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_segments':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_segments')
self.number_segments = ival_
elif nodeName_ == 'segment_length':
obj_ = segment_lengthType24.factory()
obj_.build(child_)
self.segment_length = obj_
obj_.original_tagname_ = 'segment_length'
elif nodeName_ == 'segment_overlap':
obj_ = segment_overlapType25.factory()
obj_.build(child_)
self.segment_overlap = obj_
obj_.original_tagname_ = 'segment_overlap'
elif nodeName_ == 'total_filament_length':
obj_ = total_filament_lengthType26.factory()
obj_.build(child_)
self.total_filament_length = obj_
obj_.original_tagname_ = 'total_filament_length'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class segment_selectionType23
[docs]class segment_lengthType24(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if segment_lengthType24.subclass:
return segment_lengthType24.subclass(*args_, **kwargs_)
else:
return segment_lengthType24(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_lengthType24', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_lengthType24')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_lengthType24', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_lengthType24'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_lengthType24', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class segment_lengthType24
[docs]class segment_overlapType25(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if segment_overlapType25.subclass:
return segment_overlapType25.subclass(*args_, **kwargs_)
else:
return segment_overlapType25(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segment_overlapType25', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segment_overlapType25')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='segment_overlapType25', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segment_overlapType25'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segment_overlapType25', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class segment_overlapType25
[docs]class total_filament_lengthType26(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['non_zero_float', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if total_filament_lengthType26.subclass:
return total_filament_lengthType26.subclass(*args_, **kwargs_)
else:
return total_filament_lengthType26(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='total_filament_lengthType26', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='total_filament_lengthType26')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='total_filament_lengthType26', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='total_filament_lengthType26'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='total_filament_lengthType26', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class total_filament_lengthType26
[docs]class refinementType27(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('startup_model', 'starting_map_type', 1),
MemberSpec_('starting_symmetry', 'starting_symmetryType28', 1),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, startup_model=None, starting_symmetry=None, software_list=None, details=None):
self.original_tagname_ = None
if startup_model is None:
self.startup_model = []
else:
self.startup_model = startup_model
if starting_symmetry is None:
self.starting_symmetry = []
else:
self.starting_symmetry = starting_symmetry
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if refinementType27.subclass:
return refinementType27.subclass(*args_, **kwargs_)
else:
return refinementType27(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_startup_model(self): return self.startup_model
[docs] def set_startup_model(self, startup_model): self.startup_model = startup_model
[docs] def add_startup_model(self, value): self.startup_model.append(value)
[docs] def insert_startup_model_at(self, index, value): self.startup_model.insert(index, value)
[docs] def replace_startup_model_at(self, index, value): self.startup_model[index] = value
[docs] def get_starting_symmetry(self): return self.starting_symmetry
[docs] def set_starting_symmetry(self, starting_symmetry): self.starting_symmetry = starting_symmetry
[docs] def add_starting_symmetry(self, value): self.starting_symmetry.append(value)
[docs] def insert_starting_symmetry_at(self, index, value): self.starting_symmetry.insert(index, value)
[docs] def replace_starting_symmetry_at(self, index, value): self.starting_symmetry[index] = value
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.startup_model or
self.starting_symmetry or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='refinementType27', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='refinementType27')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='refinementType27', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='refinementType27'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='refinementType27', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for startup_model_ in self.startup_model:
startup_model_.export(outfile, level, namespace_, name_='startup_model', pretty_print=pretty_print)
for starting_symmetry_ in self.starting_symmetry:
starting_symmetry_.export(outfile, level, namespace_, name_='starting_symmetry', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'startup_model':
obj_ = starting_map_type.factory()
obj_.build(child_)
self.startup_model.append(obj_)
obj_.original_tagname_ = 'startup_model'
elif nodeName_ == 'starting_symmetry':
obj_ = starting_symmetryType28.factory()
obj_.build(child_)
self.starting_symmetry.append(obj_)
obj_.original_tagname_ = 'starting_symmetry'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class refinementType27
[docs]class starting_symmetryType28(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('helical_parameters', 'helical_parameters_type', 0),
]
subclass = None
superclass = None
def __init__(self, helical_parameters=None):
self.original_tagname_ = None
self.helical_parameters = helical_parameters
[docs] def factory(*args_, **kwargs_):
if starting_symmetryType28.subclass:
return starting_symmetryType28.subclass(*args_, **kwargs_)
else:
return starting_symmetryType28(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_helical_parameters(self): return self.helical_parameters
[docs] def set_helical_parameters(self, helical_parameters): self.helical_parameters = helical_parameters
[docs] def hasContent_(self):
if (
self.helical_parameters is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='starting_symmetryType28', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='starting_symmetryType28')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='starting_symmetryType28', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='starting_symmetryType28'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='starting_symmetryType28', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.helical_parameters is not None:
self.helical_parameters.export(outfile, level, namespace_, name_='helical_parameters', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'helical_parameters':
obj_ = helical_parameters_type.factory()
obj_.build(child_)
self.helical_parameters = obj_
obj_.original_tagname_ = 'helical_parameters'
# end class starting_symmetryType28
[docs]class layer_linesType29(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_helices', 'xs:string', 0),
MemberSpec_('helix_length', 'helix_lengthType30', 0),
MemberSpec_('straightening', 'xs:boolean', 0),
MemberSpec_('indexing', 'indexingType31', 0),
]
subclass = None
superclass = None
def __init__(self, number_helices=None, helix_length=None, straightening=None, indexing=None):
self.original_tagname_ = None
self.number_helices = number_helices
self.helix_length = helix_length
self.straightening = straightening
self.indexing = indexing
[docs] def factory(*args_, **kwargs_):
if layer_linesType29.subclass:
return layer_linesType29.subclass(*args_, **kwargs_)
else:
return layer_linesType29(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_helices(self): return self.number_helices
[docs] def set_number_helices(self, number_helices): self.number_helices = number_helices
[docs] def get_helix_length(self): return self.helix_length
[docs] def set_helix_length(self, helix_length): self.helix_length = helix_length
[docs] def get_straightening(self): return self.straightening
[docs] def set_straightening(self, straightening): self.straightening = straightening
[docs] def get_indexing(self): return self.indexing
[docs] def set_indexing(self, indexing): self.indexing = indexing
[docs] def hasContent_(self):
if (
self.number_helices is not None or
self.helix_length is not None or
self.straightening is not None or
self.indexing is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='layer_linesType29', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='layer_linesType29')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='layer_linesType29', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='layer_linesType29'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='layer_linesType29', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_helices is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_helices>%s</%snumber_helices>%s' % (namespace_, self.gds_format_string(quote_xml(self.number_helices).encode(ExternalEncoding), input_name='number_helices'), namespace_, eol_))
if self.helix_length is not None:
self.helix_length.export(outfile, level, namespace_, name_='helix_length', pretty_print=pretty_print)
if self.straightening is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstraightening>%s</%sstraightening>%s' % (namespace_, self.gds_format_boolean(self.straightening, input_name='straightening'), namespace_, eol_))
if self.indexing is not None:
self.indexing.export(outfile, level, namespace_, name_='indexing', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_helices':
number_helices_ = child_.text
number_helices_ = self.gds_validate_string(number_helices_, node, 'number_helices')
self.number_helices = number_helices_
elif nodeName_ == 'helix_length':
obj_ = helix_lengthType30.factory()
obj_.build(child_)
self.helix_length = obj_
obj_.original_tagname_ = 'helix_length'
elif nodeName_ == 'straightening':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'straightening')
self.straightening = ival_
elif nodeName_ == 'indexing':
obj_ = indexingType31.factory()
obj_.build(child_)
self.indexing = obj_
obj_.original_tagname_ = 'indexing'
# end class layer_linesType29
[docs]class helix_lengthType30(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('min', 'xs:string', 0),
MemberSpec_('max', 'xs:string', 0),
MemberSpec_('average', 'xs:string', 0),
MemberSpec_('software_list', 'software_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, min=None, max=None, average=None, software_list=None):
self.original_tagname_ = None
self.min = min
self.max = max
self.average = average
self.software_list = software_list
[docs] def factory(*args_, **kwargs_):
if helix_lengthType30.subclass:
return helix_lengthType30.subclass(*args_, **kwargs_)
else:
return helix_lengthType30(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_min(self): return self.min
[docs] def set_min(self, min): self.min = min
[docs] def get_max(self): return self.max
[docs] def set_max(self, max): self.max = max
[docs] def get_average(self): return self.average
[docs] def set_average(self, average): self.average = average
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def hasContent_(self):
if (
self.min is not None or
self.max is not None or
self.average is not None or
self.software_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='helix_lengthType30', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='helix_lengthType30')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='helix_lengthType30', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='helix_lengthType30'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='helix_lengthType30', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.min is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smin>%s</%smin>%s' % (namespace_, self.gds_format_string(quote_xml(self.min).encode(ExternalEncoding), input_name='min'), namespace_, eol_))
if self.max is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smax>%s</%smax>%s' % (namespace_, self.gds_format_string(quote_xml(self.max).encode(ExternalEncoding), input_name='max'), namespace_, eol_))
if self.average is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%saverage>%s</%saverage>%s' % (namespace_, self.gds_format_string(quote_xml(self.average).encode(ExternalEncoding), input_name='average'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'min':
min_ = child_.text
min_ = self.gds_validate_string(min_, node, 'min')
self.min = min_
elif nodeName_ == 'max':
max_ = child_.text
max_ = self.gds_validate_string(max_, node, 'max')
self.max = max_
elif nodeName_ == 'average':
average_ = child_.text
average_ = self.gds_validate_string(average_, node, 'average')
self.average = average_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
# end class helix_lengthType30
[docs]class indexingType31(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None):
self.original_tagname_ = None
self.software_list = software_list
[docs] def factory(*args_, **kwargs_):
if indexingType31.subclass:
return indexingType31.subclass(*args_, **kwargs_)
else:
return indexingType31(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def hasContent_(self):
if (
self.software_list is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='indexingType31', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='indexingType31')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='indexingType31', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='indexingType31'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='indexingType31', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
# end class indexingType31
[docs]class random_conical_tiltType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('number_images', 'xs:positiveInteger', 0),
MemberSpec_('tilt_angle', 'tilt_angleType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, number_images=None, tilt_angle=None, software_list=None, details=None):
self.original_tagname_ = None
self.number_images = number_images
self.tilt_angle = tilt_angle
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if random_conical_tiltType.subclass:
return random_conical_tiltType.subclass(*args_, **kwargs_)
else:
return random_conical_tiltType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_images(self): return self.number_images
[docs] def set_number_images(self, number_images): self.number_images = number_images
[docs] def get_tilt_angle(self): return self.tilt_angle
[docs] def set_tilt_angle(self, tilt_angle): self.tilt_angle = tilt_angle
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.number_images is not None or
self.tilt_angle is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='random_conical_tiltType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='random_conical_tiltType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='random_conical_tiltType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='random_conical_tiltType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='random_conical_tiltType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_images is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_images>%s</%snumber_images>%s' % (namespace_, self.gds_format_integer(self.number_images, input_name='number_images'), namespace_, eol_))
if self.tilt_angle is not None:
self.tilt_angle.export(outfile, level, namespace_, name_='tilt_angle', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_images':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_images')
self.number_images = ival_
elif nodeName_ == 'tilt_angle':
obj_ = tilt_angleType.factory()
obj_.build(child_)
self.tilt_angle = obj_
obj_.original_tagname_ = 'tilt_angle'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class random_conical_tiltType
[docs]class tilt_angleType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_tilt_angle_random_conical', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if tilt_angleType.subclass:
return tilt_angleType.subclass(*args_, **kwargs_)
else:
return tilt_angleType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_angleType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_angleType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_angleType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_angleType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_angleType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class tilt_angleType
[docs]class orthogonal_tiltType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('number_images', 'xs:positiveInteger', 0),
MemberSpec_('tilt_angle1', 'tilt_angle1Type', 0),
MemberSpec_('tilt_angle2', 'tilt_angle2Type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, number_images=None, tilt_angle1=None, tilt_angle2=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.number_images = number_images
self.tilt_angle1 = tilt_angle1
self.tilt_angle2 = tilt_angle2
self.details = details
[docs] def factory(*args_, **kwargs_):
if orthogonal_tiltType.subclass:
return orthogonal_tiltType.subclass(*args_, **kwargs_)
else:
return orthogonal_tiltType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_number_images(self): return self.number_images
[docs] def set_number_images(self, number_images): self.number_images = number_images
[docs] def get_tilt_angle1(self): return self.tilt_angle1
[docs] def set_tilt_angle1(self, tilt_angle1): self.tilt_angle1 = tilt_angle1
[docs] def get_tilt_angle2(self): return self.tilt_angle2
[docs] def set_tilt_angle2(self, tilt_angle2): self.tilt_angle2 = tilt_angle2
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.number_images is not None or
self.tilt_angle1 is not None or
self.tilt_angle2 is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='orthogonal_tiltType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='orthogonal_tiltType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='orthogonal_tiltType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='orthogonal_tiltType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='orthogonal_tiltType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.number_images is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_images>%s</%snumber_images>%s' % (namespace_, self.gds_format_integer(self.number_images, input_name='number_images'), namespace_, eol_))
if self.tilt_angle1 is not None:
self.tilt_angle1.export(outfile, level, namespace_, name_='tilt_angle1', pretty_print=pretty_print)
if self.tilt_angle2 is not None:
self.tilt_angle2.export(outfile, level, namespace_, name_='tilt_angle2', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'number_images':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_images')
self.number_images = ival_
elif nodeName_ == 'tilt_angle1':
obj_ = tilt_angle1Type.factory()
obj_.build(child_)
self.tilt_angle1 = obj_
obj_.original_tagname_ = 'tilt_angle1'
elif nodeName_ == 'tilt_angle2':
obj_ = tilt_angle2Type.factory()
obj_.build(child_)
self.tilt_angle2 = obj_
obj_.original_tagname_ = 'tilt_angle2'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class orthogonal_tiltType
[docs]class tilt_angle1Type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_tilt_angle1Orthogonal', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if tilt_angle1Type.subclass:
return tilt_angle1Type.subclass(*args_, **kwargs_)
else:
return tilt_angle1Type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_angle1Type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_angle1Type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_angle1Type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_angle1Type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_angle1Type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class tilt_angle1Type
[docs]class tilt_angle2Type(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_tilt_angle2Orthogonal', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if tilt_angle2Type.subclass:
return tilt_angle2Type.subclass(*args_, **kwargs_)
else:
return tilt_angle2Type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tilt_angle2Type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tilt_angle2Type')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='tilt_angle2Type', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tilt_angle2Type'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tilt_angle2Type', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class tilt_angle2Type
[docs]class originType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('col', 'xs:integer', 0),
MemberSpec_('row', 'xs:integer', 0),
MemberSpec_('sec', 'xs:integer', 0),
]
subclass = None
superclass = None
def __init__(self, col=None, row=None, sec=None):
self.original_tagname_ = None
self.col = col
self.row = row
self.sec = sec
[docs] def factory(*args_, **kwargs_):
if originType.subclass:
return originType.subclass(*args_, **kwargs_)
else:
return originType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_col(self): return self.col
[docs] def set_col(self, col): self.col = col
[docs] def get_row(self): return self.row
[docs] def set_row(self, row): self.row = row
[docs] def get_sec(self): return self.sec
[docs] def set_sec(self, sec): self.sec = sec
[docs] def hasContent_(self):
if (
self.col is not None or
self.row is not None or
self.sec is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='originType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='originType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='originType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='originType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='originType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.col is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scol>%s</%scol>%s' % (namespace_, self.gds_format_integer(self.col, input_name='col'), namespace_, eol_))
if self.row is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%srow>%s</%srow>%s' % (namespace_, self.gds_format_integer(self.row, input_name='row'), namespace_, eol_))
if self.sec is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssec>%s</%ssec>%s' % (namespace_, self.gds_format_integer(self.sec, input_name='sec'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'col':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
ival_ = self.gds_validate_integer(ival_, node, 'col')
self.col = ival_
elif nodeName_ == 'row':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
ival_ = self.gds_validate_integer(ival_, node, 'row')
self.row = ival_
elif nodeName_ == 'sec':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
ival_ = self.gds_validate_integer(ival_, node, 'sec')
self.sec = ival_
# end class originType
[docs]class spacingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('x', 'xs:positiveInteger', 0),
MemberSpec_('y', 'xs:nonNegativeInteger', 0),
MemberSpec_('z', 'xs:nonNegativeInteger', 0),
]
subclass = None
superclass = None
def __init__(self, x=None, y=None, z=None):
self.original_tagname_ = None
self.x = x
self.y = y
self.z = z
[docs] def factory(*args_, **kwargs_):
if spacingType.subclass:
return spacingType.subclass(*args_, **kwargs_)
else:
return spacingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_x(self): return self.x
[docs] def set_x(self, x): self.x = x
[docs] def get_y(self): return self.y
[docs] def set_y(self, y): self.y = y
[docs] def get_z(self): return self.z
[docs] def set_z(self, z): self.z = z
[docs] def hasContent_(self):
if (
self.x is not None or
self.y is not None or
self.z is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='spacingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='spacingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='spacingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='spacingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='spacingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.x is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sx>%s</%sx>%s' % (namespace_, self.gds_format_integer(self.x, input_name='x'), namespace_, eol_))
if self.y is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sy>%s</%sy>%s' % (namespace_, self.gds_format_integer(self.y, input_name='y'), namespace_, eol_))
if self.z is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sz>%s</%sz>%s' % (namespace_, self.gds_format_integer(self.z, input_name='z'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'x':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'x')
self.x = ival_
elif nodeName_ == 'y':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ < 0:
raise_parse_error(child_, 'requires nonNegativeInteger')
ival_ = self.gds_validate_integer(ival_, node, 'y')
self.y = ival_
elif nodeName_ == 'z':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ < 0:
raise_parse_error(child_, 'requires nonNegativeInteger')
ival_ = self.gds_validate_integer(ival_, node, 'z')
self.z = ival_
# end class spacingType
[docs]class cellType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('a', 'cell_type', 0),
MemberSpec_('b', 'cell_type', 0),
MemberSpec_('c', 'cell_type', 0),
MemberSpec_('alpha', 'cell_angle_type', 0),
MemberSpec_('beta', 'cell_angle_type', 0),
MemberSpec_('gamma', 'cell_angle_type', 0),
]
subclass = None
superclass = None
def __init__(self, a=None, b=None, c=None, alpha=None, beta=None, gamma=None):
self.original_tagname_ = None
self.a = a
self.b = b
self.c = c
self.alpha = alpha
self.beta = beta
self.gamma = gamma
[docs] def factory(*args_, **kwargs_):
if cellType.subclass:
return cellType.subclass(*args_, **kwargs_)
else:
return cellType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_a(self): return self.a
[docs] def set_a(self, a): self.a = a
[docs] def get_b(self): return self.b
[docs] def set_b(self, b): self.b = b
[docs] def get_c(self): return self.c
[docs] def set_c(self, c): self.c = c
[docs] def get_alpha(self): return self.alpha
[docs] def set_alpha(self, alpha): self.alpha = alpha
[docs] def get_beta(self): return self.beta
[docs] def set_beta(self, beta): self.beta = beta
[docs] def get_gamma(self): return self.gamma
[docs] def set_gamma(self, gamma): self.gamma = gamma
[docs] def hasContent_(self):
if (
self.a is not None or
self.b is not None or
self.c is not None or
self.alpha is not None or
self.beta is not None or
self.gamma is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='cellType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='cellType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='cellType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='cellType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='cellType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.a is not None:
self.a.export(outfile, level, namespace_, name_='a', pretty_print=pretty_print)
if self.b is not None:
self.b.export(outfile, level, namespace_, name_='b', pretty_print=pretty_print)
if self.c is not None:
self.c.export(outfile, level, namespace_, name_='c', pretty_print=pretty_print)
if self.alpha is not None:
self.alpha.export(outfile, level, namespace_, name_='alpha', pretty_print=pretty_print)
if self.beta is not None:
self.beta.export(outfile, level, namespace_, name_='beta', pretty_print=pretty_print)
if self.gamma is not None:
self.gamma.export(outfile, level, namespace_, name_='gamma', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'a':
obj_ = cell_type.factory()
obj_.build(child_)
self.a = obj_
obj_.original_tagname_ = 'a'
elif nodeName_ == 'b':
obj_ = cell_type.factory()
obj_.build(child_)
self.b = obj_
obj_.original_tagname_ = 'b'
elif nodeName_ == 'c':
obj_ = cell_type.factory()
obj_.build(child_)
self.c = obj_
obj_.original_tagname_ = 'c'
elif nodeName_ == 'alpha':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.alpha = obj_
obj_.original_tagname_ = 'alpha'
elif nodeName_ == 'beta':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.beta = obj_
obj_.original_tagname_ = 'beta'
elif nodeName_ == 'gamma':
obj_ = cell_angle_type.factory()
obj_.build(child_)
self.gamma = obj_
obj_.original_tagname_ = 'gamma'
# end class cellType
[docs]class axis_orderType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('fast', ['fastType', 'xs:token'], 0),
MemberSpec_('medium', ['mediumType', 'xs:token'], 0),
MemberSpec_('slow', ['slowType', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, fast=None, medium=None, slow=None):
self.original_tagname_ = None
self.fast = fast
self.validate_fastType(self.fast)
self.medium = medium
self.validate_mediumType(self.medium)
self.slow = slow
self.validate_slowType(self.slow)
[docs] def factory(*args_, **kwargs_):
if axis_orderType.subclass:
return axis_orderType.subclass(*args_, **kwargs_)
else:
return axis_orderType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_fast(self): return self.fast
[docs] def set_fast(self, fast): self.fast = fast
[docs] def get_medium(self): return self.medium
[docs] def set_medium(self, medium): self.medium = medium
[docs] def get_slow(self): return self.slow
[docs] def set_slow(self, slow): self.slow = slow
[docs] def validate_fastType(self, value):
# Validate type fastType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fastType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fastType_patterns_, ))
validate_fastType_patterns_ = [['^X|Y|Z$']]
[docs] def validate_mediumType(self, value):
# Validate type mediumType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_mediumType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_mediumType_patterns_, ))
validate_mediumType_patterns_ = [['^X|Y|Z$']]
[docs] def validate_slowType(self, value):
# Validate type slowType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_slowType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_slowType_patterns_, ))
validate_slowType_patterns_ = [['^X|Y|Z$']]
[docs] def hasContent_(self):
if (
self.fast is not None or
self.medium is not None or
self.slow is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='axis_orderType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='axis_orderType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='axis_orderType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='axis_orderType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='axis_orderType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.fast is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfast>%s</%sfast>%s' % (namespace_, self.gds_format_string(quote_xml(self.fast).encode(ExternalEncoding), input_name='fast'), namespace_, eol_))
if self.medium is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smedium>%s</%smedium>%s' % (namespace_, self.gds_format_string(quote_xml(self.medium).encode(ExternalEncoding), input_name='medium'), namespace_, eol_))
if self.slow is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sslow>%s</%sslow>%s' % (namespace_, self.gds_format_string(quote_xml(self.slow).encode(ExternalEncoding), input_name='slow'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'fast':
fast_ = child_.text
fast_ = re_.sub(String_cleanup_pat_, " ", fast_).strip()
fast_ = self.gds_validate_string(fast_, node, 'fast')
self.fast = fast_
# validate type fastType
self.validate_fastType(self.fast)
elif nodeName_ == 'medium':
medium_ = child_.text
medium_ = re_.sub(String_cleanup_pat_, " ", medium_).strip()
medium_ = self.gds_validate_string(medium_, node, 'medium')
self.medium = medium_
# validate type mediumType
self.validate_mediumType(self.medium)
elif nodeName_ == 'slow':
slow_ = child_.text
slow_ = re_.sub(String_cleanup_pat_, " ", slow_).strip()
slow_ = self.gds_validate_string(slow_, node, 'slow')
self.slow = slow_
# validate type slowType
self.validate_slowType(self.slow)
# end class axis_orderType
[docs]class pixel_spacingType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('x', 'pixel_spacing_type', 0),
MemberSpec_('y', 'pixel_spacing_type', 0),
MemberSpec_('z', 'pixel_spacing_type', 0),
]
subclass = None
superclass = None
def __init__(self, x=None, y=None, z=None):
self.original_tagname_ = None
self.x = x
self.y = y
self.z = z
[docs] def factory(*args_, **kwargs_):
if pixel_spacingType.subclass:
return pixel_spacingType.subclass(*args_, **kwargs_)
else:
return pixel_spacingType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_x(self): return self.x
[docs] def set_x(self, x): self.x = x
[docs] def get_y(self): return self.y
[docs] def set_y(self, y): self.y = y
[docs] def get_z(self): return self.z
[docs] def set_z(self, z): self.z = z
[docs] def hasContent_(self):
if (
self.x is not None or
self.y is not None or
self.z is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='pixel_spacingType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='pixel_spacingType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='pixel_spacingType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pixel_spacingType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='pixel_spacingType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.x is not None:
self.x.export(outfile, level, namespace_, name_='x', pretty_print=pretty_print)
if self.y is not None:
self.y.export(outfile, level, namespace_, name_='y', pretty_print=pretty_print)
if self.z is not None:
self.z.export(outfile, level, namespace_, name_='z', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'x':
obj_ = pixel_spacing_type.factory()
obj_.build(child_)
self.x = obj_
obj_.original_tagname_ = 'x'
elif nodeName_ == 'y':
obj_ = pixel_spacing_type.factory()
obj_.build(child_)
self.y = obj_
obj_.original_tagname_ = 'y'
elif nodeName_ == 'z':
obj_ = pixel_spacing_type.factory()
obj_.build(child_)
self.z = obj_
obj_.original_tagname_ = 'z'
# end class pixel_spacingType
[docs]class contour_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('contour', 'contourType', 1),
]
subclass = None
superclass = None
def __init__(self, contour=None):
self.original_tagname_ = None
if contour is None:
self.contour = []
else:
self.contour = contour
[docs] def factory(*args_, **kwargs_):
if contour_listType.subclass:
return contour_listType.subclass(*args_, **kwargs_)
else:
return contour_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_contour(self): return self.contour
[docs] def set_contour(self, contour): self.contour = contour
[docs] def add_contour(self, value): self.contour.append(value)
[docs] def insert_contour_at(self, index, value): self.contour.insert(index, value)
[docs] def replace_contour_at(self, index, value): self.contour[index] = value
[docs] def hasContent_(self):
if (
self.contour
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='contour_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='contour_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='contour_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='contour_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='contour_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for contour_ in self.contour:
contour_.export(outfile, level, namespace_, name_='contour', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'contour':
obj_ = contourType.factory()
obj_.build(child_)
self.contour.append(obj_)
obj_.original_tagname_ = 'contour'
# end class contour_listType
[docs]class contourType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('primary', 'xs:boolean', 0),
MemberSpec_('level', 'xs:float', 0),
MemberSpec_('source', ['sourceType', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, primary=None, level=None, source=None):
self.original_tagname_ = None
self.primary = _cast(bool, primary)
self.level = level
self.source = source
self.validate_sourceType(self.source)
[docs] def factory(*args_, **kwargs_):
if contourType.subclass:
return contourType.subclass(*args_, **kwargs_)
else:
return contourType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_level(self): return self.level
[docs] def set_level(self, level): self.level = level
[docs] def get_source(self): return self.source
[docs] def set_source(self, source): self.source = source
[docs] def get_primary(self): return self.primary
[docs] def set_primary(self, primary): self.primary = primary
[docs] def validate_sourceType(self, value):
# Validate type sourceType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['EMDB', 'AUTHOR']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on sourceType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.level is not None or
self.source is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='contourType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='contourType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='contourType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='contourType'):
if self.primary is not None and 'primary' not in already_processed:
already_processed.add('primary')
outfile.write(' primary="%s"' % self.gds_format_boolean(self.primary, input_name='primary'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='contourType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.level is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%slevel>%s</%slevel>%s' % (namespace_, self.gds_format_float(self.level, input_name='level'), namespace_, eol_))
if self.source is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssource>%s</%ssource>%s' % (namespace_, self.gds_format_string(quote_xml(self.source).encode(ExternalEncoding), input_name='source'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('primary', node)
if value is not None and 'primary' not in already_processed:
already_processed.add('primary')
if value in ('true', '1'):
self.primary = True
elif value in ('false', '0'):
self.primary = False
else:
raise_parse_error(node, 'Bad boolean attribute')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'level':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'level')
self.level = fval_
elif nodeName_ == 'source':
source_ = child_.text
source_ = re_.sub(String_cleanup_pat_, " ", source_).strip()
source_ = self.gds_validate_string(source_, node, 'source')
self.source = source_
# validate type sourceType
self.validate_sourceType(self.source)
[docs]class natural_sourceType(base_natural_source_type):
member_data_items_ = [
MemberSpec_('organ', 'xs:token', 0),
MemberSpec_('tissue', 'tissue', 0),
MemberSpec_('cell', 'cell', 0),
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, organ=None, tissue=None, cell=None):
self.original_tagname_ = None
super(natural_sourceType, self).__init__(database, organism, strain, synonym_organism, )
self.organ = organ
self.tissue = tissue
self.cell = cell
[docs] def factory(*args_, **kwargs_):
if natural_sourceType.subclass:
return natural_sourceType.subclass(*args_, **kwargs_)
else:
return natural_sourceType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organ(self): return self.organ
[docs] def set_organ(self, organ): self.organ = organ
[docs] def get_tissue(self): return self.tissue
[docs] def set_tissue(self, tissue): self.tissue = tissue
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def hasContent_(self):
if (
self.organ is not None or
self.tissue is not None or
self.cell is not None or
super(natural_sourceType, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_sourceType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_sourceType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_sourceType'):
super(natural_sourceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_sourceType', fromsubclass_=False, pretty_print=True):
super(natural_sourceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorgan>%s</%sorgan>%s' % (namespace_, self.gds_format_string(quote_xml(self.organ).encode(ExternalEncoding), input_name='organ'), namespace_, eol_))
if self.tissue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stissue>%s</%stissue>%s' % (namespace_, self.gds_format_string(quote_xml(self.tissue).encode(ExternalEncoding), input_name='tissue'), namespace_, eol_))
if self.cell is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scell>%s</%scell>%s' % (namespace_, self.gds_format_string(quote_xml(self.cell).encode(ExternalEncoding), input_name='cell'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_sourceType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organ':
organ_ = child_.text
organ_ = re_.sub(String_cleanup_pat_, " ", organ_).strip()
organ_ = self.gds_validate_string(organ_, node, 'organ')
self.organ = organ_
elif nodeName_ == 'tissue':
tissue_ = child_.text
tissue_ = re_.sub(String_cleanup_pat_, " ", tissue_).strip()
tissue_ = self.gds_validate_string(tissue_, node, 'tissue')
self.tissue = tissue_
elif nodeName_ == 'cell':
cell_ = child_.text
cell_ = re_.sub(String_cleanup_pat_, " ", cell_).strip()
cell_ = self.gds_validate_string(cell_, node, 'cell')
self.cell = cell_
super(natural_sourceType, self).buildChildren(child_, node, nodeName_, True)
# end class natural_sourceType
[docs]class natural_sourceType36(base_natural_source_type):
member_data_items_ = [
MemberSpec_('organ', 'xs:token', 0),
MemberSpec_('tissue', 'tissue', 0),
MemberSpec_('cell', 'cell', 0),
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, organ=None, tissue=None, cell=None):
self.original_tagname_ = None
super(natural_sourceType36, self).__init__(database, organism, strain, synonym_organism, )
self.organ = organ
self.tissue = tissue
self.cell = cell
[docs] def factory(*args_, **kwargs_):
if natural_sourceType36.subclass:
return natural_sourceType36.subclass(*args_, **kwargs_)
else:
return natural_sourceType36(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organ(self): return self.organ
[docs] def set_organ(self, organ): self.organ = organ
[docs] def get_tissue(self): return self.tissue
[docs] def set_tissue(self, tissue): self.tissue = tissue
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def hasContent_(self):
if (
self.organ is not None or
self.tissue is not None or
self.cell is not None or
super(natural_sourceType36, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_sourceType36', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType36')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_sourceType36', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_sourceType36'):
super(natural_sourceType36, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType36')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_sourceType36', fromsubclass_=False, pretty_print=True):
super(natural_sourceType36, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorgan>%s</%sorgan>%s' % (namespace_, self.gds_format_string(quote_xml(self.organ).encode(ExternalEncoding), input_name='organ'), namespace_, eol_))
if self.tissue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stissue>%s</%stissue>%s' % (namespace_, self.gds_format_string(quote_xml(self.tissue).encode(ExternalEncoding), input_name='tissue'), namespace_, eol_))
if self.cell is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scell>%s</%scell>%s' % (namespace_, self.gds_format_string(quote_xml(self.cell).encode(ExternalEncoding), input_name='cell'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_sourceType36, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organ':
organ_ = child_.text
organ_ = re_.sub(String_cleanup_pat_, " ", organ_).strip()
organ_ = self.gds_validate_string(organ_, node, 'organ')
self.organ = organ_
elif nodeName_ == 'tissue':
tissue_ = child_.text
tissue_ = re_.sub(String_cleanup_pat_, " ", tissue_).strip()
tissue_ = self.gds_validate_string(tissue_, node, 'tissue')
self.tissue = tissue_
elif nodeName_ == 'cell':
cell_ = child_.text
cell_ = re_.sub(String_cleanup_pat_, " ", cell_).strip()
cell_ = self.gds_validate_string(cell_, node, 'cell')
self.cell = cell_
super(natural_sourceType36, self).buildChildren(child_, node, nodeName_, True)
# end class natural_sourceType36
[docs]class natural_sourceType37(base_natural_source_type):
member_data_items_ = [
MemberSpec_('organ', 'xs:token', 0),
MemberSpec_('tissue', 'tissue', 0),
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, organ=None, tissue=None):
self.original_tagname_ = None
super(natural_sourceType37, self).__init__(database, organism, strain, synonym_organism, )
self.organ = organ
self.tissue = tissue
[docs] def factory(*args_, **kwargs_):
if natural_sourceType37.subclass:
return natural_sourceType37.subclass(*args_, **kwargs_)
else:
return natural_sourceType37(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organ(self): return self.organ
[docs] def set_organ(self, organ): self.organ = organ
[docs] def get_tissue(self): return self.tissue
[docs] def set_tissue(self, tissue): self.tissue = tissue
[docs] def hasContent_(self):
if (
self.organ is not None or
self.tissue is not None or
super(natural_sourceType37, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_sourceType37', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType37')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_sourceType37', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_sourceType37'):
super(natural_sourceType37, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType37')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_sourceType37', fromsubclass_=False, pretty_print=True):
super(natural_sourceType37, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorgan>%s</%sorgan>%s' % (namespace_, self.gds_format_string(quote_xml(self.organ).encode(ExternalEncoding), input_name='organ'), namespace_, eol_))
if self.tissue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stissue>%s</%stissue>%s' % (namespace_, self.gds_format_string(quote_xml(self.tissue).encode(ExternalEncoding), input_name='tissue'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_sourceType37, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organ':
organ_ = child_.text
organ_ = re_.sub(String_cleanup_pat_, " ", organ_).strip()
organ_ = self.gds_validate_string(organ_, node, 'organ')
self.organ = organ_
elif nodeName_ == 'tissue':
tissue_ = child_.text
tissue_ = re_.sub(String_cleanup_pat_, " ", tissue_).strip()
tissue_ = self.gds_validate_string(tissue_, node, 'tissue')
self.tissue = tissue_
super(natural_sourceType37, self).buildChildren(child_, node, nodeName_, True)
# end class natural_sourceType37
[docs]class natural_sourceType38(base_natural_source_type):
member_data_items_ = [
MemberSpec_('organ', 'xs:token', 0),
MemberSpec_('tissue', 'tissue', 0),
MemberSpec_('cell', 'cell', 0),
MemberSpec_('organelle', 'xs:token', 0),
MemberSpec_('cellular_location', 'xs:token', 0),
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None, organ=None, tissue=None, cell=None, organelle=None, cellular_location=None):
self.original_tagname_ = None
super(natural_sourceType38, self).__init__(database, organism, strain, synonym_organism, )
self.organ = organ
self.tissue = tissue
self.cell = cell
self.organelle = organelle
self.cellular_location = cellular_location
[docs] def factory(*args_, **kwargs_):
if natural_sourceType38.subclass:
return natural_sourceType38.subclass(*args_, **kwargs_)
else:
return natural_sourceType38(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_organ(self): return self.organ
[docs] def set_organ(self, organ): self.organ = organ
[docs] def get_tissue(self): return self.tissue
[docs] def set_tissue(self, tissue): self.tissue = tissue
[docs] def get_cell(self): return self.cell
[docs] def set_cell(self, cell): self.cell = cell
[docs] def get_organelle(self): return self.organelle
[docs] def set_organelle(self, organelle): self.organelle = organelle
[docs] def get_cellular_location(self): return self.cellular_location
[docs] def set_cellular_location(self, cellular_location): self.cellular_location = cellular_location
[docs] def hasContent_(self):
if (
self.organ is not None or
self.tissue is not None or
self.cell is not None or
self.organelle is not None or
self.cellular_location is not None or
super(natural_sourceType38, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_sourceType38', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType38')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_sourceType38', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_sourceType38'):
super(natural_sourceType38, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_sourceType38')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_sourceType38', fromsubclass_=False, pretty_print=True):
super(natural_sourceType38, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.organ is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorgan>%s</%sorgan>%s' % (namespace_, self.gds_format_string(quote_xml(self.organ).encode(ExternalEncoding), input_name='organ'), namespace_, eol_))
if self.tissue is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%stissue>%s</%stissue>%s' % (namespace_, self.gds_format_string(quote_xml(self.tissue).encode(ExternalEncoding), input_name='tissue'), namespace_, eol_))
if self.cell is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scell>%s</%scell>%s' % (namespace_, self.gds_format_string(quote_xml(self.cell).encode(ExternalEncoding), input_name='cell'), namespace_, eol_))
if self.organelle is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sorganelle>%s</%sorganelle>%s' % (namespace_, self.gds_format_string(quote_xml(self.organelle).encode(ExternalEncoding), input_name='organelle'), namespace_, eol_))
if self.cellular_location is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%scellular_location>%s</%scellular_location>%s' % (namespace_, self.gds_format_string(quote_xml(self.cellular_location).encode(ExternalEncoding), input_name='cellular_location'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_sourceType38, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'organ':
organ_ = child_.text
organ_ = re_.sub(String_cleanup_pat_, " ", organ_).strip()
organ_ = self.gds_validate_string(organ_, node, 'organ')
self.organ = organ_
elif nodeName_ == 'tissue':
tissue_ = child_.text
tissue_ = re_.sub(String_cleanup_pat_, " ", tissue_).strip()
tissue_ = self.gds_validate_string(tissue_, node, 'tissue')
self.tissue = tissue_
elif nodeName_ == 'cell':
cell_ = child_.text
cell_ = re_.sub(String_cleanup_pat_, " ", cell_).strip()
cell_ = self.gds_validate_string(cell_, node, 'cell')
self.cell = cell_
elif nodeName_ == 'organelle':
organelle_ = child_.text
organelle_ = re_.sub(String_cleanup_pat_, " ", organelle_).strip()
organelle_ = self.gds_validate_string(organelle_, node, 'organelle')
self.organelle = organelle_
elif nodeName_ == 'cellular_location':
cellular_location_ = child_.text
cellular_location_ = re_.sub(String_cleanup_pat_, " ", cellular_location_).strip()
cellular_location_ = self.gds_validate_string(cellular_location_, node, 'cellular_location')
self.cellular_location = cellular_location_
super(natural_sourceType38, self).buildChildren(child_, node, nodeName_, True)
# end class natural_sourceType38
[docs]class natural_hostType(base_natural_source_type):
member_data_items_ = [
]
subclass = None
superclass = base_natural_source_type
def __init__(self, database=None, organism=None, strain=None, synonym_organism=None):
self.original_tagname_ = None
super(natural_hostType, self).__init__(database, organism, strain, synonym_organism, )
[docs] def factory(*args_, **kwargs_):
if natural_hostType.subclass:
return natural_hostType.subclass(*args_, **kwargs_)
else:
return natural_hostType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
super(natural_hostType, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='natural_hostType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='natural_hostType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='natural_hostType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='natural_hostType'):
super(natural_hostType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='natural_hostType')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='natural_hostType', fromsubclass_=False, pretty_print=True):
super(natural_hostType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(natural_hostType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
super(natural_hostType, self).buildChildren(child_, node, nodeName_, True)
pass
# end class natural_hostType
[docs]class virus_shellType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('diameter', 'diameterType', 0),
MemberSpec_('triangulation', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, name=None, diameter=None, triangulation=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.name = name
self.diameter = diameter
self.triangulation = triangulation
[docs] def factory(*args_, **kwargs_):
if virus_shellType.subclass:
return virus_shellType.subclass(*args_, **kwargs_)
else:
return virus_shellType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_diameter(self): return self.diameter
[docs] def set_diameter(self, diameter): self.diameter = diameter
[docs] def get_triangulation(self): return self.triangulation
[docs] def set_triangulation(self, triangulation): self.triangulation = triangulation
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def hasContent_(self):
if (
self.name is not None or
self.diameter is not None or
self.triangulation is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='virus_shellType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='virus_shellType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='virus_shellType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='virus_shellType'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='virus_shellType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.diameter is not None:
self.diameter.export(outfile, level, namespace_, name_='diameter', pretty_print=pretty_print)
if self.triangulation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%striangulation>%s</%striangulation>%s' % (namespace_, self.gds_format_integer(self.triangulation, input_name='triangulation'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'diameter':
obj_ = diameterType.factory()
obj_.build(child_)
self.diameter = obj_
obj_.original_tagname_ = 'diameter'
elif nodeName_ == 'triangulation':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'triangulation')
self.triangulation = ival_
# end class virus_shellType
[docs]class diameterType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_shell_diameter', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if diameterType.subclass:
return diameterType.subclass(*args_, **kwargs_)
else:
return diameterType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='diameterType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='diameterType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='diameterType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='diameterType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='diameterType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class diameterType
[docs]class categoryType(GeneratedsSuper):
"""Currently we only support Gene Ontology."""
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', ['complex_category_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if categoryType.subclass:
return categoryType.subclass(*args_, **kwargs_)
else:
return categoryType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='categoryType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='categoryType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='categoryType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='categoryType'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='categoryType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class categoryType
[docs]class macromolecule_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('macromolecule', 'base_macromolecule_type', 1),
]
subclass = None
superclass = None
def __init__(self, macromolecule=None):
self.original_tagname_ = None
if macromolecule is None:
self.macromolecule = []
else:
self.macromolecule = macromolecule
[docs] def factory(*args_, **kwargs_):
if macromolecule_listType.subclass:
return macromolecule_listType.subclass(*args_, **kwargs_)
else:
return macromolecule_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_macromolecule(self): return self.macromolecule
[docs] def set_macromolecule(self, macromolecule): self.macromolecule = macromolecule
[docs] def add_macromolecule(self, value): self.macromolecule.append(value)
[docs] def insert_macromolecule_at(self, index, value): self.macromolecule.insert(index, value)
[docs] def replace_macromolecule_at(self, index, value): self.macromolecule[index] = value
[docs] def hasContent_(self):
if (
self.macromolecule
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='macromolecule_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='macromolecule_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='macromolecule_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='macromolecule_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='macromolecule_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for macromolecule_ in self.macromolecule:
macromolecule_.export(outfile, level, namespace_, name_='macromolecule', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'macromolecule':
obj_ = macromoleculeType.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'macromolecule'
elif nodeName_ == 'protein_or_peptide':
obj_ = protein_or_peptide.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'protein_or_peptide'
elif nodeName_ == 'dna':
obj_ = dna.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'dna'
elif nodeName_ == 'rna':
obj_ = rna.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'rna'
elif nodeName_ == 'saccharide':
obj_ = saccharide.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'saccharide'
elif nodeName_ == 'lipid':
obj_ = lipid.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'lipid'
elif nodeName_ == 'ligand':
obj_ = ligand.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'ligand'
elif nodeName_ == 'em_label':
obj_ = em_label.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'em_label'
elif nodeName_ == 'other_macromolecule':
obj_ = other_macromolecule.factory()
obj_.build(child_)
self.macromolecule.append(obj_)
obj_.original_tagname_ = 'other_macromolecule'
# end class macromolecule_listType
[docs]class macromoleculeType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('number_of_copies', 'xs:positiveInteger', 0),
MemberSpec_('oligomeric_state', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, number_of_copies=None, oligomeric_state=None):
self.original_tagname_ = None
self.id = id
self.number_of_copies = number_of_copies
self.oligomeric_state = oligomeric_state
[docs] def factory(*args_, **kwargs_):
if macromoleculeType.subclass:
return macromoleculeType.subclass(*args_, **kwargs_)
else:
return macromoleculeType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_number_of_copies(self): return self.number_of_copies
[docs] def set_number_of_copies(self, number_of_copies): self.number_of_copies = number_of_copies
[docs] def get_oligomeric_state(self): return self.oligomeric_state
[docs] def set_oligomeric_state(self, oligomeric_state): self.oligomeric_state = oligomeric_state
[docs] def hasContent_(self):
if (
self.id is not None or
self.number_of_copies is not None or
self.oligomeric_state is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='macromoleculeType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='macromoleculeType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='macromoleculeType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='macromoleculeType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='macromoleculeType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sid>%s</%sid>%s' % (namespace_, self.gds_format_integer(self.id, input_name='id'), namespace_, eol_))
if self.number_of_copies is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_of_copies>%s</%snumber_of_copies>%s' % (namespace_, self.gds_format_integer(self.number_of_copies, input_name='number_of_copies'), namespace_, eol_))
if self.oligomeric_state is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%soligomeric_state>%s</%soligomeric_state>%s' % (namespace_, self.gds_format_string(quote_xml(self.oligomeric_state).encode(ExternalEncoding), input_name='oligomeric_state'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'id')
self.id = ival_
elif nodeName_ == 'number_of_copies':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_of_copies')
self.number_of_copies = ival_
elif nodeName_ == 'oligomeric_state':
oligomeric_state_ = child_.text
oligomeric_state_ = re_.sub(String_cleanup_pat_, " ", oligomeric_state_).strip()
oligomeric_state_ = self.gds_validate_string(oligomeric_state_, node, 'oligomeric_state')
self.oligomeric_state = oligomeric_state_
# end class macromoleculeType
[docs]class external_referencesType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType.subclass:
return external_referencesType.subclass(*args_, **kwargs_)
else:
return external_referencesType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType
[docs]class categoryType39(GeneratedsSuper):
"""Currently we only support Gene Ontology."""
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', ['complex_category_type', 'xs:token'], 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if categoryType39.subclass:
return categoryType39.subclass(*args_, **kwargs_)
else:
return categoryType39(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='categoryType39', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='categoryType39')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='categoryType39', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='categoryType39'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='categoryType39', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class categoryType39
[docs]class macromolecule_listType40(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('macromolecule_id', 'xs:positiveInteger', 1),
]
subclass = None
superclass = None
def __init__(self, macromolecule_id=None):
self.original_tagname_ = None
if macromolecule_id is None:
self.macromolecule_id = []
else:
self.macromolecule_id = macromolecule_id
[docs] def factory(*args_, **kwargs_):
if macromolecule_listType40.subclass:
return macromolecule_listType40.subclass(*args_, **kwargs_)
else:
return macromolecule_listType40(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_macromolecule_id(self): return self.macromolecule_id
[docs] def set_macromolecule_id(self, macromolecule_id): self.macromolecule_id = macromolecule_id
[docs] def add_macromolecule_id(self, value): self.macromolecule_id.append(value)
[docs] def insert_macromolecule_id_at(self, index, value): self.macromolecule_id.insert(index, value)
[docs] def replace_macromolecule_id_at(self, index, value): self.macromolecule_id[index] = value
[docs] def hasContent_(self):
if (
self.macromolecule_id
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='macromolecule_listType40', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='macromolecule_listType40')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='macromolecule_listType40', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='macromolecule_listType40'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='macromolecule_listType40', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for macromolecule_id_ in self.macromolecule_id:
showIndent(outfile, level, pretty_print)
outfile.write('<%smacromolecule_id>%s</%smacromolecule_id>%s' % (namespace_, self.gds_format_integer(macromolecule_id_, input_name='macromolecule_id'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'macromolecule_id':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'macromolecule_id')
self.macromolecule_id.append(ival_)
# end class macromolecule_listType40
[docs]class molecular_weightType(GeneratedsSuper):
"""kDa/nm is for helices."""
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('theoretical', 'xs:boolean', 0),
MemberSpec_('valueOf_', ['allowed_assembly_weights', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, theoretical=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.theoretical = _cast(bool, theoretical)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if molecular_weightType.subclass:
return molecular_weightType.subclass(*args_, **kwargs_)
else:
return molecular_weightType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_theoretical(self): return self.theoretical
[docs] def set_theoretical(self, theoretical): self.theoretical = theoretical
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='molecular_weightType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='molecular_weightType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='molecular_weightType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='molecular_weightType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
if self.theoretical is not None and 'theoretical' not in already_processed:
already_processed.add('theoretical')
outfile.write(' theoretical="%s"' % self.gds_format_boolean(self.theoretical, input_name='theoretical'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='molecular_weightType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
value = find_attr_value_('theoretical', node)
if value is not None and 'theoretical' not in already_processed:
already_processed.add('theoretical')
if value in ('true', '1'):
self.theoretical = True
elif value in ('false', '0'):
self.theoretical = False
else:
raise_parse_error(node, 'Bad boolean attribute')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class molecular_weightType
[docs]class virus_shellType41(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('name', 'xs:token', 0),
MemberSpec_('diameter', 'diameterType42', 0),
MemberSpec_('triangulation', 'xs:positiveInteger', 0),
]
subclass = None
superclass = None
def __init__(self, name=None, diameter=None, triangulation=None):
self.original_tagname_ = None
self.name = name
self.diameter = diameter
self.triangulation = triangulation
[docs] def factory(*args_, **kwargs_):
if virus_shellType41.subclass:
return virus_shellType41.subclass(*args_, **kwargs_)
else:
return virus_shellType41(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_diameter(self): return self.diameter
[docs] def set_diameter(self, diameter): self.diameter = diameter
[docs] def get_triangulation(self): return self.triangulation
[docs] def set_triangulation(self, triangulation): self.triangulation = triangulation
[docs] def hasContent_(self):
if (
self.name is not None or
self.diameter is not None or
self.triangulation is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='virus_shellType41', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='virus_shellType41')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='virus_shellType41', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='virus_shellType41'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='virus_shellType41', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
if self.diameter is not None:
self.diameter.export(outfile, level, namespace_, name_='diameter', pretty_print=pretty_print)
if self.triangulation is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%striangulation>%s</%striangulation>%s' % (namespace_, self.gds_format_integer(self.triangulation, input_name='triangulation'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'name':
name_ = child_.text
name_ = re_.sub(String_cleanup_pat_, " ", name_).strip()
name_ = self.gds_validate_string(name_, node, 'name')
self.name = name_
elif nodeName_ == 'diameter':
obj_ = diameterType42.factory()
obj_.build(child_)
self.diameter = obj_
obj_.original_tagname_ = 'diameter'
elif nodeName_ == 'triangulation':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'triangulation')
self.triangulation = ival_
# end class virus_shellType41
[docs]class diameterType42(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', ['allowed_shell_diameter', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if diameterType42.subclass:
return diameterType42.subclass(*args_, **kwargs_)
else:
return diameterType42(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='diameterType42', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='diameterType42')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='diameterType42', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='diameterType42'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='diameterType42', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class diameterType42
[docs]class modelling_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('modelling', 'modelling_type', 1),
]
subclass = None
superclass = None
def __init__(self, modelling=None):
self.original_tagname_ = None
if modelling is None:
self.modelling = []
else:
self.modelling = modelling
[docs] def factory(*args_, **kwargs_):
if modelling_listType.subclass:
return modelling_listType.subclass(*args_, **kwargs_)
else:
return modelling_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_modelling(self): return self.modelling
[docs] def set_modelling(self, modelling): self.modelling = modelling
[docs] def add_modelling(self, value): self.modelling.append(value)
[docs] def insert_modelling_at(self, index, value): self.modelling.insert(index, value)
[docs] def replace_modelling_at(self, index, value): self.modelling[index] = value
[docs] def hasContent_(self):
if (
self.modelling
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='modelling_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='modelling_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='modelling_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='modelling_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='modelling_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for modelling_ in self.modelling:
modelling_.export(outfile, level, namespace_, name_='modelling', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'modelling':
obj_ = modelling_type.factory()
obj_.build(child_)
self.modelling.append(obj_)
obj_.original_tagname_ = 'modelling'
# end class modelling_listType
[docs]class segmentation_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('segmentation', 'segmentationType', 1),
]
subclass = None
superclass = None
def __init__(self, segmentation=None):
self.original_tagname_ = None
if segmentation is None:
self.segmentation = []
else:
self.segmentation = segmentation
[docs] def factory(*args_, **kwargs_):
if segmentation_listType.subclass:
return segmentation_listType.subclass(*args_, **kwargs_)
else:
return segmentation_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_segmentation(self): return self.segmentation
[docs] def set_segmentation(self, segmentation): self.segmentation = segmentation
[docs] def add_segmentation(self, value): self.segmentation.append(value)
[docs] def insert_segmentation_at(self, index, value): self.segmentation.insert(index, value)
[docs] def replace_segmentation_at(self, index, value): self.segmentation[index] = value
[docs] def hasContent_(self):
if (
self.segmentation
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segmentation_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segmentation_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='segmentation_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segmentation_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segmentation_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for segmentation_ in self.segmentation:
segmentation_.export(outfile, level, namespace_, name_='segmentation', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'segmentation':
obj_ = segmentationType.factory()
obj_.build(child_)
self.segmentation.append(obj_)
obj_.original_tagname_ = 'segmentation'
# end class segmentation_listType
[docs]class segmentationType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('file', ['fileType43', 'xs:token'], 0),
MemberSpec_('details', 'xs:string', 0),
MemberSpec_('mask_details', 'map_type', 0),
]
subclass = None
superclass = None
def __init__(self, file=None, details=None, mask_details=None):
self.original_tagname_ = None
self.file = file
self.validate_fileType43(self.file)
self.details = details
self.mask_details = mask_details
[docs] def factory(*args_, **kwargs_):
if segmentationType.subclass:
return segmentationType.subclass(*args_, **kwargs_)
else:
return segmentationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_file(self): return self.file
[docs] def set_file(self, file): self.file = file
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def get_mask_details(self): return self.mask_details
[docs] def set_mask_details(self, mask_details): self.mask_details = mask_details
[docs] def validate_fileType43(self, value):
# Validate type fileType43, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_fileType43_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_fileType43_patterns_, ))
validate_fileType43_patterns_ = [['^emd_\\d{4,}_seg.xml$']]
[docs] def hasContent_(self):
if (
self.file is not None or
self.details is not None or
self.mask_details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='segmentationType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='segmentationType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='segmentationType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='segmentationType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='segmentationType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.file is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfile>%s</%sfile>%s' % (namespace_, self.gds_format_string(quote_xml(self.file).encode(ExternalEncoding), input_name='file'), namespace_, eol_))
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
if self.mask_details is not None:
self.mask_details.export(outfile, level, namespace_, name_='mask_details', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'file':
file_ = child_.text
file_ = re_.sub(String_cleanup_pat_, " ", file_).strip()
file_ = self.gds_validate_string(file_, node, 'file')
self.file = file_
# validate type fileType43
self.validate_fileType43(self.file)
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
elif nodeName_ == 'mask_details':
obj_ = map_type.factory()
obj_.build(child_)
self.mask_details = obj_
obj_.original_tagname_ = 'mask_details'
# end class segmentationType
[docs]class slices_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('slice', 'map_type', 1),
]
subclass = None
superclass = None
def __init__(self, slice=None):
self.original_tagname_ = None
if slice is None:
self.slice = []
else:
self.slice = slice
[docs] def factory(*args_, **kwargs_):
if slices_listType.subclass:
return slices_listType.subclass(*args_, **kwargs_)
else:
return slices_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_slice(self): return self.slice
[docs] def set_slice(self, slice): self.slice = slice
[docs] def add_slice(self, value): self.slice.append(value)
[docs] def insert_slice_at(self, index, value): self.slice.insert(index, value)
[docs] def replace_slice_at(self, index, value): self.slice[index] = value
[docs] def hasContent_(self):
if (
self.slice
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='slices_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='slices_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='slices_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='slices_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='slices_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for slice_ in self.slice:
slice_.export(outfile, level, namespace_, name_='slice', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'slice':
obj_ = map_type.factory()
obj_.build(child_)
self.slice.append(obj_)
obj_.original_tagname_ = 'slice'
# end class slices_listType
[docs]class additional_map_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('additional_map', 'map_type', 1),
]
subclass = None
superclass = None
def __init__(self, additional_map=None):
self.original_tagname_ = None
if additional_map is None:
self.additional_map = []
else:
self.additional_map = additional_map
[docs] def factory(*args_, **kwargs_):
if additional_map_listType.subclass:
return additional_map_listType.subclass(*args_, **kwargs_)
else:
return additional_map_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_additional_map(self): return self.additional_map
[docs] def set_additional_map(self, additional_map): self.additional_map = additional_map
[docs] def add_additional_map(self, value): self.additional_map.append(value)
[docs] def insert_additional_map_at(self, index, value): self.additional_map.insert(index, value)
[docs] def replace_additional_map_at(self, index, value): self.additional_map[index] = value
[docs] def hasContent_(self):
if (
self.additional_map
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='additional_map_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='additional_map_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='additional_map_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='additional_map_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='additional_map_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for additional_map_ in self.additional_map:
additional_map_.export(outfile, level, namespace_, name_='additional_map', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'additional_map':
obj_ = map_type.factory()
obj_.build(child_)
self.additional_map.append(obj_)
obj_.original_tagname_ = 'additional_map'
# end class additional_map_listType
[docs]class half_map_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('half_map', 'map_type', 1),
]
subclass = None
superclass = None
def __init__(self, half_map=None):
self.original_tagname_ = None
if half_map is None:
self.half_map = []
else:
self.half_map = half_map
[docs] def factory(*args_, **kwargs_):
if half_map_listType.subclass:
return half_map_listType.subclass(*args_, **kwargs_)
else:
return half_map_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_half_map(self): return self.half_map
[docs] def set_half_map(self, half_map): self.half_map = half_map
[docs] def add_half_map(self, value): self.half_map.append(value)
[docs] def insert_half_map_at(self, index, value): self.half_map.insert(index, value)
[docs] def replace_half_map_at(self, index, value): self.half_map[index] = value
[docs] def hasContent_(self):
if (
self.half_map
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='half_map_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='half_map_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='half_map_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='half_map_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='half_map_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for half_map_ in self.half_map:
half_map_.export(outfile, level, namespace_, name_='half_map', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'half_map':
obj_ = map_type.factory()
obj_.build(child_)
self.half_map.append(obj_)
obj_.original_tagname_ = 'half_map'
# end class half_map_listType
[docs]class external_referencesType45(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType45.subclass:
return external_referencesType45.subclass(*args_, **kwargs_)
else:
return external_referencesType45(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType45', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType45')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType45', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType45'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType45', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType45
[docs]class external_referencesType47(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType47.subclass:
return external_referencesType47.subclass(*args_, **kwargs_)
else:
return external_referencesType47(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType47', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType47')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType47', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType47'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType47', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType47
[docs]class dimensionsType49(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('radius', 'radiusType', 0),
MemberSpec_('width', 'widthType50', 0),
MemberSpec_('height', 'heightType51', 0),
MemberSpec_('depth', 'depthType', 0),
]
subclass = None
superclass = None
def __init__(self, radius=None, width=None, height=None, depth=None):
self.original_tagname_ = None
self.radius = radius
self.width = width
self.height = height
self.depth = depth
[docs] def factory(*args_, **kwargs_):
if dimensionsType49.subclass:
return dimensionsType49.subclass(*args_, **kwargs_)
else:
return dimensionsType49(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_radius(self): return self.radius
[docs] def set_radius(self, radius): self.radius = radius
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_height(self): return self.height
[docs] def set_height(self, height): self.height = height
[docs] def get_depth(self): return self.depth
[docs] def set_depth(self, depth): self.depth = depth
[docs] def hasContent_(self):
if (
self.radius is not None or
self.width is not None or
self.height is not None or
self.depth is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='dimensionsType49', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='dimensionsType49')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='dimensionsType49', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='dimensionsType49'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='dimensionsType49', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.radius is not None:
self.radius.export(outfile, level, namespace_, name_='radius', pretty_print=pretty_print)
if self.width is not None:
self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
if self.height is not None:
self.height.export(outfile, level, namespace_, name_='height', pretty_print=pretty_print)
if self.depth is not None:
self.depth.export(outfile, level, namespace_, name_='depth', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'radius':
obj_ = radiusType.factory()
obj_.build(child_)
self.radius = obj_
obj_.original_tagname_ = 'radius'
elif nodeName_ == 'width':
obj_ = widthType50.factory()
obj_.build(child_)
self.width = obj_
obj_.original_tagname_ = 'width'
elif nodeName_ == 'height':
obj_ = heightType51.factory()
obj_.build(child_)
self.height = obj_
obj_.original_tagname_ = 'height'
elif nodeName_ == 'depth':
obj_ = depthType.factory()
obj_.build(child_)
self.depth = obj_
obj_.original_tagname_ = 'depth'
# end class dimensionsType49
[docs]class radiusType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if radiusType.subclass:
return radiusType.subclass(*args_, **kwargs_)
else:
return radiusType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='radiusType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='radiusType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='radiusType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='radiusType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='radiusType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class radiusType
[docs]class widthType50(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if widthType50.subclass:
return widthType50.subclass(*args_, **kwargs_)
else:
return widthType50(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='widthType50', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='widthType50')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='widthType50', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='widthType50'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='widthType50', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class widthType50
[docs]class heightType51(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if heightType51.subclass:
return heightType51.subclass(*args_, **kwargs_)
else:
return heightType51(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='heightType51', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='heightType51')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='heightType51', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='heightType51'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='heightType51', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class heightType51
[docs]class depthType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if depthType.subclass:
return depthType.subclass(*args_, **kwargs_)
else:
return depthType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='depthType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='depthType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='depthType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='depthType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='depthType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class depthType
[docs]class spatial_filteringType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('low_frequency_cutoff', 'low_frequency_cutoffType', 0),
MemberSpec_('high_frequency_cutoff', 'high_frequency_cutoffType', 0),
MemberSpec_('filter_function', 'xs:token', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, low_frequency_cutoff=None, high_frequency_cutoff=None, filter_function=None, software_list=None, details=None):
self.original_tagname_ = None
self.low_frequency_cutoff = low_frequency_cutoff
self.high_frequency_cutoff = high_frequency_cutoff
self.filter_function = filter_function
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if spatial_filteringType.subclass:
return spatial_filteringType.subclass(*args_, **kwargs_)
else:
return spatial_filteringType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low_frequency_cutoff(self): return self.low_frequency_cutoff
[docs] def set_low_frequency_cutoff(self, low_frequency_cutoff): self.low_frequency_cutoff = low_frequency_cutoff
[docs] def get_high_frequency_cutoff(self): return self.high_frequency_cutoff
[docs] def set_high_frequency_cutoff(self, high_frequency_cutoff): self.high_frequency_cutoff = high_frequency_cutoff
[docs] def get_filter_function(self): return self.filter_function
[docs] def set_filter_function(self, filter_function): self.filter_function = filter_function
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.low_frequency_cutoff is not None or
self.high_frequency_cutoff is not None or
self.filter_function is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='spatial_filteringType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='spatial_filteringType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='spatial_filteringType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='spatial_filteringType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='spatial_filteringType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.low_frequency_cutoff is not None:
self.low_frequency_cutoff.export(outfile, level, namespace_, name_='low_frequency_cutoff', pretty_print=pretty_print)
if self.high_frequency_cutoff is not None:
self.high_frequency_cutoff.export(outfile, level, namespace_, name_='high_frequency_cutoff', pretty_print=pretty_print)
if self.filter_function is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfilter_function>%s</%sfilter_function>%s' % (namespace_, self.gds_format_string(quote_xml(self.filter_function).encode(ExternalEncoding), input_name='filter_function'), namespace_, eol_))
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'low_frequency_cutoff':
obj_ = low_frequency_cutoffType.factory()
obj_.build(child_)
self.low_frequency_cutoff = obj_
obj_.original_tagname_ = 'low_frequency_cutoff'
elif nodeName_ == 'high_frequency_cutoff':
obj_ = high_frequency_cutoffType.factory()
obj_.build(child_)
self.high_frequency_cutoff = obj_
obj_.original_tagname_ = 'high_frequency_cutoff'
elif nodeName_ == 'filter_function':
filter_function_ = child_.text
filter_function_ = re_.sub(String_cleanup_pat_, " ", filter_function_).strip()
filter_function_ = self.gds_validate_string(filter_function_, node, 'filter_function')
self.filter_function = filter_function_
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class spatial_filteringType
[docs]class low_frequency_cutoffType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if low_frequency_cutoffType.subclass:
return low_frequency_cutoffType.subclass(*args_, **kwargs_)
else:
return low_frequency_cutoffType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='low_frequency_cutoffType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='low_frequency_cutoffType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='low_frequency_cutoffType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='low_frequency_cutoffType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='low_frequency_cutoffType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class low_frequency_cutoffType
[docs]class high_frequency_cutoffType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:string', 0),
MemberSpec_('valueOf_', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if high_frequency_cutoffType.subclass:
return high_frequency_cutoffType.subclass(*args_, **kwargs_)
else:
return high_frequency_cutoffType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_frequency_cutoffType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_frequency_cutoffType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_frequency_cutoffType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_frequency_cutoffType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_frequency_cutoffType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class high_frequency_cutoffType
[docs]class sharpeningType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if sharpeningType.subclass:
return sharpeningType.subclass(*args_, **kwargs_)
else:
return sharpeningType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sharpeningType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sharpeningType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sharpeningType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sharpeningType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sharpeningType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class sharpeningType
[docs]class b_factorSharpeningType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('_brestore', '_brestoreType', 0),
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, _brestore=None, software_list=None, details=None):
self.original_tagname_ = None
self._brestore = _brestore
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if b_factorSharpeningType.subclass:
return b_factorSharpeningType.subclass(*args_, **kwargs_)
else:
return b_factorSharpeningType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get__brestore(self): return self._brestore
[docs] def set__brestore(self, _brestore): self._brestore = _brestore
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self._brestore is not None or
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='b-factorSharpeningType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='b-factorSharpeningType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='b-factorSharpeningType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='b-factorSharpeningType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='b-factorSharpeningType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self._brestore is not None:
self._brestore.export(outfile, level, namespace_, name_='_brestore', pretty_print=pretty_print)
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == '_brestore':
obj_ = _brestoreType.factory()
obj_.build(child_)
self._brestore = obj_
obj_.original_tagname_ = '_brestore'
elif nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class b_factorSharpeningType
class _brestoreType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_brestore_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if _brestoreType.subclass:
return _brestoreType.subclass(*args_, **kwargs_)
else:
return _brestoreType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_units(self): return self.units
def set_units(self, units): self.units = units
def get_valueOf_(self): return self.valueOf_
def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='_brestoreType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='_brestoreType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='_brestoreType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='_brestoreType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
def exportChildren(self, outfile, level, namespace_='', name_='_brestoreType', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class _brestoreType
[docs]class otherType52(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('software_list', 'software_list_type', 0),
MemberSpec_('details', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, software_list=None, details=None):
self.original_tagname_ = None
self.software_list = software_list
self.details = details
[docs] def factory(*args_, **kwargs_):
if otherType52.subclass:
return otherType52.subclass(*args_, **kwargs_)
else:
return otherType52(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_software_list(self): return self.software_list
[docs] def set_software_list(self, software_list): self.software_list = software_list
[docs] def get_details(self): return self.details
[docs] def set_details(self, details): self.details = details
[docs] def hasContent_(self):
if (
self.software_list is not None or
self.details is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='otherType52', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='otherType52')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='otherType52', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='otherType52'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='otherType52', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.software_list is not None:
self.software_list.export(outfile, level, namespace_, name_='software_list', pretty_print=pretty_print)
if self.details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdetails>%s</%sdetails>%s' % (namespace_, self.gds_format_string(quote_xml(self.details).encode(ExternalEncoding), input_name='details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'software_list':
obj_ = software_list_type.factory()
obj_.build(child_)
self.software_list = obj_
obj_.original_tagname_ = 'software_list'
elif nodeName_ == 'details':
details_ = child_.text
details_ = self.gds_validate_string(details_, node, 'details')
self.details = details_
# end class otherType52
[docs]class chainType53(chain_model_type):
member_data_items_ = [
MemberSpec_('number_of_copies_in_final_model', 'xs:positiveInteger', 0),
]
subclass = None
superclass = chain_model_type
def __init__(self, id=None, residue_range=None, number_of_copies_in_final_model=None):
self.original_tagname_ = None
super(chainType53, self).__init__(id, residue_range, )
self.number_of_copies_in_final_model = number_of_copies_in_final_model
[docs] def factory(*args_, **kwargs_):
if chainType53.subclass:
return chainType53.subclass(*args_, **kwargs_)
else:
return chainType53(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_number_of_copies_in_final_model(self): return self.number_of_copies_in_final_model
[docs] def set_number_of_copies_in_final_model(self, number_of_copies_in_final_model): self.number_of_copies_in_final_model = number_of_copies_in_final_model
[docs] def hasContent_(self):
if (
self.number_of_copies_in_final_model is not None or
super(chainType53, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='chainType53', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='chainType53')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='chainType53', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chainType53'):
super(chainType53, self).exportAttributes(outfile, level, already_processed, namespace_, name_='chainType53')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='chainType53', fromsubclass_=False, pretty_print=True):
super(chainType53, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.number_of_copies_in_final_model is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_of_copies_in_final_model>%s</%snumber_of_copies_in_final_model>%s' % (namespace_, self.gds_format_integer(self.number_of_copies_in_final_model, input_name='number_of_copies_in_final_model'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(chainType53, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'number_of_copies_in_final_model':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_of_copies_in_final_model')
self.number_of_copies_in_final_model = ival_
super(chainType53, self).buildChildren(child_, node, nodeName_, True)
# end class chainType53
[docs]class delta_zType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_rise_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if delta_zType.subclass:
return delta_zType.subclass(*args_, **kwargs_)
else:
return delta_zType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='delta_zType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='delta_zType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='delta_zType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='delta_zType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='delta_zType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class delta_zType
[docs]class delta_phiType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_twist_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if delta_phiType.subclass:
return delta_phiType.subclass(*args_, **kwargs_)
else:
return delta_phiType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='delta_phiType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='delta_phiType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='delta_phiType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='delta_phiType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='delta_phiType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class delta_phiType
[docs]class experimentalType(GeneratedsSuper):
"""kDa/nm is for helices."""
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_assembly_weights', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if experimentalType.subclass:
return experimentalType.subclass(*args_, **kwargs_)
else:
return experimentalType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='experimentalType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='experimentalType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='experimentalType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='experimentalType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='experimentalType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class experimentalType
[docs]class theoreticalType(GeneratedsSuper):
"""kDa/nm is for helices."""
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_assembly_weights', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if theoreticalType.subclass:
return theoreticalType.subclass(*args_, **kwargs_)
else:
return theoreticalType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='theoreticalType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='theoreticalType')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='theoreticalType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='theoreticalType'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='theoreticalType', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class theoreticalType
[docs]class sequenceType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('string', ['stringType', 'xs:token'], 0),
MemberSpec_('discrepancy_list', 'discrepancy_listType', 0),
MemberSpec_('connectivity', 'connectivityType', 0),
MemberSpec_('external_references', 'external_referencesType54', 1),
]
subclass = None
superclass = None
def __init__(self, string=None, discrepancy_list=None, connectivity=None, external_references=None):
self.original_tagname_ = None
self.string = string
self.validate_stringType(self.string)
self.discrepancy_list = discrepancy_list
self.connectivity = connectivity
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if sequenceType.subclass:
return sequenceType.subclass(*args_, **kwargs_)
else:
return sequenceType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_string(self): return self.string
[docs] def set_string(self, string): self.string = string
[docs] def get_discrepancy_list(self): return self.discrepancy_list
[docs] def set_discrepancy_list(self, discrepancy_list): self.discrepancy_list = discrepancy_list
[docs] def get_connectivity(self): return self.connectivity
[docs] def set_connectivity(self, connectivity): self.connectivity = connectivity
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def validate_stringType(self, value):
# Validate type stringType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_stringType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_stringType_patterns_, ))
validate_stringType_patterns_ = [['^[ ARNDCEQGHILKMFPSTWYVUOBZJX]+$']]
[docs] def hasContent_(self):
if (
self.string is not None or
self.discrepancy_list is not None or
self.connectivity is not None or
self.external_references
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sequenceType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sequenceType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sequenceType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sequenceType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sequenceType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.string is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstring>%s</%sstring>%s' % (namespace_, self.gds_format_string(quote_xml(self.string).encode(ExternalEncoding), input_name='string'), namespace_, eol_))
if self.discrepancy_list is not None:
self.discrepancy_list.export(outfile, level, namespace_, name_='discrepancy_list', pretty_print=pretty_print)
if self.connectivity is not None:
self.connectivity.export(outfile, level, namespace_, name_='connectivity', pretty_print=pretty_print)
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'string':
string_ = child_.text
string_ = re_.sub(String_cleanup_pat_, " ", string_).strip()
string_ = self.gds_validate_string(string_, node, 'string')
self.string = string_
# validate type stringType
self.validate_stringType(self.string)
elif nodeName_ == 'discrepancy_list':
obj_ = discrepancy_listType.factory()
obj_.build(child_)
self.discrepancy_list = obj_
obj_.original_tagname_ = 'discrepancy_list'
elif nodeName_ == 'connectivity':
obj_ = connectivityType.factory()
obj_.build(child_)
self.connectivity = obj_
obj_.original_tagname_ = 'connectivity'
elif nodeName_ == 'external_references':
obj_ = external_referencesType54.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
# end class sequenceType
[docs]class discrepancy_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('discrepancy', ['discrepancyType', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, discrepancy=None):
self.original_tagname_ = None
if discrepancy is None:
self.discrepancy = []
else:
self.discrepancy = discrepancy
[docs] def factory(*args_, **kwargs_):
if discrepancy_listType.subclass:
return discrepancy_listType.subclass(*args_, **kwargs_)
else:
return discrepancy_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_discrepancy(self): return self.discrepancy
[docs] def set_discrepancy(self, discrepancy): self.discrepancy = discrepancy
[docs] def add_discrepancy(self, value): self.discrepancy.append(value)
[docs] def insert_discrepancy_at(self, index, value): self.discrepancy.insert(index, value)
[docs] def replace_discrepancy_at(self, index, value): self.discrepancy[index] = value
[docs] def validate_discrepancyType(self, value):
# Validate type discrepancyType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_discrepancyType_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_discrepancyType_patterns_, ))
validate_discrepancyType_patterns_ = [['^[ARNDCEQGHILKMFPSTWYVUOBZJX]\\d+[ARNDCEQGHILKMFPSTWYVUOBZJX]$']]
[docs] def hasContent_(self):
if (
self.discrepancy
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='discrepancy_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='discrepancy_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='discrepancy_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='discrepancy_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='discrepancy_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for discrepancy_ in self.discrepancy:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdiscrepancy>%s</%sdiscrepancy>%s' % (namespace_, self.gds_format_string(quote_xml(discrepancy_).encode(ExternalEncoding), input_name='discrepancy'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'discrepancy':
discrepancy_ = child_.text
discrepancy_ = re_.sub(String_cleanup_pat_, " ", discrepancy_).strip()
discrepancy_ = self.gds_validate_string(discrepancy_, node, 'discrepancy')
self.discrepancy.append(discrepancy_)
# validate type discrepancyType
self.validate_discrepancyType(self.discrepancy[-1])
# end class discrepancy_listType
[docs]class connectivityType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('_n_link', '_n-linkType', 0),
MemberSpec_('_c_link', '_c-linkType', 0),
]
subclass = None
superclass = None
def __init__(self, _n_link=None, _c_link=None):
self.original_tagname_ = None
self._n_link = _n_link
self._c_link = _c_link
[docs] def factory(*args_, **kwargs_):
if connectivityType.subclass:
return connectivityType.subclass(*args_, **kwargs_)
else:
return connectivityType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get__n_link(self): return self._n_link
[docs] def set__n_link(self, _n_link): self._n_link = _n_link
[docs] def get__c_link(self): return self._c_link
[docs] def set__c_link(self, _c_link): self._c_link = _c_link
[docs] def hasContent_(self):
if (
self._n_link is not None or
self._c_link is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='connectivityType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='connectivityType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='connectivityType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='connectivityType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='connectivityType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self._n_link is not None:
self._n_link.export(outfile, level, namespace_, name_='_n-link', pretty_print=pretty_print)
if self._c_link is not None:
self._c_link.export(outfile, level, namespace_, name_='_c-link', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == '_n-link':
obj_ = _n_linkType.factory()
obj_.build(child_)
self._n_link = obj_
obj_.original_tagname_ = '_n-link'
elif nodeName_ == '_c-link':
obj_ = _c_linkType.factory()
obj_.build(child_)
self._c_link = obj_
obj_.original_tagname_ = '_c-link'
# end class connectivityType
class _n_linkType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('molecule_id', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, molecule_id=None):
self.original_tagname_ = None
self.molecule_id = molecule_id
def factory(*args_, **kwargs_):
if _n_linkType.subclass:
return _n_linkType.subclass(*args_, **kwargs_)
else:
return _n_linkType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_molecule_id(self): return self.molecule_id
def set_molecule_id(self, molecule_id): self.molecule_id = molecule_id
def hasContent_(self):
if (
self.molecule_id is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='_n-linkType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='_n-linkType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='_n-linkType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='_n-linkType'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='_n-linkType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.molecule_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smolecule_id>%s</%smolecule_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.molecule_id).encode(ExternalEncoding), input_name='molecule_id'), namespace_, eol_))
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'molecule_id':
molecule_id_ = child_.text
molecule_id_ = self.gds_validate_string(molecule_id_, node, 'molecule_id')
self.molecule_id = molecule_id_
# end class _n_linkType
[docs]class molecule_id(GeneratedsSuper):
member_data_items_ = [
]
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
[docs] def factory(*args_, **kwargs_):
if molecule_id.subclass:
return molecule_id.subclass(*args_, **kwargs_)
else:
return molecule_id(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='molecule_id', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='molecule_id')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='molecule_id', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='molecule_id'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='molecule_id', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class molecule_id
class _c_linkType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('molecule_id', 'xs:string', 0),
]
subclass = None
superclass = None
def __init__(self, molecule_id=None):
self.original_tagname_ = None
self.molecule_id = molecule_id
def factory(*args_, **kwargs_):
if _c_linkType.subclass:
return _c_linkType.subclass(*args_, **kwargs_)
else:
return _c_linkType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_molecule_id(self): return self.molecule_id
def set_molecule_id(self, molecule_id): self.molecule_id = molecule_id
def hasContent_(self):
if (
self.molecule_id is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='_c-linkType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='_c-linkType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='_c-linkType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='_c-linkType'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='_c-linkType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.molecule_id is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smolecule_id>%s</%smolecule_id>%s' % (namespace_, self.gds_format_string(quote_xml(self.molecule_id).encode(ExternalEncoding), input_name='molecule_id'), namespace_, eol_))
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'molecule_id':
molecule_id_ = child_.text
molecule_id_ = self.gds_validate_string(molecule_id_, node, 'molecule_id')
self.molecule_id = molecule_id_
# end class _c_linkType
[docs]class external_referencesType54(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType54.subclass:
return external_referencesType54.subclass(*args_, **kwargs_)
else:
return external_referencesType54(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType54', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType54')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType54', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType54'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType54', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType54
[docs]class sequenceType55(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('string', ['stringType56', 'xs:token'], 0),
MemberSpec_('discrepancy_list', 'discrepancy_listType57', 0),
MemberSpec_('external_references', 'external_referencesType59', 1),
]
subclass = None
superclass = None
def __init__(self, string=None, discrepancy_list=None, external_references=None):
self.original_tagname_ = None
self.string = string
self.validate_stringType56(self.string)
self.discrepancy_list = discrepancy_list
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if sequenceType55.subclass:
return sequenceType55.subclass(*args_, **kwargs_)
else:
return sequenceType55(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_string(self): return self.string
[docs] def set_string(self, string): self.string = string
[docs] def get_discrepancy_list(self): return self.discrepancy_list
[docs] def set_discrepancy_list(self, discrepancy_list): self.discrepancy_list = discrepancy_list
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def validate_stringType56(self, value):
# Validate type stringType56, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_stringType56_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_stringType56_patterns_, ))
validate_stringType56_patterns_ = [['^[ ACGTRYSWKMBDHVN\\.-]+$']]
[docs] def hasContent_(self):
if (
self.string is not None or
self.discrepancy_list is not None or
self.external_references
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sequenceType55', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sequenceType55')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sequenceType55', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sequenceType55'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sequenceType55', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.string is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstring>%s</%sstring>%s' % (namespace_, self.gds_format_string(quote_xml(self.string).encode(ExternalEncoding), input_name='string'), namespace_, eol_))
if self.discrepancy_list is not None:
self.discrepancy_list.export(outfile, level, namespace_, name_='discrepancy_list', pretty_print=pretty_print)
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'string':
string_ = child_.text
string_ = re_.sub(String_cleanup_pat_, " ", string_).strip()
string_ = self.gds_validate_string(string_, node, 'string')
self.string = string_
# validate type stringType56
self.validate_stringType56(self.string)
elif nodeName_ == 'discrepancy_list':
obj_ = discrepancy_listType57.factory()
obj_.build(child_)
self.discrepancy_list = obj_
obj_.original_tagname_ = 'discrepancy_list'
elif nodeName_ == 'external_references':
obj_ = external_referencesType59.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
# end class sequenceType55
[docs]class discrepancy_listType57(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('discrepancy', ['discrepancyType58', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, discrepancy=None):
self.original_tagname_ = None
if discrepancy is None:
self.discrepancy = []
else:
self.discrepancy = discrepancy
[docs] def factory(*args_, **kwargs_):
if discrepancy_listType57.subclass:
return discrepancy_listType57.subclass(*args_, **kwargs_)
else:
return discrepancy_listType57(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_discrepancy(self): return self.discrepancy
[docs] def set_discrepancy(self, discrepancy): self.discrepancy = discrepancy
[docs] def add_discrepancy(self, value): self.discrepancy.append(value)
[docs] def insert_discrepancy_at(self, index, value): self.discrepancy.insert(index, value)
[docs] def replace_discrepancy_at(self, index, value): self.discrepancy[index] = value
[docs] def validate_discrepancyType58(self, value):
# Validate type discrepancyType58, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_discrepancyType58_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_discrepancyType58_patterns_, ))
validate_discrepancyType58_patterns_ = [['^[AGCTRYSWKMBDHVN\\.-]\\d+[AGCTRYSWKMBDHVN\\.-]$']]
[docs] def hasContent_(self):
if (
self.discrepancy
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='discrepancy_listType57', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='discrepancy_listType57')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='discrepancy_listType57', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='discrepancy_listType57'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='discrepancy_listType57', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for discrepancy_ in self.discrepancy:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdiscrepancy>%s</%sdiscrepancy>%s' % (namespace_, self.gds_format_string(quote_xml(discrepancy_).encode(ExternalEncoding), input_name='discrepancy'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'discrepancy':
discrepancy_ = child_.text
discrepancy_ = re_.sub(String_cleanup_pat_, " ", discrepancy_).strip()
discrepancy_ = self.gds_validate_string(discrepancy_, node, 'discrepancy')
self.discrepancy.append(discrepancy_)
# validate type discrepancyType58
self.validate_discrepancyType58(self.discrepancy[-1])
# end class discrepancy_listType57
[docs]class external_referencesType59(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType59.subclass:
return external_referencesType59.subclass(*args_, **kwargs_)
else:
return external_referencesType59(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType59', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType59')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType59', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType59'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType59', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType59
[docs]class sequenceType60(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('string', ['stringType61', 'xs:token'], 0),
MemberSpec_('discrepancy_list', 'discrepancy_listType62', 0),
MemberSpec_('external_references', 'external_referencesType64', 1),
]
subclass = None
superclass = None
def __init__(self, string=None, discrepancy_list=None, external_references=None):
self.original_tagname_ = None
self.string = string
self.validate_stringType61(self.string)
self.discrepancy_list = discrepancy_list
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if sequenceType60.subclass:
return sequenceType60.subclass(*args_, **kwargs_)
else:
return sequenceType60(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_string(self): return self.string
[docs] def set_string(self, string): self.string = string
[docs] def get_discrepancy_list(self): return self.discrepancy_list
[docs] def set_discrepancy_list(self, discrepancy_list): self.discrepancy_list = discrepancy_list
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def validate_stringType61(self, value):
# Validate type stringType61, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_stringType61_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_stringType61_patterns_, ))
validate_stringType61_patterns_ = [['^[ ACGURYSWKMBDHVN\\.-]+$']]
[docs] def hasContent_(self):
if (
self.string is not None or
self.discrepancy_list is not None or
self.external_references
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sequenceType60', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sequenceType60')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sequenceType60', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sequenceType60'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sequenceType60', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.string is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstring>%s</%sstring>%s' % (namespace_, self.gds_format_string(quote_xml(self.string).encode(ExternalEncoding), input_name='string'), namespace_, eol_))
if self.discrepancy_list is not None:
self.discrepancy_list.export(outfile, level, namespace_, name_='discrepancy_list', pretty_print=pretty_print)
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'string':
string_ = child_.text
string_ = re_.sub(String_cleanup_pat_, " ", string_).strip()
string_ = self.gds_validate_string(string_, node, 'string')
self.string = string_
# validate type stringType61
self.validate_stringType61(self.string)
elif nodeName_ == 'discrepancy_list':
obj_ = discrepancy_listType62.factory()
obj_.build(child_)
self.discrepancy_list = obj_
obj_.original_tagname_ = 'discrepancy_list'
elif nodeName_ == 'external_references':
obj_ = external_referencesType64.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
# end class sequenceType60
[docs]class discrepancy_listType62(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('discrepancy', ['discrepancyType63', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, discrepancy=None):
self.original_tagname_ = None
if discrepancy is None:
self.discrepancy = []
else:
self.discrepancy = discrepancy
[docs] def factory(*args_, **kwargs_):
if discrepancy_listType62.subclass:
return discrepancy_listType62.subclass(*args_, **kwargs_)
else:
return discrepancy_listType62(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_discrepancy(self): return self.discrepancy
[docs] def set_discrepancy(self, discrepancy): self.discrepancy = discrepancy
[docs] def add_discrepancy(self, value): self.discrepancy.append(value)
[docs] def insert_discrepancy_at(self, index, value): self.discrepancy.insert(index, value)
[docs] def replace_discrepancy_at(self, index, value): self.discrepancy[index] = value
[docs] def validate_discrepancyType63(self, value):
# Validate type discrepancyType63, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_discrepancyType63_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_discrepancyType63_patterns_, ))
validate_discrepancyType63_patterns_ = [['^[AGCURYSWKMBDHVN\\.-]\\d+[AGCURYSWKMBDHVN\\.-]$']]
[docs] def hasContent_(self):
if (
self.discrepancy
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='discrepancy_listType62', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='discrepancy_listType62')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='discrepancy_listType62', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='discrepancy_listType62'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='discrepancy_listType62', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for discrepancy_ in self.discrepancy:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdiscrepancy>%s</%sdiscrepancy>%s' % (namespace_, self.gds_format_string(quote_xml(discrepancy_).encode(ExternalEncoding), input_name='discrepancy'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'discrepancy':
discrepancy_ = child_.text
discrepancy_ = re_.sub(String_cleanup_pat_, " ", discrepancy_).strip()
discrepancy_ = self.gds_validate_string(discrepancy_, node, 'discrepancy')
self.discrepancy.append(discrepancy_)
# validate type discrepancyType63
self.validate_discrepancyType63(self.discrepancy[-1])
# end class discrepancy_listType62
[docs]class external_referencesType64(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType64.subclass:
return external_referencesType64.subclass(*args_, **kwargs_)
else:
return external_referencesType64(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType64', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType64')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType64', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType64'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType64', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType64
[docs]class external_referencesType68(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType68.subclass:
return external_referencesType68.subclass(*args_, **kwargs_)
else:
return external_referencesType68(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType68', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType68')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType68', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType68'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType68', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType68
[docs]class external_referencesType70(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType70.subclass:
return external_referencesType70.subclass(*args_, **kwargs_)
else:
return external_referencesType70(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType70', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType70')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType70', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType70'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType70', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType70
[docs]class external_referencesType72(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType72.subclass:
return external_referencesType72.subclass(*args_, **kwargs_)
else:
return external_referencesType72(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType72', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType72')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType72', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType72'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType72', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType72
[docs]class diameterType74(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['allowed_diameter_colloidal_gold', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if diameterType74.subclass:
return diameterType74.subclass(*args_, **kwargs_)
else:
return diameterType74(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='diameterType74', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='diameterType74')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='diameterType74', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='diameterType74'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='diameterType74', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class diameterType74
[docs]class resolutionType75(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, type_=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if resolutionType75.subclass:
return resolutionType75.subclass(*args_, **kwargs_)
else:
return resolutionType75(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='resolutionType75', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='resolutionType75')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='resolutionType75', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='resolutionType75'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='resolutionType75', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class resolutionType75
[docs]class sequenceType77(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('string', ['stringType78', 'xs:token'], 0),
MemberSpec_('discrepancy_list', 'discrepancy_listType79', 0),
MemberSpec_('external_references', 'external_referencesType81', 1),
]
subclass = None
superclass = None
def __init__(self, string=None, discrepancy_list=None, external_references=None):
self.original_tagname_ = None
self.string = string
self.validate_stringType78(self.string)
self.discrepancy_list = discrepancy_list
if external_references is None:
self.external_references = []
else:
self.external_references = external_references
[docs] def factory(*args_, **kwargs_):
if sequenceType77.subclass:
return sequenceType77.subclass(*args_, **kwargs_)
else:
return sequenceType77(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_string(self): return self.string
[docs] def set_string(self, string): self.string = string
[docs] def get_discrepancy_list(self): return self.discrepancy_list
[docs] def set_discrepancy_list(self, discrepancy_list): self.discrepancy_list = discrepancy_list
[docs] def get_external_references(self): return self.external_references
[docs] def set_external_references(self, external_references): self.external_references = external_references
[docs] def add_external_references(self, value): self.external_references.append(value)
[docs] def insert_external_references_at(self, index, value): self.external_references.insert(index, value)
[docs] def replace_external_references_at(self, index, value): self.external_references[index] = value
[docs] def validate_stringType78(self, value):
# Validate type stringType78, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
pass
[docs] def hasContent_(self):
if (
self.string is not None or
self.discrepancy_list is not None or
self.external_references
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sequenceType77', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sequenceType77')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sequenceType77', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sequenceType77'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sequenceType77', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.string is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sstring>%s</%sstring>%s' % (namespace_, self.gds_format_string(quote_xml(self.string).encode(ExternalEncoding), input_name='string'), namespace_, eol_))
if self.discrepancy_list is not None:
self.discrepancy_list.export(outfile, level, namespace_, name_='discrepancy_list', pretty_print=pretty_print)
for external_references_ in self.external_references:
external_references_.export(outfile, level, namespace_, name_='external_references', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'string':
string_ = child_.text
string_ = re_.sub(String_cleanup_pat_, " ", string_).strip()
string_ = self.gds_validate_string(string_, node, 'string')
self.string = string_
# validate type stringType78
self.validate_stringType78(self.string)
elif nodeName_ == 'discrepancy_list':
obj_ = discrepancy_listType79.factory()
obj_.build(child_)
self.discrepancy_list = obj_
obj_.original_tagname_ = 'discrepancy_list'
elif nodeName_ == 'external_references':
obj_ = external_referencesType81.factory()
obj_.build(child_)
self.external_references.append(obj_)
obj_.original_tagname_ = 'external_references'
# end class sequenceType77
[docs]class discrepancy_listType79(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('discrepancy', ['discrepancyType80', 'xs:token'], 1),
]
subclass = None
superclass = None
def __init__(self, discrepancy=None):
self.original_tagname_ = None
if discrepancy is None:
self.discrepancy = []
else:
self.discrepancy = discrepancy
[docs] def factory(*args_, **kwargs_):
if discrepancy_listType79.subclass:
return discrepancy_listType79.subclass(*args_, **kwargs_)
else:
return discrepancy_listType79(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_discrepancy(self): return self.discrepancy
[docs] def set_discrepancy(self, discrepancy): self.discrepancy = discrepancy
[docs] def add_discrepancy(self, value): self.discrepancy.append(value)
[docs] def insert_discrepancy_at(self, index, value): self.discrepancy.insert(index, value)
[docs] def replace_discrepancy_at(self, index, value): self.discrepancy[index] = value
[docs] def validate_discrepancyType80(self, value):
# Validate type discrepancyType80, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
if not self.gds_validate_simple_patterns(
self.validate_discrepancyType80_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_discrepancyType80_patterns_, ))
validate_discrepancyType80_patterns_ = [['^[AGCTRYSWKMBDHVN\\.-]\\d+[AGCTRYSWKMBDHVN\\.-]$']]
[docs] def hasContent_(self):
if (
self.discrepancy
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='discrepancy_listType79', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='discrepancy_listType79')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='discrepancy_listType79', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='discrepancy_listType79'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='discrepancy_listType79', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for discrepancy_ in self.discrepancy:
showIndent(outfile, level, pretty_print)
outfile.write('<%sdiscrepancy>%s</%sdiscrepancy>%s' % (namespace_, self.gds_format_string(quote_xml(discrepancy_).encode(ExternalEncoding), input_name='discrepancy'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'discrepancy':
discrepancy_ = child_.text
discrepancy_ = re_.sub(String_cleanup_pat_, " ", discrepancy_).strip()
discrepancy_ = self.gds_validate_string(discrepancy_, node, 'discrepancy')
self.discrepancy.append(discrepancy_)
# validate type discrepancyType80
self.validate_discrepancyType80(self.discrepancy[-1])
# end class discrepancy_listType79
[docs]class external_referencesType81(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('type', 'xs:token', 0),
MemberSpec_('valueOf_', 'xs:token', 0),
]
subclass = None
superclass = None
def __init__(self, type_=None, valueOf_=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if external_referencesType81.subclass:
return external_referencesType81.subclass(*args_, **kwargs_)
else:
return external_referencesType81(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_type(self): return self.type_
[docs] def set_type(self, type_): self.type_ = type_
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='external_referencesType81', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='external_referencesType81')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='external_referencesType81', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='external_referencesType81'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='external_referencesType81', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
self.type_ = ' '.join(self.type_.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class external_referencesType81
[docs]class high_resolutionType82(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if high_resolutionType82.subclass:
return high_resolutionType82.subclass(*args_, **kwargs_)
else:
return high_resolutionType82(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_resolutionType82', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_resolutionType82')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_resolutionType82', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_resolutionType82'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_resolutionType82', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class high_resolutionType82
[docs]class shell_listType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('shell', 'shellType', 1),
]
subclass = None
superclass = None
def __init__(self, shell=None):
self.original_tagname_ = None
if shell is None:
self.shell = []
else:
self.shell = shell
[docs] def factory(*args_, **kwargs_):
if shell_listType.subclass:
return shell_listType.subclass(*args_, **kwargs_)
else:
return shell_listType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_shell(self): return self.shell
[docs] def set_shell(self, shell): self.shell = shell
[docs] def add_shell(self, value): self.shell.append(value)
[docs] def insert_shell_at(self, index, value): self.shell.insert(index, value)
[docs] def replace_shell_at(self, index, value): self.shell[index] = value
[docs] def hasContent_(self):
if (
self.shell
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='shell_listType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='shell_listType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='shell_listType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='shell_listType'):
pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='shell_listType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for shell_ in self.shell:
shell_.export(outfile, level, namespace_, name_='shell', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'shell':
obj_ = shellType.factory()
obj_.build(child_)
self.shell.append(obj_)
obj_.original_tagname_ = 'shell'
# end class shell_listType
[docs]class shellType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('id', 'xs:positiveInteger', 0),
MemberSpec_('high_resolution', 'high_resolutionType83', 0),
MemberSpec_('low_resolution', 'low_resolutionType84', 0),
MemberSpec_('number_structure_factors', 'xs:positiveInteger', 0),
MemberSpec_('phase_residual', 'xs:float', 0),
MemberSpec_('fourier_space_coverage', 'xs:float', 0),
MemberSpec_('multiplicity', 'xs:float', 0),
]
subclass = None
superclass = None
def __init__(self, id=None, high_resolution=None, low_resolution=None, number_structure_factors=None, phase_residual=None, fourier_space_coverage=None, multiplicity=None):
self.original_tagname_ = None
self.id = _cast(int, id)
self.high_resolution = high_resolution
self.low_resolution = low_resolution
self.number_structure_factors = number_structure_factors
self.phase_residual = phase_residual
self.fourier_space_coverage = fourier_space_coverage
self.multiplicity = multiplicity
[docs] def factory(*args_, **kwargs_):
if shellType.subclass:
return shellType.subclass(*args_, **kwargs_)
else:
return shellType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_high_resolution(self): return self.high_resolution
[docs] def set_high_resolution(self, high_resolution): self.high_resolution = high_resolution
[docs] def get_low_resolution(self): return self.low_resolution
[docs] def set_low_resolution(self, low_resolution): self.low_resolution = low_resolution
[docs] def get_number_structure_factors(self): return self.number_structure_factors
[docs] def set_number_structure_factors(self, number_structure_factors): self.number_structure_factors = number_structure_factors
[docs] def get_phase_residual(self): return self.phase_residual
[docs] def set_phase_residual(self, phase_residual): self.phase_residual = phase_residual
[docs] def get_fourier_space_coverage(self): return self.fourier_space_coverage
[docs] def set_fourier_space_coverage(self, fourier_space_coverage): self.fourier_space_coverage = fourier_space_coverage
[docs] def get_multiplicity(self): return self.multiplicity
[docs] def set_multiplicity(self, multiplicity): self.multiplicity = multiplicity
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def hasContent_(self):
if (
self.high_resolution is not None or
self.low_resolution is not None or
self.number_structure_factors is not None or
self.phase_residual is not None or
self.fourier_space_coverage is not None or
self.multiplicity is not None
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='shellType', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='shellType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='shellType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='shellType'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='shellType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.high_resolution is not None:
self.high_resolution.export(outfile, level, namespace_, name_='high_resolution', pretty_print=pretty_print)
if self.low_resolution is not None:
self.low_resolution.export(outfile, level, namespace_, name_='low_resolution', pretty_print=pretty_print)
if self.number_structure_factors is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_structure_factors>%s</%snumber_structure_factors>%s' % (namespace_, self.gds_format_integer(self.number_structure_factors, input_name='number_structure_factors'), namespace_, eol_))
if self.phase_residual is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sphase_residual>%s</%sphase_residual>%s' % (namespace_, self.gds_format_float(self.phase_residual, input_name='phase_residual'), namespace_, eol_))
if self.fourier_space_coverage is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sfourier_space_coverage>%s</%sfourier_space_coverage>%s' % (namespace_, self.gds_format_float(self.fourier_space_coverage, input_name='fourier_space_coverage'), namespace_, eol_))
if self.multiplicity is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%smultiplicity>%s</%smultiplicity>%s' % (namespace_, self.gds_format_float(self.multiplicity, input_name='multiplicity'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
try:
self.id = int(value)
except ValueError as exp:
raise_parse_error(node, 'Bad integer attribute: %s' % exp)
if self.id <= 0:
raise_parse_error(node, 'Invalid PositiveInteger')
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'high_resolution':
obj_ = high_resolutionType83.factory()
obj_.build(child_)
self.high_resolution = obj_
obj_.original_tagname_ = 'high_resolution'
elif nodeName_ == 'low_resolution':
obj_ = low_resolutionType84.factory()
obj_.build(child_)
self.low_resolution = obj_
obj_.original_tagname_ = 'low_resolution'
elif nodeName_ == 'number_structure_factors':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_structure_factors')
self.number_structure_factors = ival_
elif nodeName_ == 'phase_residual':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'phase_residual')
self.phase_residual = fval_
elif nodeName_ == 'fourier_space_coverage':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'fourier_space_coverage')
self.fourier_space_coverage = fval_
elif nodeName_ == 'multiplicity':
sval_ = child_.text
try:
fval_ = float(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires float or double: %s' % exp)
fval_ = self.gds_validate_float(fval_, node, 'multiplicity')
self.multiplicity = fval_
# end class shellType
[docs]class high_resolutionType83(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if high_resolutionType83.subclass:
return high_resolutionType83.subclass(*args_, **kwargs_)
else:
return high_resolutionType83(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='high_resolutionType83', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='high_resolutionType83')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='high_resolutionType83', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='high_resolutionType83'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='high_resolutionType83', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class high_resolutionType83
[docs]class low_resolutionType84(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('units', 'xs:token', 0),
MemberSpec_('valueOf_', ['resolution_type', 'xs:float'], 0),
]
subclass = None
superclass = None
def __init__(self, units=None, valueOf_=None):
self.original_tagname_ = None
self.units = _cast(None, units)
self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_):
if low_resolutionType84.subclass:
return low_resolutionType84.subclass(*args_, **kwargs_)
else:
return low_resolutionType84(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_units(self): return self.units
[docs] def set_units(self, units): self.units = units
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self):
if (
self.valueOf_
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='low_resolutionType84', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='low_resolutionType84')
if self.hasContent_():
outfile.write('>')
if type(self.valueOf_) is float:
x_ = self.gds_format_float(self.valueOf_)
elif type(self.valueOf_) is str:
x_ = quote_xml(self.valueOf_)
else:
x_ = str(self.valueOf_)
outfile.write(x_.encode(ExternalEncoding))
self.exportChildren(outfile, level + 1, namespace_='', name_='low_resolutionType84', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='low_resolutionType84'):
if self.units is not None and 'units' not in already_processed:
already_processed.add('units')
outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='low_resolutionType84', fromsubclass_=False, pretty_print=True):
pass
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('units', node)
if value is not None and 'units' not in already_processed:
already_processed.add('units')
self.units = value
self.units = ' '.join(self.units.split())
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class low_resolutionType84
[docs]class complex(base_supramolecule_type):
member_data_items_ = [
MemberSpec_('chimera', 'xs:boolean', 0),
MemberSpec_('natural_source', 'natural_source_type', 1),
MemberSpec_('recombinant_expression', 'recombinant_source_type', 1),
MemberSpec_('molecular_weight', 'molecular_weight_type', 0),
MemberSpec_('ribosome_details', 'xs:string', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, chimera=None, natural_source=None, recombinant_expression=None, molecular_weight=None, ribosome_details=None):
self.original_tagname_ = None
super(complex, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.chimera = _cast(bool, chimera)
if natural_source is None:
self.natural_source = []
else:
self.natural_source = natural_source
if recombinant_expression is None:
self.recombinant_expression = []
else:
self.recombinant_expression = recombinant_expression
self.molecular_weight = molecular_weight
self.ribosome_details = ribosome_details
[docs] def factory(*args_, **kwargs_):
if complex.subclass:
return complex.subclass(*args_, **kwargs_)
else:
return complex(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def add_natural_source(self, value): self.natural_source.append(value)
[docs] def insert_natural_source_at(self, index, value): self.natural_source.insert(index, value)
[docs] def replace_natural_source_at(self, index, value): self.natural_source[index] = value
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
[docs] def add_recombinant_expression(self, value): self.recombinant_expression.append(value)
[docs] def insert_recombinant_expression_at(self, index, value): self.recombinant_expression.insert(index, value)
[docs] def replace_recombinant_expression_at(self, index, value): self.recombinant_expression[index] = value
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def get_ribosome_details(self): return self.ribosome_details
[docs] def set_ribosome_details(self, ribosome_details): self.ribosome_details = ribosome_details
[docs] def get_chimera(self): return self.chimera
[docs] def set_chimera(self, chimera): self.chimera = chimera
[docs] def hasContent_(self):
if (
self.natural_source or
self.recombinant_expression or
self.molecular_weight is not None or
self.ribosome_details is not None or
super(complex, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='complex', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='complex')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='complex', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='complex'):
super(complex, self).exportAttributes(outfile, level, already_processed, namespace_, name_='complex')
if self.chimera is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
outfile.write(' chimera="%s"' % self.gds_format_boolean(self.chimera, input_name='chimera'))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='complex', fromsubclass_=False, pretty_print=True):
super(complex, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for natural_source_ in self.natural_source:
natural_source_.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
for recombinant_expression_ in self.recombinant_expression:
recombinant_expression_.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
if self.ribosome_details is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%sribosome-details>%s</%sribosome-details>%s' % (namespace_, self.gds_format_string(quote_xml(self.ribosome_details).encode(ExternalEncoding), input_name='ribosome-details'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('chimera', node)
if value is not None and 'chimera' not in already_processed:
already_processed.add('chimera')
if value in ('true', '1'):
self.chimera = True
elif value in ('false', '0'):
self.chimera = False
else:
raise_parse_error(node, 'Bad boolean attribute')
super(complex, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'natural_source':
obj_ = natural_source_type.factory()
obj_.build(child_)
self.natural_source.append(obj_)
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression.append(obj_)
obj_.original_tagname_ = 'recombinant_expression'
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weight_type.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
elif nodeName_ == 'ribosome-details':
ribosome_details_ = child_.text
ribosome_details_ = self.gds_validate_string(ribosome_details_, node, 'ribosome_details')
self.ribosome_details = ribosome_details_
super(complex, self).buildChildren(child_, node, nodeName_, True)
# end class complex
[docs]class virus(base_supramolecule_type):
member_data_items_ = [
MemberSpec_('sci_species_name', 'virus_species_name_type', 0),
MemberSpec_('sci_species_strain', 'xs:string', 0),
MemberSpec_('natural_host', 'natural_hostType', 1),
MemberSpec_('host_system', 'recombinant_source_type', 0),
MemberSpec_('molecular_weight', 'molecular_weight_type', 0),
MemberSpec_('virus_shell', 'virus_shellType', 1),
MemberSpec_('virus_type', ['virus_typeType', 'xs:token'], 0),
MemberSpec_('virus_isolate', ['virus_isolateType', 'xs:token'], 0),
MemberSpec_('virus_enveloped', 'xs:boolean', 0),
MemberSpec_('virus_empty', 'xs:boolean', 0),
MemberSpec_('syn_species_name', 'xs:string', 0),
MemberSpec_('sci_species_serotype', 'xs:string', 0),
MemberSpec_('sci_species_serocomplex', 'xs:string', 0),
MemberSpec_('sci_species_subspecies', 'xs:string', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, sci_species_name=None, sci_species_strain=None, natural_host=None, host_system=None, molecular_weight=None, virus_shell=None, virus_type=None, virus_isolate=None, virus_enveloped=None, virus_empty=None, syn_species_name=None, sci_species_serotype=None, sci_species_serocomplex=None, sci_species_subspecies=None):
self.original_tagname_ = None
super(virus, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.sci_species_name = sci_species_name
self.sci_species_strain = sci_species_strain
if natural_host is None:
self.natural_host = []
else:
self.natural_host = natural_host
self.host_system = host_system
self.molecular_weight = molecular_weight
if virus_shell is None:
self.virus_shell = []
else:
self.virus_shell = virus_shell
self.virus_type = virus_type
self.validate_virus_typeType(self.virus_type)
self.virus_isolate = virus_isolate
self.validate_virus_isolateType(self.virus_isolate)
self.virus_enveloped = virus_enveloped
self.virus_empty = virus_empty
self.syn_species_name = syn_species_name
self.sci_species_serotype = sci_species_serotype
self.sci_species_serocomplex = sci_species_serocomplex
self.sci_species_subspecies = sci_species_subspecies
[docs] def factory(*args_, **kwargs_):
if virus.subclass:
return virus.subclass(*args_, **kwargs_)
else:
return virus(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_sci_species_name(self): return self.sci_species_name
[docs] def set_sci_species_name(self, sci_species_name): self.sci_species_name = sci_species_name
[docs] def get_sci_species_strain(self): return self.sci_species_strain
[docs] def set_sci_species_strain(self, sci_species_strain): self.sci_species_strain = sci_species_strain
[docs] def get_natural_host(self): return self.natural_host
[docs] def set_natural_host(self, natural_host): self.natural_host = natural_host
[docs] def add_natural_host(self, value): self.natural_host.append(value)
[docs] def insert_natural_host_at(self, index, value): self.natural_host.insert(index, value)
[docs] def replace_natural_host_at(self, index, value): self.natural_host[index] = value
[docs] def get_host_system(self): return self.host_system
[docs] def set_host_system(self, host_system): self.host_system = host_system
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def get_virus_shell(self): return self.virus_shell
[docs] def set_virus_shell(self, virus_shell): self.virus_shell = virus_shell
[docs] def add_virus_shell(self, value): self.virus_shell.append(value)
[docs] def insert_virus_shell_at(self, index, value): self.virus_shell.insert(index, value)
[docs] def replace_virus_shell_at(self, index, value): self.virus_shell[index] = value
[docs] def get_virus_type(self): return self.virus_type
[docs] def set_virus_type(self, virus_type): self.virus_type = virus_type
[docs] def get_virus_isolate(self): return self.virus_isolate
[docs] def set_virus_isolate(self, virus_isolate): self.virus_isolate = virus_isolate
[docs] def get_virus_enveloped(self): return self.virus_enveloped
[docs] def set_virus_enveloped(self, virus_enveloped): self.virus_enveloped = virus_enveloped
[docs] def get_virus_empty(self): return self.virus_empty
[docs] def set_virus_empty(self, virus_empty): self.virus_empty = virus_empty
[docs] def get_syn_species_name(self): return self.syn_species_name
[docs] def set_syn_species_name(self, syn_species_name): self.syn_species_name = syn_species_name
[docs] def get_sci_species_serotype(self): return self.sci_species_serotype
[docs] def set_sci_species_serotype(self, sci_species_serotype): self.sci_species_serotype = sci_species_serotype
[docs] def get_sci_species_serocomplex(self): return self.sci_species_serocomplex
[docs] def set_sci_species_serocomplex(self, sci_species_serocomplex): self.sci_species_serocomplex = sci_species_serocomplex
[docs] def get_sci_species_subspecies(self): return self.sci_species_subspecies
[docs] def set_sci_species_subspecies(self, sci_species_subspecies): self.sci_species_subspecies = sci_species_subspecies
[docs] def validate_virus_typeType(self, value):
# Validate type virus_typeType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['VIRION', 'SATELLITE', 'PRION', 'VIROID', 'VIRUS-LIKE PARTICLE', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on virus_typeType' % {"value" : value.encode("utf-8")} )
[docs] def validate_virus_isolateType(self, value):
# Validate type virus_isolateType, a restriction on xs:token.
if value is not None and Validate_simpletypes_:
value = str(value)
enumerations = ['STRAIN', 'SEROTYPE', 'SEROCOMPLEX', 'SUBSPECIES', 'SPECIES', 'OTHER']
enumeration_respectee = False
for enum in enumerations:
if value == enum:
enumeration_respectee = True
break
if not enumeration_respectee:
warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on virus_isolateType' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self):
if (
self.sci_species_name is not None or
self.sci_species_strain is not None or
self.natural_host or
self.host_system is not None or
self.molecular_weight is not None or
self.virus_shell or
self.virus_type is not None or
self.virus_isolate is not None or
self.virus_enveloped is not None or
self.virus_empty is not None or
self.syn_species_name is not None or
self.sci_species_serotype is not None or
self.sci_species_serocomplex is not None or
self.sci_species_subspecies is not None or
super(virus, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='virus', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='virus')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='virus', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='virus'):
super(virus, self).exportAttributes(outfile, level, already_processed, namespace_, name_='virus')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='virus', fromsubclass_=False, pretty_print=True):
super(virus, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.sci_species_name is not None:
self.sci_species_name.export(outfile, level, namespace_, name_='sci_species_name', pretty_print=pretty_print)
if self.sci_species_strain is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssci_species_strain>%s</%ssci_species_strain>%s' % (namespace_, self.gds_format_string(quote_xml(self.sci_species_strain).encode(ExternalEncoding), input_name='sci_species_strain'), namespace_, eol_))
for natural_host_ in self.natural_host:
natural_host_.export(outfile, level, namespace_, name_='natural_host', pretty_print=pretty_print)
if self.host_system is not None:
self.host_system.export(outfile, level, namespace_, name_='host_system', pretty_print=pretty_print)
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
for virus_shell_ in self.virus_shell:
virus_shell_.export(outfile, level, namespace_, name_='virus_shell', pretty_print=pretty_print)
if self.virus_type is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svirus_type>%s</%svirus_type>%s' % (namespace_, self.gds_format_string(quote_xml(self.virus_type).encode(ExternalEncoding), input_name='virus_type'), namespace_, eol_))
if self.virus_isolate is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svirus_isolate>%s</%svirus_isolate>%s' % (namespace_, self.gds_format_string(quote_xml(self.virus_isolate).encode(ExternalEncoding), input_name='virus_isolate'), namespace_, eol_))
if self.virus_enveloped is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svirus_enveloped>%s</%svirus_enveloped>%s' % (namespace_, self.gds_format_boolean(self.virus_enveloped, input_name='virus_enveloped'), namespace_, eol_))
if self.virus_empty is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%svirus_empty>%s</%svirus_empty>%s' % (namespace_, self.gds_format_boolean(self.virus_empty, input_name='virus_empty'), namespace_, eol_))
if self.syn_species_name is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssyn_species_name>%s</%ssyn_species_name>%s' % (namespace_, self.gds_format_string(quote_xml(self.syn_species_name).encode(ExternalEncoding), input_name='syn_species_name'), namespace_, eol_))
if self.sci_species_serotype is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssci_species_serotype>%s</%ssci_species_serotype>%s' % (namespace_, self.gds_format_string(quote_xml(self.sci_species_serotype).encode(ExternalEncoding), input_name='sci_species_serotype'), namespace_, eol_))
if self.sci_species_serocomplex is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssci_species_serocomplex>%s</%ssci_species_serocomplex>%s' % (namespace_, self.gds_format_string(quote_xml(self.sci_species_serocomplex).encode(ExternalEncoding), input_name='sci_species_serocomplex'), namespace_, eol_))
if self.sci_species_subspecies is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%ssci_species_subspecies>%s</%ssci_species_subspecies>%s' % (namespace_, self.gds_format_string(quote_xml(self.sci_species_subspecies).encode(ExternalEncoding), input_name='sci_species_subspecies'), namespace_, eol_))
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(virus, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'sci_species_name':
obj_ = virus_species_name_type.factory()
obj_.build(child_)
self.sci_species_name = obj_
obj_.original_tagname_ = 'sci_species_name'
elif nodeName_ == 'sci_species_strain':
sci_species_strain_ = child_.text
sci_species_strain_ = self.gds_validate_string(sci_species_strain_, node, 'sci_species_strain')
self.sci_species_strain = sci_species_strain_
elif nodeName_ == 'natural_host':
obj_ = natural_hostType.factory()
obj_.build(child_)
self.natural_host.append(obj_)
obj_.original_tagname_ = 'natural_host'
elif nodeName_ == 'host_system':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.host_system = obj_
obj_.original_tagname_ = 'host_system'
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weight_type.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
elif nodeName_ == 'virus_shell':
obj_ = virus_shellType.factory()
obj_.build(child_)
self.virus_shell.append(obj_)
obj_.original_tagname_ = 'virus_shell'
elif nodeName_ == 'virus_type':
virus_type_ = child_.text
virus_type_ = re_.sub(String_cleanup_pat_, " ", virus_type_).strip()
virus_type_ = self.gds_validate_string(virus_type_, node, 'virus_type')
self.virus_type = virus_type_
# validate type virus_typeType
self.validate_virus_typeType(self.virus_type)
elif nodeName_ == 'virus_isolate':
virus_isolate_ = child_.text
virus_isolate_ = re_.sub(String_cleanup_pat_, " ", virus_isolate_).strip()
virus_isolate_ = self.gds_validate_string(virus_isolate_, node, 'virus_isolate')
self.virus_isolate = virus_isolate_
# validate type virus_isolateType
self.validate_virus_isolateType(self.virus_isolate)
elif nodeName_ == 'virus_enveloped':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'virus_enveloped')
self.virus_enveloped = ival_
elif nodeName_ == 'virus_empty':
sval_ = child_.text
if sval_ in ('true', '1'):
ival_ = True
elif sval_ in ('false', '0'):
ival_ = False
else:
raise_parse_error(child_, 'requires boolean')
ival_ = self.gds_validate_boolean(ival_, node, 'virus_empty')
self.virus_empty = ival_
elif nodeName_ == 'syn_species_name':
syn_species_name_ = child_.text
syn_species_name_ = self.gds_validate_string(syn_species_name_, node, 'syn_species_name')
self.syn_species_name = syn_species_name_
elif nodeName_ == 'sci_species_serotype':
sci_species_serotype_ = child_.text
sci_species_serotype_ = self.gds_validate_string(sci_species_serotype_, node, 'sci_species_serotype')
self.sci_species_serotype = sci_species_serotype_
elif nodeName_ == 'sci_species_serocomplex':
sci_species_serocomplex_ = child_.text
sci_species_serocomplex_ = self.gds_validate_string(sci_species_serocomplex_, node, 'sci_species_serocomplex')
self.sci_species_serocomplex = sci_species_serocomplex_
elif nodeName_ == 'sci_species_subspecies':
sci_species_subspecies_ = child_.text
sci_species_subspecies_ = self.gds_validate_string(sci_species_subspecies_, node, 'sci_species_subspecies')
self.sci_species_subspecies = sci_species_subspecies_
super(virus, self).buildChildren(child_, node, nodeName_, True)
# end class virus
[docs]class organelle_or_cellular_component(base_supramolecule_type):
member_data_items_ = [
MemberSpec_('natural_source', 'natural_sourceType38', 0),
MemberSpec_('molecular_weight', 'molecular_weight_type', 0),
MemberSpec_('recombinant_expression', 'recombinant_source_type', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, natural_source=None, molecular_weight=None, recombinant_expression=None):
self.original_tagname_ = None
super(organelle_or_cellular_component, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.natural_source = natural_source
self.molecular_weight = molecular_weight
self.recombinant_expression = recombinant_expression
[docs] def factory(*args_, **kwargs_):
if organelle_or_cellular_component.subclass:
return organelle_or_cellular_component.subclass(*args_, **kwargs_)
else:
return organelle_or_cellular_component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def get_recombinant_expression(self): return self.recombinant_expression
[docs] def set_recombinant_expression(self, recombinant_expression): self.recombinant_expression = recombinant_expression
[docs] def hasContent_(self):
if (
self.natural_source is not None or
self.molecular_weight is not None or
self.recombinant_expression is not None or
super(organelle_or_cellular_component, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='organelle_or_cellular_component', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='organelle_or_cellular_component')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='organelle_or_cellular_component', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='organelle_or_cellular_component'):
super(organelle_or_cellular_component, self).exportAttributes(outfile, level, already_processed, namespace_, name_='organelle_or_cellular_component')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='organelle_or_cellular_component', fromsubclass_=False, pretty_print=True):
super(organelle_or_cellular_component, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
if self.recombinant_expression is not None:
self.recombinant_expression.export(outfile, level, namespace_, name_='recombinant_expression', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(organelle_or_cellular_component, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'natural_source':
obj_ = natural_sourceType38.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weight_type.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
elif nodeName_ == 'recombinant_expression':
obj_ = recombinant_source_type.factory()
obj_.build(child_)
self.recombinant_expression = obj_
obj_.original_tagname_ = 'recombinant_expression'
super(organelle_or_cellular_component, self).buildChildren(child_, node, nodeName_, True)
# end class organelle_or_cellular_component
[docs]class tissue(base_supramolecule_type):
member_data_items_ = [
MemberSpec_('natural_source', 'natural_sourceType37', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, natural_source=None):
self.original_tagname_ = None
super(tissue, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.natural_source = natural_source
[docs] def factory(*args_, **kwargs_):
if tissue.subclass:
return tissue.subclass(*args_, **kwargs_)
else:
return tissue(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def hasContent_(self):
if (
self.natural_source is not None or
super(tissue, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='tissue', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='tissue')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='tissue', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='tissue'):
super(tissue, self).exportAttributes(outfile, level, already_processed, namespace_, name_='tissue')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='tissue', fromsubclass_=False, pretty_print=True):
super(tissue, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(tissue, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'natural_source':
obj_ = natural_sourceType37.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
super(tissue, self).buildChildren(child_, node, nodeName_, True)
# end class tissue
[docs]class cell(base_supramolecule_type):
member_data_items_ = [
MemberSpec_('natural_source', 'natural_sourceType36', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, natural_source=None):
self.original_tagname_ = None
super(cell, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.natural_source = natural_source
[docs] def factory(*args_, **kwargs_):
if cell.subclass:
return cell.subclass(*args_, **kwargs_)
else:
return cell(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def hasContent_(self):
if (
self.natural_source is not None or
super(cell, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='cell', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='cell')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='cell', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='cell'):
super(cell, self).exportAttributes(outfile, level, already_processed, namespace_, name_='cell')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='cell', fromsubclass_=False, pretty_print=True):
super(cell, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(cell, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'natural_source':
obj_ = natural_sourceType36.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
super(cell, self).buildChildren(child_, node, nodeName_, True)
# end class cell
[docs]class sample(base_supramolecule_type):
"""Deprecated (2014-10-21)"""
member_data_items_ = [
MemberSpec_('natural_source', 'natural_sourceType', 0),
MemberSpec_('number_unique_components', 'xs:positiveInteger', 0),
MemberSpec_('molecular_weight', 'molecular_weight_type', 0),
]
subclass = None
superclass = base_supramolecule_type
def __init__(self, id=None, name=None, category=None, parent=None, macromolecule_list=None, details=None, number_of_copies=None, oligomeric_state=None, external_references=None, recombinant_exp_flag=None, natural_source=None, number_unique_components=None, molecular_weight=None):
self.original_tagname_ = None
super(sample, self).__init__(id, name, category, parent, macromolecule_list, details, number_of_copies, oligomeric_state, external_references, recombinant_exp_flag, )
self.natural_source = natural_source
self.number_unique_components = number_unique_components
self.molecular_weight = molecular_weight
[docs] def factory(*args_, **kwargs_):
if sample.subclass:
return sample.subclass(*args_, **kwargs_)
else:
return sample(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_natural_source(self): return self.natural_source
[docs] def set_natural_source(self, natural_source): self.natural_source = natural_source
[docs] def get_number_unique_components(self): return self.number_unique_components
[docs] def set_number_unique_components(self, number_unique_components): self.number_unique_components = number_unique_components
[docs] def get_molecular_weight(self): return self.molecular_weight
[docs] def set_molecular_weight(self, molecular_weight): self.molecular_weight = molecular_weight
[docs] def hasContent_(self):
if (
self.natural_source is not None or
self.number_unique_components is not None or
self.molecular_weight is not None or
super(sample, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='sample', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='sample')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='sample', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sample'):
super(sample, self).exportAttributes(outfile, level, already_processed, namespace_, name_='sample')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='sample', fromsubclass_=False, pretty_print=True):
super(sample, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.natural_source is not None:
self.natural_source.export(outfile, level, namespace_, name_='natural_source', pretty_print=pretty_print)
if self.number_unique_components is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snumber_unique_components>%s</%snumber_unique_components>%s' % (namespace_, self.gds_format_integer(self.number_unique_components, input_name='number_unique_components'), namespace_, eol_))
if self.molecular_weight is not None:
self.molecular_weight.export(outfile, level, namespace_, name_='molecular_weight', pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(sample, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'natural_source':
obj_ = natural_sourceType.factory()
obj_.build(child_)
self.natural_source = obj_
obj_.original_tagname_ = 'natural_source'
elif nodeName_ == 'number_unique_components':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
if ival_ <= 0:
raise_parse_error(child_, 'requires positiveInteger')
ival_ = self.gds_validate_integer(ival_, node, 'number_unique_components')
self.number_unique_components = ival_
elif nodeName_ == 'molecular_weight':
obj_ = molecular_weight_type.factory()
obj_.build(child_)
self.molecular_weight = obj_
obj_.original_tagname_ = 'molecular_weight'
super(sample, self).buildChildren(child_, node, nodeName_, True)
# end class sample
[docs]class string_type(base_type):
member_data_items_ = [
]
subclass = None
superclass = base_type
def __init__(self, help_text=None, warning_text=None, error_text=None, validation_rules=None, label=None, value=None):
self.original_tagname_ = None
super(string_type, self).__init__(help_text, warning_text, error_text, validation_rules, label, value, )
[docs] def factory(*args_, **kwargs_):
if string_type.subclass:
return string_type.subclass(*args_, **kwargs_)
else:
return string_type(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self):
if (
super(string_type, self).hasContent_()
):
return True
else:
return False
[docs] def export(self, outfile, level, namespace_='', name_='string_type', namespacedef_='', pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='string_type')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='string_type', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='string_type'):
super(string_type, self).exportAttributes(outfile, level, already_processed, namespace_, name_='string_type')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='string_type', fromsubclass_=False, pretty_print=True):
super(string_type, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
[docs] def buildAttributes(self, node, attrs, already_processed):
super(string_type, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
super(string_type, self).buildChildren(child_, node, nodeName_, True)
pass
# end class string_type
GDSClassesMapping = {
'structure_determination_list': structure_determination_listType,
'code': code_type,
'interpretation': interpretation_type,
'temperature_average': temperature_averageType,
'chain': chain_type,
'microscopy_list': microscopy_listType,
'axis_order': axis_orderType,
'molecular_replacement': molecular_replacementType15,
'acceleration_voltage': acceleration_voltageType,
'segmentation_list': segmentation_listType,
'half_map': map_type,
'initial_angle_assignment': angle_assignment_type,
'voltage': fib_voltage_type,
'pdb_reference': pdb_cross_reference_type,
'staining': stainingType,
'thickness': thicknessType,
'random_conical_tilt': random_conical_tiltType,
'image_processing': base_processing_type,
'upper_energy_threshold': upper_energy_thresholdType,
'natural_source': natural_source_type,
'crystallography_processing': crystallography_processing_type,
'high_resolution': high_resolutionType83,
'parameters': parametersType,
'noise_model': noise_modelType,
'coma_free': coma_freeType,
'crystal_parameters': crystal_parameters_type,
'support_film': film_type,
'sampling_interval': sampling_intervalType,
'primary_citation': primary_citationType,
'contour_list': contour_listType,
'final_thickness': fib_final_thickness_type,
'focused_ion_beam': focused_ion_beamType,
'axis_rotation': axis_rotationType,
'subtomogram_averaging_processing': subtomogram_averaging_processing_type,
'fax': telephone_number_type,
'particle_selection': particle_selection_type,
'glow_discharge': glow_dischargeType,
'chamber_humidity': chamber_humidityType,
'supramolecule_list': supramolecule_listType,
'indexing': indexingType31,
'supramolecule': base_supramolecule_type,
'key_dates': key_datesType,
'final_three_d_classification': classification_type,
'helical_processing': helical_processing_type,
'helix_length': helix_lengthType30,
'grid': grid_type,
'sugar_embedding': sugar_embeddingType,
'crystallography_statistics': crystallography_statistics_type,
'validation_rules': string_validation_type,
'validation_list': validation_listType,
'zemlin_tableau': zemlin_tableauType,
'max_angle': max_angleType,
'symmetry_determination': symmetry_determinationType21,
'emd': entry_type,
'spatial_frequency': spatial_frequencyType,
'_n-link': _n_linkType,
'name': sci_name_type,
'virus_shell': virus_shellType41,
'microscopy': base_microscopy_type,
'temperature_max': temperature_maxType,
'reconstruction_filtering': reconstruction_filtering_type,
'x': pixel_spacing_type,
'delta_phi': delta_phiType,
'temperature_min': temperature_minType,
'shell_list': shell_listType,
'status': statusType,
'starting_model': starting_modelType16,
'alignment_procedure': alignment_procedureType,
'sequence': sequenceType77,
'_brestore': _brestoreType,
'final_two_d_classification': classification_type,
'lower_energy_threshold': lower_energy_thresholdType,
'modelling_list': modelling_listType,
'auxiliary_link': auxiliary_link_type,
'legacy': legacyType,
'c2_aperture_diameter': c2_aperture_diameterType,
'superseded_by_list': superseded_by_listType,
'phase_reversal': phase_reversalType,
'initial_thickness': fib_initial_thickness_type,
'category': categoryType39,
'tomography_processing': tomography_processing_type,
'startup_model': starting_map_type,
'tilt_angle1': tilt_angle1Type,
'tilt_angle2': tilt_angle2Type,
'slice': map_type,
'shadowing': shadowingType,
'contact_author': contact_authorType,
'recombinant_expression': recombinant_source_type,
'sites': sitesType,
'sci_species_name': virus_species_name_type,
'slices_list': slices_listType,
'cell': cellType,
'crystallography_microscopy': crystallography_microscopy_type,
'min_angle': min_angleType,
'citation_list': citation_listType,
'macromolecule_list': macromolecule_listType40,
'current_status': version_type,
'authors_list': authors_listType,
'segmentation': segmentationType,
'tilt_angle': tilt_angleType,
'tomography_microscopy': tomography_microscopy_type,
'pdb_list': pdb_cross_reference_list_type,
'delta_z': delta_zType,
'film_thickness': film_thicknessType,
'image_recording': image_recordingType,
'spacing': spacingType,
'component': componentType,
'initial_model': initial_modelType,
'pressure': pressureType,
'amplitude_correction': amplitude_correctionType,
'helical_parameters': helical_parameters_type,
'auxiliary_link_list': auxiliary_link_listType,
'macromolecules_and_complexes': macromolecules_and_complexes_type,
'structure_determination': structure_determination_type,
'c': cell_type,
'z': pixel_spacing_type,
'final_angle_assignment': angle_assignment_type,
'refinement': refinementType27,
'admin': admin_type,
'starting_symmetry': starting_symmetryType28,
'tomography_preparation': tomography_preparation_type,
'current': fib_current_type,
'additional_map': map_type,
'sharpening': sharpeningType,
'merging': mergingType22,
'dose_rate': fib_dose_rate_type,
'film_or_detector_model': film_or_detector_modelType,
'specimen_preparation': base_preparation_type,
'crossreferences': crossreferences_type,
'calibrated_defocus_max': calibrated_defocus_maxType,
'total_filament_length': total_filament_lengthType26,
'experimental': experimentalType,
'software': software_type,
'origin': originType,
'diameter': diameterType42,
'software_list': software_list_type,
'macromolecule': macromoleculeType,
'symmetry': applied_symmetry_type,
'low_resolution': low_resolutionType84,
'image_recording_list': image_recording_listType,
'height': heightType51,
'contour': contourType,
'chain_id_list': chain_type,
'segment_overlap': segment_overlapType25,
'high_frequency_cutoff': high_frequency_cutoffType,
'average_electron_dose_per_image': average_electron_dose_per_imageType,
'statistics': map_statistics_type,
'glow_discharge_params': glow_discharge_params_type,
'temperature': crystal_formation_temperature_type,
'width': widthType50,
'half_map_list': half_map_listType,
'projection_matching_processing': projection_matching_processingType,
'background_masked': background_masked_type,
'extraction': extractionType13,
'editor': author_order_type,
'basic': basicType,
'c_sampling_length': cell_type,
'discrepancy_list': discrepancy_listType79,
'energy_filter': energy_filterType,
'theoretical': theoreticalType,
'sectioning': sectioningType,
'chamber_temperature': chamber_temperatureType,
'shell': shellType,
'external_references': external_referencesType81,
'relationship': relationshipType1,
'nominal_cs': nominal_csType,
'duration': fib_duration_type,
'secondary_citation': secondary_citationType,
'pdb_model': pdb_model_type,
'modelling': modelling_type,
'average_exposure_time': average_exposure_timeType,
'resolution_range': resolution_rangeType17,
'unit_cell': unit_cell_type,
'digitization_details': digitization_detailsType,
'final_multi_reference_alignment': final_multi_reference_alignmentType14,
'none': noneType,
'b': cell_type,
'hard_validation_regexp': hard_validation_regexpType,
'segment_selection': segment_selectionType23,
'strain': organism_type,
'crystallography_preparation': crystallography_preparation_type,
'spatial_filtering': spatial_filteringType,
'specialist_optics': specialist_optics_type,
'series_aligment_software_list': software_list_type,
'fiducial_marker': fiducial_marker_type,
'camera_length': camera_lengthType,
'high_pressure_freezing': high_pressure_freezingType,
'tilt_series': tilt_series_type,
'angular_sampling': angular_samplingType12,
'final_model': final_modelType,
'radius': radiusType,
'figure': figure_type,
'model_heterogeneity': model_heterogeneityType,
'soft_validation_regexp': soft_validation_regexpType,
'singleparticle_processing': singleparticle_processing_type,
'telephone': telephone_number_type,
'sample': sample_type,
'natural_host': natural_hostType,
'specimen_preparation_list': specimen_preparation_listType,
'host_system': recombinant_source_type,
'concentration': concentrationType,
'lattice_distortion_correction': lattice_distortion_correctionType20,
'vitrification': vitrification_type,
'b-factorSharpening': b_factorSharpeningType,
'specimen_preparations': specimen_preparationsType,
'mask_details': map_type,
'angle': angleType,
'axis1': axis_type,
'axis2': axis2Type,
'author': author_order_type,
'figure_list': figure_listType,
'layer_lines': layer_linesType29,
'molecular_weight': molecular_weight_type,
'emdb_list': emdb_cross_reference_list_type,
'ultramicrotomy': ultramicrotomyType,
'other': otherType,
'obsolete_list': obsolete_listType,
'pixel_spacing': pixel_spacingType,
'status_history_list': version_list_type,
'grant_reference': grant_reference_type,
'nominal_defocus_min': nominal_defocus_minType,
'map': map_type,
'crystal_formation': crystal_formationType,
'buffer': buffer_type,
'tilt_list': tilt_listType,
'segment_length': segment_lengthType24,
'low_frequency_cutoff': low_frequency_cutoffType,
'annotator': annotatorType,
'nominal_defocus_max': nominal_defocus_maxType,
'additional_map_list': additional_map_listType,
'connectivity': connectivityType,
'beta': cell_angle_type,
'entry': supersedes_type,
'applied_symmetry': applied_symmetry_type,
'alpha': cell_angle_type,
'emdb_reference': emdb_cross_reference_type,
'ctf_correction': ctf_correction_type,
'dimensions': dimensionsType,
'a': cell_type,
'_c-link': _c_linkType,
'organism': organism_type,
'orthogonal_tilt': orthogonal_tiltType,
'final_reconstruction': reconstruction_type,
'angle_increment': angle_incrementType,
'grant_support': grant_supportType,
'fiducial_markers_list': fiducial_markers_listType,
'depth': depthType,
'gamma': cell_angle_type,
'time': crystal_formation_time_type,
'y': pixel_spacing_type,
'organization': organizationType,
'validation': validationType,
'resolution': resolutionType75,
'calibrated_defocus_min': calibrated_defocus_minType,
}
USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
"""
def usage():
print(USAGE_TEXT)
sys.exit(1)
def get_root_tag(node):
tag = Tag_pattern_.match(node.tag).groups()[-1]
rootClass = GDSClassesMapping.get(tag)
if rootClass is None:
rootClass = globals().get(tag)
return tag, rootClass
def parse(inFileName, silence=False):
parser = None
doc = parsexml_(inFileName, parser)
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'entry_type'
rootClass = entry_type
rootObj = rootClass.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
if not silence:
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='',
pretty_print=True)
return rootObj
def parseEtree(inFileName, silence=False):
parser = None
doc = parsexml_(inFileName, parser)
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'entry_type'
rootClass = entry_type
rootObj = rootClass.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
mapping = {}
rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping)
reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
if not silence:
content = etree_.tostring(
rootElement, pretty_print=True,
xml_declaration=True, encoding="utf-8")
sys.stdout.write(content)
sys.stdout.write('\n')
return rootObj, rootElement, mapping, reverse_mapping
def parseString(inString, silence=False):
from StringIO import StringIO
parser = None
doc = parsexml_(StringIO(inString), parser)
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'entry_type'
rootClass = entry_type
rootObj = rootClass.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
if not silence:
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='')
return rootObj
def parseLiteral(inFileName, silence=False):
parser = None
doc = parsexml_(inFileName, parser)
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'entry_type'
rootClass = entry_type
rootObj = rootClass.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
if not silence:
sys.stdout.write('#from emdb_da import *\n\n')
sys.stdout.write('import emdb_da as model_\n\n')
sys.stdout.write('rootObj = model_.rootClass(\n')
rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
sys.stdout.write(')\n')
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == '__main__':
#import pdb; pdb.set_trace()
main()
__all__ = [
"_brestoreType",
"_c_linkType",
"_n_linkType",
"acceleration_voltageType",
"additional_map_listType",
"address_type",
"admin_type",
"alignment_procedureType",
"ammonium_molybdate",
"amplitude_correctionType",
"angleType",
"angle_assignment_type",
"angle_incrementType",
"angular_samplingType",
"angular_samplingType12",
"angular_samplingType9",
"annotatorType",
"applied_symmetry_type",
"auro_glucothionate",
"author_order_type",
"authors_listType",
"auxiliary_link_listType",
"auxiliary_link_type",
"average",
"average_electron_dose_per_imageType",
"average_exposure_timeType",
"axis2Type",
"axis_orderType",
"axis_rotation",
"axis_rotationType",
"axis_type",
"b_factorSharpeningType",
"background_masked_type",
"base_macromolecule_type",
"base_microscopy_type",
"base_natural_source_type",
"base_preparation_type",
"base_processing_type",
"base_supramolecule_type",
"base_type",
"basicType",
"buffer_type",
"c2_aperture_diameterType",
"calibrated_defocus_maxType",
"calibrated_defocus_minType",
"camera_lengthType",
"categoryType",
"categoryType39",
"cell",
"cellType",
"cell_angle_type",
"cell_type",
"chainType",
"chainType53",
"chain_id_list",
"chain_model_type",
"chain_type",
"chamber_humidityType",
"chamber_temperatureType",
"citation_listType",
"citation_list_type",
"citation_type",
"classification_type",
"code_type",
"coloured_gaussian",
"coma_freeType",
"complex",
"complex_type",
"componentType",
"concentrationType",
"concentrationType3",
"connectivityType",
"contact_authorType",
"contact_details_type",
"contourType",
"contour_listType",
"coordinate_type",
"crossreferences_type",
"crystal_formationType",
"crystal_formation_temperature_type",
"crystal_formation_time_type",
"crystal_parameters_type",
"crystallography_microscopy_type",
"crystallography_preparation_type",
"crystallography_processing_type",
"crystallography_statistics_type",
"crystallography_tilt_type",
"crystallography_validation",
"ctf_correction_type",
"data_completeness",
"delta_phiType",
"delta_zType",
"depthType",
"diameterType",
"diameterType42",
"diameterType74",
"digitization_detailsType",
"dimensionsType",
"dimensionsType49",
"discrepancy_listType",
"discrepancy_listType57",
"discrepancy_listType62",
"discrepancy_listType79",
"dna",
"em_label",
"emdb_cross_reference_list_type",
"emdb_cross_reference_type",
"energy_filterType",
"entry_type",
"experimentalType",
"external_referencesType",
"external_referencesType45",
"external_referencesType47",
"external_referencesType54",
"external_referencesType59",
"external_referencesType64",
"external_referencesType68",
"external_referencesType70",
"external_referencesType72",
"external_referencesType81",
"extractionType",
"extractionType13",
"fib_current_type",
"fib_dose_rate_type",
"fib_duration_type",
"fib_final_thickness_type",
"fib_initial_thickness_type",
"fib_voltage_type",
"fiducial_marker_type",
"fiducial_markers_listType",
"figure_listType",
"figure_type",
"film",
"film_or_detector_modelType",
"film_thicknessType",
"film_type",
"final_modelType",
"final_multi_reference_alignmentType",
"final_multi_reference_alignmentType10",
"final_multi_reference_alignmentType11",
"final_multi_reference_alignmentType14",
"focused_ion_beamType",
"fsc_curve",
"glow_dischargeType",
"glow_discharge_params_type",
"grant_reference_type",
"grant_supportType",
"grid_type",
"half_map_listType",
"hard_validation_regexpType",
"heightType",
"heightType51",
"helical_parameters_type",
"helical_processing_type",
"helix_lengthType",
"helix_lengthType30",
"high_frequency_cutoffType",
"high_pressure_freezingType",
"high_resolutionType",
"high_resolutionType18",
"high_resolutionType82",
"high_resolutionType83",
"image_recordingType",
"image_recording_listType",
"image_recording_type",
"in_plane_rotation",
"in_plane_translation",
"indexingType",
"indexingType31",
"initial_modelType",
"integer_vector_map_type",
"interpretation_type",
"journal_citation",
"key_datesType",
"lattice_distortion_correctionType",
"lattice_distortion_correctionType20",
"layer_lines",
"layer_linesType",
"layer_linesType29",
"legacyType",
"ligand",
"lipid",
"low_frequency_cutoffType",
"low_resolutionType",
"low_resolutionType19",
"low_resolutionType84",
"lower_energy_thresholdType",
"macromoleculeType",
"macromolecule_listType",
"macromolecule_listType40",
"macromolecule_list_type",
"macromolecules_and_complexes_type",
"map_statistics_type",
"map_type",
"max",
"max_angleType",
"maximum_likelihood_type",
"mergingType",
"mergingType22",
"microscopy_listType",
"min",
"min_angleType",
"model_heterogeneityType",
"model_type",
"modelling_listType",
"modelling_type",
"molecular_replacementType",
"molecular_replacementType15",
"molecular_weightType",
"molecular_weight_type",
"molecule_id",
"name_type",
"natural_hostType",
"natural_sourceType",
"natural_sourceType36",
"natural_sourceType37",
"natural_sourceType38",
"natural_source_type",
"noise_modelType",
"nominal_csType",
"nominal_defocus_maxType",
"nominal_defocus_minType",
"non_journal_citation",
"noneType",
"number_classes",
"number_helices",
"number_observed_reflections",
"number_unique_reflections",
"obsolete_listType",
"organelle_or_cellular_component",
"organism_type",
"organizationType",
"originType",
"orthogonal_tiltType",
"osmium_ferricyanide",
"osmium_tetroxide",
"other",
"otherType",
"otherType52",
"other_macromolecule",
"out_of_plane_rotation",
"parallel_resolution",
"parametersType",
"particle_selection_type",
"pdb_cross_reference_list_type",
"pdb_cross_reference_type",
"pdb_model_type",
"perpendicular_resolution",
"phase_reversalType",
"phophotungstic_acid",
"pixel_spacingType",
"pixel_spacing_type",
"pressureType",
"primary_citationType",
"projection_matching_processingType",
"protein_or_peptide",
"radiusType",
"random_conical_tiltType",
"recombinant_source_type",
"reconstruction_filtering_type",
"reconstruction_type",
"refinementType",
"refinementType27",
"regexp_string",
"relationshipType",
"relationshipType1",
"resolutionType",
"resolutionType75",
"resolution_rangeType",
"resolution_rangeType17",
"results_type",
"rna",
"saccharide",
"sample",
"sample_type",
"sampling_intervalType",
"sci_name_type",
"secondary_citationType",
"sectioningType",
"segment_lengthType",
"segment_lengthType24",
"segment_overlapType",
"segment_overlapType25",
"segment_selectionType",
"segment_selectionType23",
"segmentationType",
"segmentation_listType",
"sequenceType",
"sequenceType55",
"sequenceType60",
"sequenceType77",
"shadowingType",
"sharpeningType",
"shellType",
"shell_listType",
"singleparticle_processing_type",
"sitesType",
"slices_listType",
"soft_validation_regexpType",
"software_list_type",
"software_type",
"spacingType",
"spatial_filteringType",
"spatial_frequencyType",
"specialist_optics_type",
"specimen_preparation_listType",
"specimen_preparationsType",
"stain_type",
"stainingType",
"starting_map_type",
"starting_modelType",
"starting_modelType16",
"starting_symmetryType",
"starting_symmetryType28",
"statusType",
"status_type",
"string_type",
"string_validation_type",
"structure_determination_listType",
"structure_determination_type",
"structure_factors",
"subtomogram_averaging_processing_type",
"subtomogram_reconstruction_type",
"sugar_embeddingType",
"superseded_by_listType",
"supersedes_type",
"supramolecule_listType",
"symmetry_determinationType",
"symmetry_determinationType21",
"telephone_number_type",
"temperatureType",
"temperature_averageType",
"temperature_maxType",
"temperature_minType",
"temperature_type",
"theoreticalType",
"thicknessType",
"tilt_angle1Type",
"tilt_angle2Type",
"tilt_angleType",
"tilt_angle_max",
"tilt_angle_min",
"tilt_listType",
"tilt_series_type",
"timeType",
"tissue",
"tomography_microscopy_type",
"tomography_preparation_type",
"tomography_processing_type",
"total_filament_lengthType",
"total_filament_lengthType26",
"ultramicrotomyType",
"ultramicrotomy_final_thickness_type",
"unit_cell_type",
"upper_energy_thresholdType",
"uranyl_acetate",
"uranyl_formate",
"validationType",
"validation_listType",
"validation_type",
"version_list_type",
"version_type",
"virus",
"virus_shellType",
"virus_shellType41",
"virus_species_name_type",
"vitrification_type",
"weighted_phase_residual",
"weighted_r_factor",
"white_gaussian",
"widthType",
"widthType50",
"zemlin_tableauType"
]