SDF.data_model.source_parameter module¶
-
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