removed rtype and param typing from doc strings to help avoid maintaining duplicate information provided by type hints
This commit is contained in:
parent
9d89877b20
commit
f4ddf310a8
32 changed files with 1091 additions and 1357 deletions
|
@ -68,7 +68,7 @@ class EmaneCommEffectModel(emanemodel.EmaneModel):
|
|||
that file also. Otherwise the WLAN-wide
|
||||
nXXemane_commeffectnem.xml, nXXemane_commeffectshim.xml are used.
|
||||
|
||||
:param dict config: emane model configuration for the node and interface
|
||||
:param config: emane model configuration for the node and interface
|
||||
:param interface: interface for the emane node
|
||||
:return: nothing
|
||||
"""
|
||||
|
|
|
@ -69,7 +69,7 @@ class EmaneManager(ModelManager):
|
|||
"""
|
||||
Creates a Emane instance.
|
||||
|
||||
:param core.session.Session session: session this manager is tied to
|
||||
:param session: session this manager is tied to
|
||||
:return: nothing
|
||||
"""
|
||||
super().__init__()
|
||||
|
@ -100,12 +100,11 @@ class EmaneManager(ModelManager):
|
|||
"""
|
||||
Retrieve interface configuration or node configuration if not provided.
|
||||
|
||||
:param int node_id: node id
|
||||
:param node_id: node id
|
||||
:param interface: node interface
|
||||
:param str model_name: model to get configuration for
|
||||
:param model_name: model to get configuration for
|
||||
:return: node/interface model configuration
|
||||
:rtype: dict
|
||||
"""
|
||||
"""
|
||||
# use the network-wide config values or interface(NEM)-specific values?
|
||||
if interface is None:
|
||||
return self.get_configs(node_id=node_id, config_type=model_name)
|
||||
|
@ -231,7 +230,7 @@ class EmaneManager(ModelManager):
|
|||
"""
|
||||
Add EMANE network object to this manager.
|
||||
|
||||
:param core.emane.nodes.EmaneNet emane_net: emane node to add
|
||||
:param emane_net: emane node to add
|
||||
:return: nothing
|
||||
"""
|
||||
with self._emane_node_lock:
|
||||
|
@ -259,8 +258,7 @@ class EmaneManager(ModelManager):
|
|||
|
||||
:return: SUCCESS, NOT_NEEDED, NOT_READY in order to delay session
|
||||
instantiation
|
||||
:rtype: int
|
||||
"""
|
||||
"""
|
||||
logging.debug("emane setup")
|
||||
|
||||
# TODO: drive this from the session object
|
||||
|
@ -318,8 +316,7 @@ class EmaneManager(ModelManager):
|
|||
|
||||
:return: SUCCESS, NOT_NEEDED, NOT_READY in order to delay session
|
||||
instantiation
|
||||
:rtype: int
|
||||
"""
|
||||
"""
|
||||
self.reset()
|
||||
r = self.setup()
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ def _type_value(config_type: str) -> ConfigDataTypes:
|
|||
"""
|
||||
Convert emane configuration type to core configuration value.
|
||||
|
||||
:param str config_type: emane configuration type
|
||||
:param config_type: emane configuration type
|
||||
:return: core config type
|
||||
"""
|
||||
config_type = config_type.upper()
|
||||
|
@ -33,11 +33,10 @@ def _get_possible(config_type: str, config_regex: str) -> List[str]:
|
|||
"""
|
||||
Retrieve possible config value options based on emane regexes.
|
||||
|
||||
:param str config_type: emane configuration type
|
||||
:param str config_regex: emane configuration regex
|
||||
:param config_type: emane configuration type
|
||||
:param config_regex: emane configuration regex
|
||||
:return: a string listing comma delimited values, if needed, empty string otherwise
|
||||
:rtype: list
|
||||
"""
|
||||
"""
|
||||
if config_type == "bool":
|
||||
return ["On", "Off"]
|
||||
|
||||
|
@ -52,11 +51,10 @@ def _get_default(config_type_name: str, config_value: List[str]) -> str:
|
|||
"""
|
||||
Convert default configuration values to one used by core.
|
||||
|
||||
:param str config_type_name: emane configuration type name
|
||||
:param list config_value: emane configuration value list
|
||||
:param config_type_name: emane configuration type name
|
||||
:param config_value: emane configuration value list
|
||||
:return: default core config value
|
||||
:rtype: str
|
||||
"""
|
||||
"""
|
||||
|
||||
config_default = ""
|
||||
|
||||
|
@ -77,11 +75,10 @@ def parse(manifest_path: str, defaults: Dict[str, str]) -> List[Configuration]:
|
|||
"""
|
||||
Parses a valid emane manifest file and converts the provided configuration values into ones used by core.
|
||||
|
||||
:param str manifest_path: absolute manifest file path
|
||||
:param dict defaults: used to override default values for configurations
|
||||
:param manifest_path: absolute manifest file path
|
||||
:param defaults: used to override default values for configurations
|
||||
:return: list of core configuration values
|
||||
:rtype: list
|
||||
"""
|
||||
"""
|
||||
|
||||
# no results when emane bindings are not present
|
||||
if not manifest:
|
||||
|
|
|
@ -52,7 +52,7 @@ class EmaneModel(WirelessModel):
|
|||
Called after being loaded within the EmaneManager. Provides configured emane_prefix for
|
||||
parsing xml files.
|
||||
|
||||
:param str emane_prefix: configured emane prefix path
|
||||
:param emane_prefix: configured emane prefix path
|
||||
:return: nothing
|
||||
"""
|
||||
manifest_path = "share/emane/manifest"
|
||||
|
@ -70,8 +70,7 @@ class EmaneModel(WirelessModel):
|
|||
Returns the combination all all configurations (mac, phy, and external).
|
||||
|
||||
:return: all configurations
|
||||
:rtype: list[Configuration]
|
||||
"""
|
||||
"""
|
||||
return cls.mac_config + cls.phy_config + cls.external_config
|
||||
|
||||
@classmethod
|
||||
|
@ -80,8 +79,7 @@ class EmaneModel(WirelessModel):
|
|||
Returns the defined configuration groups.
|
||||
|
||||
:return: list of configuration groups.
|
||||
:rtype: list[ConfigGroup]
|
||||
"""
|
||||
"""
|
||||
mac_len = len(cls.mac_config)
|
||||
phy_len = len(cls.phy_config) + mac_len
|
||||
config_len = len(cls.configurations())
|
||||
|
@ -98,7 +96,7 @@ class EmaneModel(WirelessModel):
|
|||
Builds xml files for this emane model. Creates a nem.xml file that points to
|
||||
both mac.xml and phy.xml definitions.
|
||||
|
||||
:param dict config: emane model configuration for the node and interface
|
||||
:param config: emane model configuration for the node and interface
|
||||
:param interface: interface for the emane node
|
||||
:return: nothing
|
||||
"""
|
||||
|
@ -145,8 +143,8 @@ class EmaneModel(WirelessModel):
|
|||
emane location events to be generated for the nodes in the moved
|
||||
list, making EmaneModels compatible with Ns2ScriptedMobility.
|
||||
|
||||
:param bool moved: were nodes moved
|
||||
:param list moved_netifs: interfaces that were moved
|
||||
:param moved: were nodes moved
|
||||
:param moved_netifs: interfaces that were moved
|
||||
:return: nothing
|
||||
"""
|
||||
try:
|
||||
|
@ -168,13 +166,13 @@ class EmaneModel(WirelessModel):
|
|||
"""
|
||||
Invoked when a Link Message is received. Default is unimplemented.
|
||||
|
||||
:param core.nodes.interface.Veth netif: interface one
|
||||
:param netif: interface one
|
||||
:param bw: bandwidth to set to
|
||||
:param delay: packet delay to set to
|
||||
:param loss: packet loss to set to
|
||||
:param duplicate: duplicate percentage to set to
|
||||
:param jitter: jitter to set to
|
||||
:param core.netns.vif.Veth netif2: interface two
|
||||
:param netif2: interface two
|
||||
:return: nothing
|
||||
"""
|
||||
logging.warning(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue