DynamicMetaNetwork

class DynamicMetaNetwork.DynamicMetaNetwork(network_format='dict')[source]

The DynamicMetaNetwork class is a container for dynamic meta-networks extracted from DyNetML. It bundles together a set of Meta-Networks collected at different times.

Variables:
  • __network_format – the format in which the networks should be stored:”dict”, “igraph” or “networkx”. It cannot be changed after initialization.
  • attributes – A dictionary of attributes associated with the dynamic network
  • metanetworks – The list of the Meta-Networks associated with the dynamic meta-network.
convert_to_dynetml()[source]

Return the dynamic meta-network as an lxml._Element

drop_metanetworks_after(end_date)[source]
Parameters:end_date (datetime.datetime) – Drop meta-networks that occur after this datetime.
drop_metanetworks_before(start_date)[source]
Parameters:start_date (datetime.datetime) – Drop meta-networks that occur before this datetime.
drop_metanetworks_for_ranges(range_tuples, keep_in_range=True)[source]
Parameters:
  • range_tuples (list) – A list of tuples containing of a start date and end date pair
  • keep_in_range (list) – If true, dates outside of any tuple are dropped. If false, dates within any tuple are dropped.
get_network_format()[source]

Returns the network format

load_from_dynetml(dmn_text, properties_to_include=None, properties_to_ignore=None, nodeclasses_to_include=None, nodeclasses_to_ignore=None, networks_to_include=None, networks_to_ignore=None, start_date=None, end_date=None)[source]

Parses and loads the contents of an XML containing a dynamic meta-network. If no properties, nodeclasses, or networks are specified to be included, all of them will be included. Lists of included and ignored elements are exclusive - only specify a set to include or a set to ignore for each category.

Parameters:
  • dmn_text (str|unicode) – XML containing a dynamic meta-network
  • properties_to_include (list) – a list of nodeclass properties that should be included
  • properties_to_ignore (list) – a list of nodeclass properties that should be ignored
  • nodeclasses_to_include (list) – a list of nodeclasses that should be included
  • nodeclasses_to_ignore (list) – a list of nodeclasses that should be ignored
  • networks_to_include (list) – a list of networks that should be included
  • networks_to_ignore (list) – a list of networks that should be ignored
  • start_date (datetime.datetime) – Meta-Networks from before this datetime should not be imported
  • end_date (datetime.datetime) – MetaNetworks from after this datetime should not be imported
load_from_tag(dmn_tag, properties_to_include=None, properties_to_ignore=None, nodeclasses_to_include=None, nodeclasses_to_ignore=None, networks_to_include=None, networks_to_ignore=None, start_date=None, end_date=None)[source]

Parses and loads the contents of an lxml._Element containing a dynamic meta-network. If no properties, nodeclasses, or networks are specified to be included, all of them will be included. Lists of included and ignored elements are exclusive - only specify a set to include or a set to ignore for each category.

Parameters:
  • dmn_tag (lxml._Element) – A tag containing a dynamic meta-network
  • properties_to_include (list) – a list of nodeclass properties that should be included
  • properties_to_ignore (list) – a list of nodeclass properties that should be ignored
  • nodeclasses_to_include (list) – a list of nodeclasses that should be included
  • nodeclasses_to_ignore (list) – a list of nodeclasses that should be ignored
  • networks_to_include (list) – a list of networks that should be included
  • networks_to_ignore (list) – a list of networks that should be ignored
  • start_date (datetime.datetime) – MetaNetworks from before this datetime should not be imported
  • end_date (datetime.datetime) – MetaNetworks from after this datetime should not be imported
pretty_print()[source]

Pretty-print the dynamic meta-network

write_dynetml(out_file_path)[source]
Parameters:out_file_path (str|unicode) – Write the dynamic meta-network to this path.

Previous topic

Import DyNetML into Python, NetworkX, and igraph

Next topic

MetaNetwork