SDF.data_model package¶
-
class
AnonymousParameterSet
(items: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None)[source]¶ Bases:
SDF.data_model.element_set.ElementSet
[SDF.data_model.parameter.ParameterType
]Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
add_from_structure
(structure: typing.Sequence, parse_names_from_dicts: bool = False)[source]¶
-
copy
() → SDF.data_model.element_set.ElementSet[T]¶ Return a shallow copy of this collection
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
ArrayData1D
(data: numpy.ndarray, try_hex_transformation: bool = False)[source]¶ Bases:
SDF.data_model.abstract.Data
Wraps a 1-dimensional Numpy ndarray, represents SDF <data> tags of dataset type ‘sc’
-
property
data
¶ The wrapped array
-
static
from_linearly_transformed_array
(array: numpy.ndarray, multiplier: float, offset: float) → SDF.data_model.array_data_1d.ArrayData1D[source]¶ Instantiate from a non-negative integer array with multiplier and offset
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.array_data_1d.ArrayData1D[source]¶ Generates an instance of this class from an Element
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
type_for_xml
¶ The ‘type’ attribute the wrapping <dataset> element has to have
-
property
-
class
ArrayData2D
(data: numpy.ndarray)[source]¶ Bases:
SDF.data_model.abstract.Data
Wraps a 2-dimensional Numpy ndarray, represents SDF <data> elements of dataset type ‘mc’
-
property
data
¶ The wrapped array
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.array_data_2d.ArrayData2D[source]¶ Generates an instance of this class from an Element
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
type_for_xml
¶ The ‘type’ attribute the wrapping <dataset> element has to have
-
property
-
class
ArrayDataset1D
(name: typing.Union[str, SDF.data_model.name.NameElement], data: typing.Union[SDF.data_model.array_data_1d.ArrayData1D, numpy.ndarray], *, unit: typing.Optional[str] = None, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Iterable[SDF.data_model.sample.Sample]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
SDF.data_model.dataset.Dataset
Represents an SDF <dataset> element
-
property
comment
¶
-
property
data
¶ Data array
-
property
date
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.array_dataset_1d.ArrayDataset1D[source]¶ Reads the ‘type’ attribute of a <dataset type=…> element, delegates to the associated Dataset subclass
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
unit
¶ Unit of data
-
property
-
class
ArrayDataset2D
(name: typing.Union[str, SDF.data_model.name.NameElement], data: typing.Union[SDF.data_model.array_data_2d.ArrayData2D, numpy.ndarray], *, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Iterable[SDF.data_model.sample.Sample]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
SDF.data_model.dataset.Dataset
Represents an SDF <dataset> element
-
property
comment
¶
-
property
data
¶
-
property
date
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.array_dataset_2d.ArrayDataset2D[source]¶ Reads the ‘type’ attribute of a <dataset type=…> element, delegates to the associated Dataset subclass
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
-
class
Comment
(comment: str)[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
Represents an SDF <comment> element
-
property
comment
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.comment.Comment[source]¶ Generates an instance of this class from an Element
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
-
class
Data
[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
Abstract class for all SDF objects representing <data> elements
-
abstract classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.abstract.XMLWritable¶ Generates an instance of this class from an Element
-
abstract
to_xml_element
() → xml.etree.ElementTree.Element¶ Returns an Element object that contains all information needed to export this object as XML.
-
abstract property
type_for_xml
¶ The ‘type’ attribute the wrapping <dataset> element has to have
-
abstract classmethod
-
class
Dataset
(name: typing.Union[str, SDF.data_model.name.NameElement], *, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Union[typing.Iterable[SDF.data_model.sample.Sample], typing.Mapping[str, str]]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
SDF.data_model.sdf_object.SDFObject
,SDF.data_model.abstract.XMLWritable
Abstract class. Dataset implementations must inherit from it.
-
property
comment
¶
-
property
date
¶
-
static
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.dataset.Dataset[source]¶ Reads the ‘type’ attribute of a <dataset type=…> element, delegates to the associated Dataset subclass
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
abstract
to_xml_element
() → xml.etree.ElementTree.Element¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
-
class
Date
(date: datetime.datetime, dateformat: typing.Optional[str] = None)[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
Wraps a datetime.datetime object. Represents an SDF <date> element.
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.date.Date[source]¶ Generates an instance of this class from an Element
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
classmethod
-
class
ElementSet
(key_func: typing.Callable[T, str], check_func: typing.Callable[T, bool], items: typing.Optional[typing.Iterable[T]] = None)[source]¶ Bases:
typing.Generic
[typing.T
]Strictly typed collection that mostly resembles an ordered set, but borrows some behavior of list and dict.
Items must be representable by a str key (like item.name), allowing dict-like access.
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None[source]¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
copy
() → SDF.data_model.element_set.ElementSet[T][source]¶ Return a shallow copy of this collection
-
items
() → typing.ItemsView[str, T][source]¶ Like dict.items
-
keys
() → typing.KeysView[str][source]¶ Like dict.keys
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T[source]¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None[source]¶ Remove the item. If key is a string, remove the item specified by key
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None[source]¶ Like set.update
-
values
() → typing.ValuesView[T][source]¶ Like dict.values
-
class
ImageData
(data: PIL.Image.Image)[source]¶ Bases:
SDF.data_model.abstract.Data
Wraps a PIL Image. Represents an SDF <data> element of type ‘img’.
-
static
base64_to_image
(base64_str: str) → PIL.Image.Image[source]¶ Read base64-encoded PNG image
-
property
data
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.image_data.ImageData[source]¶ Generates an instance of this class from an Element
-
static
image_to_base64
(image: PIL.Image.Image) → str[source]¶ Return base64-encoded PNG representation of image
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
type_for_xml
¶ The ‘type’ attribute the wrapping <dataset> element has to have
-
static
-
class
ImageDataset
(name: typing.Union[str, SDF.data_model.name.NameElement], data: typing.Union[SDF.data_model.image_data.ImageData, PIL.Image.Image], *, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Iterable[SDF.data_model.sample.Sample]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
SDF.data_model.dataset.Dataset
Represents an SDF <dataset> element
-
property
comment
¶
-
property
data
¶
-
property
date
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.image_dataset.ImageDataset[source]¶ Reads the ‘type’ attribute of a <dataset type=…> element, delegates to the associated Dataset subclass
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
-
class
Instrument
(name: typing.Optional[typing.Union[str, SDF.data_model.name.NameElement]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None)[source]¶ Bases:
SDF.data_model.parameter.AnonymousParameterSet
,SDF.data_model.abstract.XMLWritable
Represents an SDF <instrument> element
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
add_from_structure
(structure: typing.Sequence, parse_names_from_dicts: bool = False)¶
-
copy
() → SDF.data_model.element_set.ElementSet[T]¶ Return a shallow copy of this collection
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.instrument.Instrument[source]¶ Generates an instance of this class from an Element
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
property
name
¶
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
InstrumentSet
(items: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
SDF.data_model.element_set.ElementSet
[SDF.data_model.instrument.Instrument
]Extends ElementSet[Instrument] to allow adding parameters more intuitively
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
copy
() → SDF.data_model.element_set.ElementSet[T]¶ Return a shallow copy of this collection
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
NameElement
(name: str)[source]¶ Bases:
SDF.data_model.name.Name
,SDF.data_model.abstract.XMLWritable
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.name.NameElement[source]¶ Generates an instance of this class from an Element
-
property
name
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
classmethod
-
class
Owner
(name: str)[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
Represents an SDF <owner> element
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.owner.Owner[source]¶ Generates an instance of this class from an Element
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
classmethod
-
class
Parameter
(name: typing.Union[str, SDF.data_model.name.Name], value: typing.Any, unit: typing.Optional[str] = None)[source]¶ Bases:
SDF.data_model.parameter.ParameterType
Represents a single-valued SDF <par> element
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.parameter.Parameter[source]¶ Generates an instance of this class from an Element
-
property
name
¶
-
property
parsed_value
¶ Try to parse self.value as a Python literal (e.g. int, float, list, tuple, str, bytes)
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
classmethod
-
class
ParameterSet
(name: typing.Union[str, SDF.data_model.name.Name], items: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None)[source]¶ Bases:
SDF.data_model.parameter.AnonymousParameterSet
,SDF.data_model.parameter.ParameterType
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
add_from_structure
(structure: typing.Sequence, parse_names_from_dicts: bool = False)¶
-
copy
() → SDF.data_model.parameter.ParameterSet[source]¶ Return a shallow copy of this collection
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.parameter.ParameterSet[source]¶ Generates an instance of this class from an Element
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
property
name
¶
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
ParameterType
[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
-
static
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.parameter.ParameterType[source]¶ Generates an instance of this class from an Element
-
abstract
to_xml_element
() → xml.etree.ElementTree.Element¶ Returns an Element object that contains all information needed to export this object as XML.
-
static
-
class
SDFObject
(name: typing.Union[str, SDF.data_model.name.NameElement], *, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Union[typing.Iterable[SDF.data_model.sample.Sample], typing.Mapping[str, str]]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None)[source]¶ Bases:
object
Superclass for datasets and workspaces
-
property
comment
¶
-
property
date
¶
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
property
-
class
Sample
(name: typing.Union[str, SDF.data_model.name.NameElement], comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None)[source]¶ Bases:
SDF.data_model.abstract.XMLWritable
Represents an SDF <sample> element
-
property
comment
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.sample.Sample[source]¶ Generates an instance of this class from an Element
-
property
name
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
-
class
SampleSet
(items: typing.Optional[typing.Iterable[SDF.data_model.sample.Sample]] = None)[source]¶ Bases:
SDF.data_model.element_set.ElementSet
[SDF.data_model.sample.Sample
]Behaves like Dict[str, str], where the keys are sample names and the values are the associated comments
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
copy
() → SDF.data_model.element_set.ElementSet[T]¶ Return a shallow copy of this collection
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
SourceParameters
(converter_name: typing.Optional[str] = None, source_file: typing.Optional[str] = None, source_file_type: typing.Optional[str] = None)[source]¶ Bases:
SDF.data_model.parameter.ParameterSet
Represents an <par name=”source-of-sdf-file”> element. Carries information about the origin of the SDF file.
Create an empty ElementSet.
- Parameters
key_func – Function to get a string key from an item (e.g. lambda item: item.name)
check_func – Function to check if an item is valid for this ElementSet (e.g. lambda item: hasattr(item, ‘name’) or lambda item: isinstance(item, …)). If it returns True, everything is fine. If it returns False, a default exception is raised. To raise a more specific exception, raise an exception instead of returning False.
-
add
(item: T, as_first: bool = False) → None¶ Add an item to the collection. If as_first, the item is added at the beginning, else at the end.
-
add_from_structure
(structure: typing.Sequence, parse_names_from_dicts: bool = False)¶
-
copy
() → SDF.data_model.parameter.ParameterSet¶ Return a shallow copy of this collection
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.parameter.ParameterSet¶ Generates an instance of this class from an Element
-
items
() → typing.ItemsView[str, T]¶ Like dict.items
-
keys
() → typing.KeysView[str]¶ Like dict.keys
-
property
name
¶
-
pop
(key: typing.Optional[typing.Union[str, int]] = None) → T¶ Like dict.pop if key is str, else like list.pop
-
remove
(item: typing.Union[str, T]) → None¶ Remove the item. If key is a string, remove the item specified by key
-
to_xml_element
() → xml.etree.ElementTree.Element¶ Returns an Element object that contains all information needed to export this object as XML.
-
update
(*items: typing.Union[T, typing.Iterable[T]]) → None¶ Like set.update
-
values
() → typing.ValuesView[T]¶ Like dict.values
-
class
Workspace
(name: typing.Union[str, SDF.data_model.name.NameElement], *, owner: typing.Optional[typing.Union[str, SDF.data_model.owner.Owner]] = None, date: typing.Optional[typing.Union[datetime.datetime, SDF.data_model.date.Date]] = None, comment: typing.Optional[typing.Union[str, SDF.data_model.comment.Comment]] = None, samples: typing.Optional[typing.Iterable[SDF.data_model.sample.Sample]] = None, parameters: typing.Optional[typing.Iterable[SDF.data_model.parameter.ParameterType]] = None, instruments: typing.Optional[typing.Iterable[SDF.data_model.instrument.Instrument]] = None, datasets: typing.Optional[typing.Iterable[SDF.data_model.dataset.Dataset]] = None, workspaces: typing.Optional[typing.Iterable[SDF.data_model.workspace.Workspace]] = None)[source]¶ Bases:
SDF.data_model.sdf_object.SDFObject
,SDF.data_model.abstract.XMLWritable
Represents an SDF <workspace> element
-
property
comment
¶
-
property
datasets
¶
-
property
date
¶
-
classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.workspace.Workspace[source]¶ Generates an instance of this class from an Element
-
property
instruments
¶
-
property
name
¶
-
property
owner
¶
-
property
parameters
¶
-
property
samples
¶
-
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
property
workspaces
¶
-
property
-
class
XMLWritable
[source]¶ Bases:
abc.ABC
Abstract class for all SDF objects that are directly mappable to XML elements
-
abstract classmethod
from_xml_element
(element: xml.etree.ElementTree.Element) → SDF.data_model.abstract.XMLWritable[source]¶ Generates an instance of this class from an Element
-
abstract
to_xml_element
() → xml.etree.ElementTree.Element[source]¶ Returns an Element object that contains all information needed to export this object as XML.
-
abstract classmethod
Submodules¶
- SDF.data_model.abstract module
- SDF.data_model.array_data_1d module
- SDF.data_model.array_data_2d module
- SDF.data_model.array_dataset_1d module
- SDF.data_model.array_dataset_2d module
- SDF.data_model.comment module
- SDF.data_model.dataset module
- SDF.data_model.date module
- SDF.data_model.element_set module
- SDF.data_model.image_data module
- SDF.data_model.image_dataset module
- SDF.data_model.instrument module
- SDF.data_model.name module
- SDF.data_model.owner module
- SDF.data_model.parameter module
- SDF.data_model.sample module
- SDF.data_model.sdf_object module
- SDF.data_model.source_parameter module
- SDF.data_model.workspace module