(self, args: argparse.Namespace)
Get arguments that were passed, and also perform basic validation on them.

        For example, make sure the center is an actual lat, lng , and make sure the radius is a
        positive number. Also, if radius is passed, then center must also be passed.

        Raises:
            ParameterError: Center was not a valid lat, lng coordinate, or radius was not positive.
            ParameterError: Line transparency and width values are not valid
Get arguments that were passed, and also perform basic validation on them.
Get arguments that were passed and also perform basic validation on them .
def fetch_args(self, args: argparse.Namespace) -> None:
        """Get arguments that were passed, and also perform basic validation on them.

        For example, make sure the center is an actual lat, lng , and make sure the radius is a
        positive number. Also, if radius is passed, then center must also be passed.

        Raises:
            ParameterError: Center was not a valid lat, lng coordinate, or radius was not positive.
            ParameterError: Line transparency and width values are not valid
        """
        self._center = None
        if args.heatmap_center:
            latlng_str = args.heatmap_center.split(",")
            if len(latlng_str) != 2:
                raise ParameterError(f"Not a valid LAT,LNG pair: {args.heatmap_center}")
            try:
                lat = float(latlng_str[0].strip())
                lng = float(latlng_str[1].strip())
            except ValueError as e:
                raise ParameterError(f"Not a valid LAT,LNG pair: {args.heatmap_center}") from e
            if not -90 <= lat <= 90 or not -180 <= lng <= 180:
                raise ParameterError(f"Not a valid LAT,LNG pair: {args.heatmap_center}")
            self._center = s2sphere.LatLng.from_degrees(lat, lng)
        if args.heatmap_radius:
            if args.heatmap_radius <= 0:
                raise ParameterError(f"Not a valid radius: {args.heatmap_radius} (must be > 0)")
            if not args.heatmap_center:
                raise ParameterError("--heatmap-radius needs --heatmap-center")
            self._radius = args.heatmap_radius
        if args.heatmap_line_width:
            if args.heatmap_line_width.lower() == "automatic":
                self._heatmap_line_width = None
            else:
                trans_width_str = args.heatmap_line_width.split(",")
                if len(trans_width_str) != 6:
                    raise ParameterError(f"Not three valid TRANSPARENCY,WIDTH pairs: {args.heatmap_line_width}")
                try:
                    self._heatmap_line_width = []
                    for value in range(0, 5, 2):
                        transparency = float(trans_width_str[value].strip())
                        width = float(trans_width_str[value + 1].strip())
                        if transparency < 0 or transparency > 1:
                            raise ParameterError(
                                f"Not a valid TRANSPARENCY value (0 < value < 1): {transparency} in "
                                f"{args.heatmap_line_width}"
                            )
                        self._heatmap_line_width.append((transparency, width))
                except ValueError as e:
                    raise ParameterError(f"Not three valid TRANSPARENCY,WIDTH pairs: {args.heatmap_line_width}") from e
def fetch_args ( self , args : argparse . Namespace ) -> None : self . _center = None if args . heatmap_center : latlng_str = args . heatmap_center . split ( "," ) if len ( latlng_str ) != 2 : raise ParameterError ( f"Not a valid LAT,LNG pair: {args.heatmap_center}" ) try : lat = float ( latlng_str [ 0 ] . strip ( ) ) lng = float ( latlng_str [ 1 ] . strip ( ) ) except ValueError as e : raise ParameterError ( f"Not a valid LAT,LNG pair: {args.heatmap_center}" ) from e if not - 90 <= lat <= 90 or not - 180 <= lng <= 180 : raise ParameterError ( f"Not a valid LAT,LNG pair: {args.heatmap_center}" ) self . _center = s2sphere . LatLng . from_degrees ( lat , lng ) if args . heatmap_radius : if args . heatmap_radius <= 0 : raise ParameterError ( f"Not a valid radius: {args.heatmap_radius} (must be > 0)" ) if not args . heatmap_center : raise ParameterError ( "--heatmap-radius needs --heatmap-center" ) self . _radius = args . heatmap_radius if args . heatmap_line_width : if args . heatmap_line_width . lower ( ) == "automatic" : self . _heatmap_line_width = None else : trans_width_str = args . heatmap_line_width . split ( "," ) if len ( trans_width_str ) != 6 : raise ParameterError ( f"Not three valid TRANSPARENCY,WIDTH pairs: {args.heatmap_line_width}" ) try : self . _heatmap_line_width = [ ] for value in range ( 0 , 5 , 2 ) : transparency = float ( trans_width_str [ value ] . strip ( ) ) width = float ( trans_width_str [ value + 1 ] . strip ( ) ) if transparency < 0 or transparency > 1 : raise ParameterError ( f"Not a valid TRANSPARENCY value (0 < value < 1): {transparency} in " f"{args.heatmap_line_width}" ) self . _heatmap_line_width . append ( ( transparency , width ) ) except ValueError as e : raise ParameterError ( f"Not three valid TRANSPARENCY,WIDTH pairs: {args.heatmap_line_width}" ) from e