Public API¶
- class sire.base.PageCache¶
This class manages a swap cache of binary data that can be paged to and from disk. The cache can receive binary data of any size, and will automatically manage the paging of that data to and from disk as it is accessed.
You can create different caches, and have control over the maximum size of each cache page.
Note that deleting the cache will delete all data contained therein - including data paged to disk
- class Handle¶
This is a handle to a piece of data that has been added to the cache. This will either contain the actual data, or will hold the information necessary to retrieve that data from disk.
Data is removed from the cache when all handles to it are deleted
- assertValid((Handle)arg1) None : ¶
Assert that this object is valid
- C++ signature :
void assertValid(SireBase::PageCache::Handle {lvalue})
- assign((Handle)arg1, (Handle)other) Handle : ¶
- C++ signature :
SireBase::PageCache::Handle {lvalue} assign(SireBase::PageCache::Handle {lvalue},SireBase::PageCache::Handle)
- clear((Handle)arg1) None : ¶
Clear the data from this handle
- C++ signature :
void clear(SireBase::PageCache::Handle {lvalue})
- clone((Handle)arg1) Handle : ¶
- C++ signature :
SireBase::PageCache::Handle clone(SireBase::PageCache::Handle)
- fetch()¶
Fetch the object from the cache and return it
- isNull((Handle)arg1) bool : ¶
Return whether this handle is null (does not hold data)
- C++ signature :
bool isNull(SireBase::PageCache::Handle {lvalue})
- isValid((Handle)arg1) bool : ¶
Return whether this handle is valid (holds data)
- C++ signature :
bool isValid(SireBase::PageCache::Handle {lvalue})
- nBytes((Handle)arg1) int : ¶
Return the number of bytes in this handle
- C++ signature :
unsigned int nBytes(SireBase::PageCache::Handle {lvalue})
- page((Handle)arg1) Page : ¶
- Return the page on which the data for this handle is placed.
This will be null if the data has not yet been put on a page
- C++ signature :
SireBase::PageCache::Page page(SireBase::PageCache::Handle {lvalue})
- parent((Handle)arg1) PageCache : ¶
Return the parent cache for this handle
- C++ signature :
SireBase::PageCache parent(SireBase::PageCache::Handle {lvalue})
- reset((Handle)arg1) None : ¶
Clear the data in this handle
- C++ signature :
void reset(SireBase::PageCache::Handle {lvalue})
- size((Handle)arg1) int : ¶
Return the number of bytes in this handle
- C++ signature :
unsigned int size(SireBase::PageCache::Handle {lvalue})
- toString((Handle)arg1) object : ¶
Return a string representation of this object
- C++ signature :
QString toString(SireBase::PageCache::Handle {lvalue})
- static typeName() str : ¶
Return the type name for this object
- C++ signature :
char const* typeName()
- what((Handle)arg1) str : ¶
Return the type name for this object
- C++ signature :
char const* what(SireBase::PageCache::Handle {lvalue})
- class Page¶
This is a page in the cache. This can hold multiple objects - the whole page is either resident in memory or cached to disk.
- assertValid((Page)arg1) None : ¶
Assert that this object is valid
- C++ signature :
void assertValid(SireBase::PageCache::Page {lvalue})
- assign((Page)arg1, (Page)other) Page : ¶
- C++ signature :
SireBase::PageCache::Page {lvalue} assign(SireBase::PageCache::Page {lvalue},SireBase::PageCache::Page)
- clone((Page)arg1) Page : ¶
- C++ signature :
SireBase::PageCache::Page clone(SireBase::PageCache::Page)
- isCached((Page)arg1) bool : ¶
Return whether this page is cached to disk
- C++ signature :
bool isCached(SireBase::PageCache::Page {lvalue})
- isNull((Page)arg1) bool : ¶
Return whether this page is null (has no size)
- C++ signature :
bool isNull(SireBase::PageCache::Page {lvalue})
- isResident((Page)arg1) bool : ¶
Return whether this page is resident in memory
- C++ signature :
bool isResident(SireBase::PageCache::Page {lvalue})
- isValid((Page)arg1) bool : ¶
Return whether this page is valid (has some size)
- C++ signature :
bool isValid(SireBase::PageCache::Page {lvalue})
- maxBytes((Page)arg1) int : ¶
Return the maximum number of bytes that can be stored in this page
- C++ signature :
unsigned int maxBytes(SireBase::PageCache::Page {lvalue})
- nBytes((Page)arg1) int : ¶
Return the number of bytes in this page
- C++ signature :
unsigned int nBytes(SireBase::PageCache::Page {lvalue})
- parent((Page)arg1) PageCache : ¶
Return the parent cache for this page
- C++ signature :
SireBase::PageCache parent(SireBase::PageCache::Page {lvalue})
- size((Page)arg1) int : ¶
Return the number of bytes in this page
- C++ signature :
unsigned int size(SireBase::PageCache::Page {lvalue})
- toString((Page)arg1) object : ¶
Return a string representation of this object
- C++ signature :
QString toString(SireBase::PageCache::Page {lvalue})
- static typeName() str : ¶
Return the type name for this object
- C++ signature :
char const* typeName()
- what((Page)arg1) str : ¶
Return the type name for this object
- C++ signature :
char const* what(SireBase::PageCache::Page {lvalue})
- assert_valid()¶
- assertValid( (PageCache)arg1) -> None :
Assert that this object is valid
- C++ signature :
void assertValid(SireBase::PageCache {lvalue})
- assign((PageCache)arg1, (PageCache)other) PageCache : ¶
- C++ signature :
SireBase::PageCache {lvalue} assign(SireBase::PageCache {lvalue},SireBase::PageCache)
- cache_dir()¶
- cacheDir( (PageCache)arg1) -> object :
Return the cache directory for this cache
- C++ signature :
QString cacheDir(SireBase::PageCache {lvalue})
- clone((PageCache)arg1) PageCache : ¶
- C++ signature :
SireBase::PageCache clone(SireBase::PageCache)
- get_statistics()¶
- getStatistics() -> object :
Return the statistics for all caches
- C++ signature :
QString getStatistics()
- is_null()¶
- isNull( (PageCache)arg1) -> bool :
Return whether or not this cache is null
- C++ signature :
bool isNull(SireBase::PageCache {lvalue})
- is_valid()¶
- isValid( (PageCache)arg1) -> bool :
Return whether or not this cache is valid
- C++ signature :
bool isValid(SireBase::PageCache {lvalue})
- max_page_size()¶
- maxPageSize() -> int :
Return the current recommend maximum page size
- C++ signature :
unsigned int maxPageSize()
- max_resident_pages()¶
- maxResidentPages() -> int :
Return the maximum number of resident pages per cache
- C++ signature :
unsigned int maxResidentPages()
- num_bytes()¶
- nBytes( (PageCache)arg1) -> int :
Return the number of bytes saved in this cache
- C++ signature :
unsigned int nBytes(SireBase::PageCache {lvalue})
- num_pages()¶
- nPages( (PageCache)arg1) -> int :
Return the number of pages in this cache
- C++ signature :
unsigned int nPages(SireBase::PageCache {lvalue})
- page_size()¶
- pageSize( (PageCache)arg1) -> int :
Return the suggested maximum page size for this cache
- C++ signature :
unsigned int pageSize(SireBase::PageCache {lvalue})
- root_directory()¶
rootDirectory() -> object :
- C++ signature :
QString rootDirectory()
- set_max_page_size()¶
- setMaxPageSize( (int)max_page_size [, (bool)update_existing=False]) -> None :
- Set the default maximum page cache size for all new created
caches that dont specify it themselves
- C++ signature :
void setMaxPageSize(unsigned int [,bool=False])
- set_max_resident_pages()¶
- setMaxResidentPages( (int)n_pages) -> None :
Set the maximum number of resident pages per cache
- C++ signature :
void setMaxResidentPages(unsigned int)
- set_root_directory()¶
setRootDirectory( (object)cache_dir) -> None :
- C++ signature :
void setRootDirectory(QString)
- size((PageCache)arg1) int : ¶
Return the number of bytes saved in this cache
- C++ signature :
unsigned int size(SireBase::PageCache {lvalue})
- store(data)¶
Store the passed object into the cache. This will convert the object into a binary form (pickled, then hex-encoded) and it will store it in the cache. This returns a handle to the object in the cache, which can be used to restore it.
- to_string()¶
- toString( (PageCache)arg1) -> object :
Return a string representation of this object
- C++ signature :
QString toString(SireBase::PageCache {lvalue})
- typename()¶
- typeName() -> str :
Return the type name for this object
- C++ signature :
char const* typeName()
- what((PageCache)arg1) str : ¶
Return the type name for this object
- C++ signature :
char const* what(SireBase::PageCache {lvalue})
- class sire.base.Properties¶
This class holds a collection of properties, indexed by name. Each property comes complete with a set of metadata. The metadata is actually another Properties object, and indeed Properties can itself be a Property, so allowing Properties to be nested indefinitely.
Author: Christopher Woods
- add_link()¶
- addLink( (Properties)arg1, (object)key, (object)linked_property) -> None :
- Add a link from the property key to the property linked_property.
The linked_property will be returned if there is no property called key in this set.
Note that the linked property must already be contained in this set.
- C++ signature :
void addLink(SireBase::Properties {lvalue},QString,QString)
- all_metadata()¶
- allMetadata( (Properties)arg1) -> Properties :
Return all of the metadata associated with this properties object
- C++ signature :
SireBase::Properties allMetadata(SireBase::Properties {lvalue})
- allMetadata( (Properties)arg1, (PropertyName)key) -> Properties :
Return the metadata for the property with key key Throw: SireBase::missing_property
- C++ signature :
SireBase::Properties allMetadata(SireBase::Properties {lvalue},SireBase::PropertyName)
- as_array()¶
- asAnArray( (Property)arg1) -> PropertyList :
Return this property converted to an array property. By default, this automatically puts this property into a PropertyList and returns that
- C++ signature :
SireBase::PropertyList asAnArray(SireBase::Property {lvalue})
- as_boolean()¶
- asABoolean( (Property)arg1) -> bool :
Return this property converted to a bool. This throws an invalid cast if this is not possible
- C++ signature :
bool asABoolean(SireBase::Property {lvalue})
- as_double()¶
- asADouble( (Property)arg1) -> float :
Return this property converted to a double. This throws an invalid cast if this is not possible
- C++ signature :
double asADouble(SireBase::Property {lvalue})
- as_integer()¶
- asAnInteger( (Property)arg1) -> int :
Return this property converted to an integer. This throws an invalid cast if this is not possible
- C++ signature :
int asAnInteger(SireBase::Property {lvalue})
- as_string()¶
- asAString( (Property)arg1) -> object :
Return this property converted to a string. This throws an invalid cast if this is not possible
- C++ signature :
QString asAString(SireBase::Property {lvalue})
- as_unit()¶
- asAUnit( (Property)arg1) -> GeneralUnit :
Return this property converted to a unit
- C++ signature :
SireUnits::Dimension::GeneralUnit asAUnit(SireBase::Property {lvalue})
- assert_contains_metadata()¶
- assertContainsMetadata( (Properties)arg1, (PropertyName)metakey) -> None :
Assert that this contains the metadata at metakey metakey
- C++ signature :
void assertContainsMetadata(SireBase::Properties {lvalue},SireBase::PropertyName)
- assertContainsMetadata( (Properties)arg1, (PropertyName)key, (PropertyName)metakey) -> None :
Assert that this set contains the metadata property for the property key with metakey metakey Throw: SireBase::missing_property
- C++ signature :
void assertContainsMetadata(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::PropertyName)
- assert_contains_property()¶
- assertContainsProperty( (Properties)arg1, (PropertyName)key) -> None :
Assert that this set contains a property with key key Throw: SireBase::missing_property
- C++ signature :
void assertContainsProperty(SireBase::Properties {lvalue},SireBase::PropertyName)
- assign((Properties)arg1, (Properties)other) Properties : ¶
- C++ signature :
SireBase::Properties {lvalue} assign(SireBase::Properties {lvalue},SireBase::Properties)
- clear((Properties)arg1) None : ¶
Completely clear this object of all properties and metadata
- C++ signature :
void clear(SireBase::Properties {lvalue})
- clone((Properties)arg1) Properties : ¶
- C++ signature :
SireBase::Properties clone(SireBase::Properties)
- count((Properties)arg1) int : ¶
Return the number of properties in this set
- C++ signature :
int count(SireBase::Properties {lvalue})
- get_links()¶
- getLinks( (Properties)arg1) -> object :
Return all of the property links
- C++ signature :
QHash<QString, QString> getLinks(SireBase::Properties {lvalue})
- has_links()¶
- hasLinks( (Properties)arg1) -> bool :
Return whether or not there are any property links
- C++ signature :
bool hasLinks(SireBase::Properties {lvalue})
- has_metadata()¶
- hasMetadata( (Properties)arg1, (PropertyName)metakey) -> bool :
Return whether or not this contains the metadata with metakey metakey
- C++ signature :
bool hasMetadata(SireBase::Properties {lvalue},SireBase::PropertyName)
- hasMetadata( (Properties)arg1, (PropertyName)key, (PropertyName)metakey) -> bool :
Return whether or not the property with key key contains some metadata with the metakey metakey Throw: SireBase::missing_property
- C++ signature :
bool hasMetadata(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::PropertyName)
- has_property()¶
- hasProperty( (Properties)arg1, (PropertyName)key) -> bool :
Return whether or not this contains a property with key key
- C++ signature :
bool hasProperty(SireBase::Properties {lvalue},SireBase::PropertyName)
- is_array()¶
- isAnArray( (Property)arg1) -> bool :
Return whether or not this is an array property (or can convert to an array property)
- C++ signature :
bool isAnArray(SireBase::Property {lvalue})
- is_boolean()¶
- isABoolean( (Property)arg1) -> bool :
Return whether or not this property holds a bool (or can convert to a bool)
- C++ signature :
bool isABoolean(SireBase::Property {lvalue})
- is_double()¶
- isADouble( (Property)arg1) -> bool :
Return whether or not this property holds a double (or can convert to a double)
- C++ signature :
bool isADouble(SireBase::Property {lvalue})
- is_empty()¶
- isEmpty( (Properties)arg1) -> bool :
Return whether this is empty (has no values)
- C++ signature :
bool isEmpty(SireBase::Properties {lvalue})
- is_integer()¶
- isAnInteger( (Property)arg1) -> bool :
Return whether or not this property holds an integer (or can convert to an integer)
- C++ signature :
bool isAnInteger(SireBase::Property {lvalue})
- is_string()¶
- isAString( (Property)arg1) -> bool :
Return whether or not this property holds a string (or can convert to a string)
- C++ signature :
bool isAString(SireBase::Property {lvalue})
- is_unit()¶
- isAUnit( (Property)arg1) -> bool :
Return whether or not this property holds a unit (or can convert to a unit)
- C++ signature :
bool isAUnit(SireBase::Property {lvalue})
- keys()¶
- propertyKeys( (Properties)arg1) -> object :
Return the keys for all of the properties in this set
- C++ signature :
QStringList propertyKeys(SireBase::Properties {lvalue})
- metadata((Properties)arg1, (PropertyName)metakey) Property : ¶
- Return the metadata at metakey metakey - note that if metakey
specifies a value rather than a source, then the value contained in the metakey is returned. Throw: SireBase::missing_property
- C++ signature :
SireBase::Property metadata(SireBase::Properties {lvalue},SireBase::PropertyName)
- metadata( (Properties)arg1, (PropertyName)metakey, (Property)default_value) -> Property :
Return the metadata at metakey metakey - note that if metakey specifies a value rather than a source, then the value contained in the metakey is returned. If there is no such metadata, and no value is contained in the metakey, then default_value is returned
- C++ signature :
SireBase::Property metadata(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::Property)
- metadata( (Properties)arg1, (PropertyName)key, (PropertyName)metakey) -> Property :
Return the metadata at metakey metakey that is associated with the property at key key. Throw: SireBase::missing_property
- C++ signature :
SireBase::Property metadata(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::PropertyName)
- metadata( (Properties)arg1, (PropertyName)key, (PropertyName)metakey, (Property)default_value) -> Property :
Return the metadata at metakey metakey that is associated with the property at key key, or default_value if there is no such metadata.
- C++ signature :
SireBase::Property metadata(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::PropertyName,SireBase::Property)
- metadata_keys()¶
- metadataKeys( (Properties)arg1) -> object :
Return the list of metadata keys
- C++ signature :
QStringList metadataKeys(SireBase::Properties {lvalue})
- metadataKeys( (Properties)arg1, (PropertyName)key) -> object :
Return the list of metadata keys for the property with key key Throw: SireBase::missing_property
- C++ signature :
QStringList metadataKeys(SireBase::Properties {lvalue},SireBase::PropertyName)
- metadata_type()¶
- metadataType( (Properties)arg1, (PropertyName)metakey) -> str :
Return the type name of the metadata at metakey metakey Throw: SireBase::missing_property
- C++ signature :
char const* metadataType(SireBase::Properties {lvalue},SireBase::PropertyName)
- metadataType( (Properties)arg1, (PropertyName)key, (PropertyName)metakey) -> str :
Return the type name of the metadata at metakey metakey for the property at key key Throw: SireBase::missing_property
- C++ signature :
char const* metadataType(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::PropertyName)
- num_properties()¶
- nProperties( (Properties)arg1) -> int :
Return the number of properties in this set
- C++ signature :
int nProperties(SireBase::Properties {lvalue})
- property((Properties)arg1, (PropertyName)key) Property : ¶
- Return the property with key key - note that if
key specifies a value rather than a source, then the value contained in the key is returned Throw: SireBase::missing_property
- C++ signature :
SireBase::Property property(SireBase::Properties {lvalue},SireBase::PropertyName)
- property( (Properties)arg1, (PropertyName)key, (Property)default_value) -> Property :
Return the property with key key - note that if key specifies a value rather than a source, then the value contained in the key is returned. If no such source exists, and there is no value in the key, then default_value is returned
- C++ signature :
SireBase::Property property(SireBase::Properties {lvalue},SireBase::PropertyName,SireBase::Property)
- property_keys()¶
- propertyKeys( (Properties)arg1) -> object :
Return the keys for all of the properties in this set
- C++ signature :
QStringList propertyKeys(SireBase::Properties {lvalue})
- property_type()¶
- propertyType( (Properties)arg1, (PropertyName)key) -> str :
Return the type name of the property at key key Throw: SireBase::missing_property
- C++ signature :
char const* propertyType(SireBase::Properties {lvalue},SireBase::PropertyName)
- remove_all_links()¶
- removeAllLinks( (Properties)arg1) -> None :
Remove all property links from this set
- C++ signature :
void removeAllLinks(SireBase::Properties {lvalue})
- remove_all_metadata()¶
- removeAllMetadata( (Properties)arg1) -> None :
Remove all of the top-level metadata
- C++ signature :
void removeAllMetadata(SireBase::Properties {lvalue})
- removeAllMetadata( (Properties)arg1, (object)key) -> None :
Remove all of the metadata associated with the property at key key
- C++ signature :
void removeAllMetadata(SireBase::Properties {lvalue},QString)
- remove_link()¶
- removeLink( (Properties)arg1, (object)key) -> None :
Remove the link associated with the key key
- C++ signature :
void removeLink(SireBase::Properties {lvalue},QString)
- remove_metadata()¶
- removeMetadata( (Properties)arg1, (object)metakey) -> None :
Remove the metadata at metakey metakey
- C++ signature :
void removeMetadata(SireBase::Properties {lvalue},QString)
- removeMetadata( (Properties)arg1, (object)key, (object)metakey) -> None :
Remove the metadata at metakey metakey for the property at key key
- C++ signature :
void removeMetadata(SireBase::Properties {lvalue},QString,QString)
- remove_property()¶
- removeProperty( (Properties)arg1, (object)key) -> None :
Remove the property with key key and all of its metadata
- C++ signature :
void removeProperty(SireBase::Properties {lvalue},QString)
- set_metadata()¶
- setMetadata( (Properties)arg1, (object)metakey, (Property)value) -> None :
Set the metadata at metakey metakey to have the value value. This replaces any existing metadata with this metakey
- C++ signature :
void setMetadata(SireBase::Properties {lvalue},QString,SireBase::Property)
- setMetadata( (Properties)arg1, (object)key, (object)metakey, (Property)value) -> None :
Set the metadata at metakey metakey for the property at key key. This replaces any existing metadata for this keymetakey pair
- C++ signature :
void setMetadata(SireBase::Properties {lvalue},QString,QString,SireBase::Property)
- size((Properties)arg1) int : ¶
Return the number of properties in this set
- C++ signature :
int size(SireBase::Properties {lvalue})
- to_string()¶
- toString( (Properties)arg1) -> object :
Return a string representation of this set of properties
- C++ signature :
QString toString(SireBase::Properties {lvalue})
- typename()¶
typeName() -> str :
- C++ signature :
char const* typeName()
- update_property()¶
- updateProperty( (Properties)arg1, (object)key, (Property)value [, (bool)auto_add=True]) -> bool :
- Update the passed property to have the value value. This does
an in-place update on the existing property (which must have a compatible type). If auto-add is true, then this will add the property if it doesnt exist. This returns whether or not a property was updated (or added)
- C++ signature :
bool updateProperty(SireBase::Properties {lvalue},QString,SireBase::Property [,bool=True])
- class sire.base.PropertyMap¶
This is the class that holds the collection of user-supplied optional properties and their locations to functions.
This class allows the following code to be written;
cljff.add( mol, Property::set(charges,chgs) + Property::set(ljs,ljparams) );
The PropertyMapPropertyName classes provide a kwargs like interface for the C++ classes - indeed the python wrappers should allow code to be written like;
cljff.add( mol, {charges : chgs, ljs : ljparams} )
or
cljff.add( mol, charges=charges, ljs=ljparams )
Author: Christopher Woods
- add_prefix()¶
- addPrefix( (PropertyMap)arg1, (object)prefix, (object)properties) -> PropertyMap :
- Add the passed prefix onto all of the passed properties,
returning a new property map that would map from map[key] = X to map[prefixkey] = X
- C++ signature :
SireBase::PropertyMap addPrefix(SireBase::PropertyMap {lvalue},QString,QStringList)
- add_suffix()¶
- addSuffix( (PropertyMap)arg1, (object)suffix, (object)properties) -> PropertyMap :
- Add the passed suffix onto all of the passed properties,
returning a new property map that would map from map[key] = X to map[keysuffix] = X
- C++ signature :
SireBase::PropertyMap addSuffix(SireBase::PropertyMap {lvalue},QString,QStringList)
- assign((PropertyMap)arg1, (PropertyMap)other) PropertyMap : ¶
- C++ signature :
SireBase::PropertyMap {lvalue} assign(SireBase::PropertyMap {lvalue},SireBase::PropertyMap)
- clone((PropertyMap)arg1) PropertyMap : ¶
- C++ signature :
SireBase::PropertyMap clone(SireBase::PropertyMap)
- get_string(key: str)¶
Return the string value associated with the passed ‘key’
This returns ‘key’ if there is no value associated
- is_default()¶
- isDefault( (PropertyMap)arg1) -> bool :
Return whether or not this map is default - if it is, then it doesnt specify any properties
- C++ signature :
bool isDefault(SireBase::PropertyMap {lvalue})
- merge((PropertyMap)arg1, (PropertyMap)other) PropertyMap : ¶
- Return a PropertyMap that is the combination of this and other.
Keys set in other take precedence over keys in this.
- C++ signature :
SireBase::PropertyMap merge(SireBase::PropertyMap {lvalue},SireBase::PropertyMap)
- specified((PropertyMap)arg1, (str)name) bool : ¶
- Return whether or not this map specifies the source or value
of the property called name
- C++ signature :
bool specified(SireBase::PropertyMap {lvalue},char const*)
- specified( (PropertyMap)arg1, (object)name) -> bool :
Return whether or not this map specifies the source or value of the property called name
- C++ signature :
bool specified(SireBase::PropertyMap {lvalue},QString)
- specified( (PropertyMap)arg1, (PropertyName)name) -> bool :
Return whether or not this map specifies the source or value of the property called name
- C++ signature :
bool specified(SireBase::PropertyMap {lvalue},SireBase::PropertyName)
- to_dict()¶
- toDict( (PropertyMap)arg1) -> object :
Return the raw underlying dictionary of the map
- C++ signature :
QHash<QString, SireBase::PropertyName> toDict(SireBase::PropertyMap {lvalue})
- to_string()¶
- toString( (PropertyMap)arg1) -> object :
Return a string representation of this PropertyMap
- C++ signature :
QString toString(SireBase::PropertyMap {lvalue})
- typename()¶
typeName() -> str :
- C++ signature :
char const* typeName()
- unset((PropertyMap)arg1, (object)name) None : ¶
Unset the property called name. This will return it to default
- C++ signature :
void unset(SireBase::PropertyMap {lvalue},QString)
- what((PropertyMap)arg1) str : ¶
- C++ signature :
char const* what(SireBase::PropertyMap {lvalue})
- sire.base.create_map(values, extras=None)[source]¶
Construct a PropertyMap from the passed values. A PropertyMap is a class that lets you either provide extra options to some of the C++ functions, or to map the default keys used to find properties to your own keys
You normally wouldn’t use the class yourself. Instead, objects of this class will be created automatically from dictionaries, e.g.
>>> mol.energy(map={"cutoff": 5*angstrom})
would automatically create a PropertyMap, and is equivalent to writing
>>> mol.energy(map=create_map({"cutoff": 5*angstrom}))
In the above case you are providing an extra “cutoff” option, and are passing the value “5*angstrom”.
You can also use the map to change the keys used to find properties, e.g.
>>> mol.energy(map={"coordinates": "my_coords"})
would map the default “coordinates” property to your “my_coords” property. This means that the coordinates for the energy would be found at “my_coords” rather than “coordinates”.
You can map as many properties, and provide as many extra options as you want.
- sire.base.wrap(value)[source]¶
Wrap the passed value into a
Property
object. This works recursively, wrapping all items in a container, such that the returned value is derived fromProperty
and can be passed to the C++ code in sire. Note that you normally don’t need to call this yourself, as wrapping is handled automatically.