@@ -508,9 +508,8 @@ def parse_complex(value, name, instance):
508508 value : ElementTree.Element|None|complex|dict
509509 The ElementTree.Element entity that you want to get the value from.
510510 None returns None.
511- Float returns a float.
512- A string value will return the float value for the string if it can be
513- converted to a float.
511+ complex returns a complex.
512+ dict is a dictionary representation of a complex number.
514513 name : str
515514 Name of the field to return the value of. This is only used in the
516515 raised error message
@@ -520,7 +519,7 @@ def parse_complex(value, name, instance):
520519 Returns
521520 -------
522521 None | bool
523- Returns None if value passed is None. Returns the float value
522+ Returns None if value passed is None. Returns the complex value
524523 of a node when passed an ElementTree.Element
525524
526525 Raises
@@ -574,6 +573,36 @@ def parse_complex(value, name, instance):
574573
575574
576575def parse_datetime (value , name , instance , units = 'us' ):
576+ """
577+ The parse_datetime function is a helper function specifically for parsing
578+ datetime values within XML elements in sarpy.io.xml.base.
579+ The function is not intended for public use. This function is recursive.
580+
581+ Parameters
582+ ----------
583+ value : ElementTree.Element|None|datetime|dict
584+ The ElementTree.Element entity that you want to get the value from.
585+ None returns None.
586+ datetime returns a datetime.
587+ A string value will return the datetime value for the string if it can be
588+ converted to a datetime.
589+ name : str
590+ Name of the field to return the value of. This is only used in the
591+ raised error message
592+ instance :
593+ The class of the variable. This is only used in the raised error message.
594+
595+ Returns
596+ -------
597+ None | bool
598+ Returns None if value passed is None. Returns the float value
599+ of a node when passed an ElementTree.Element
600+
601+ Raises
602+ -------
603+ TypeError
604+ When passed a value with a type other than the expected input types.
605+ """
577606 if value is None :
578607 return None
579608 if isinstance (value , numpy .datetime64 ):
0 commit comments