Example #1
0
    def test_base_definition(self):
        """test definition"""

        node = ReprojectedSource(source=self.source, reprojected_coordinates=self.reprojected_coordinates)
        d = node.base_definition
        c = Coordinates.from_definition(d['attrs']['reprojected_coordinates'])
        
        assert c == self.reprojected_coordinates
Example #2
0
    def _first_init(self, **kwargs):
        # If the coordinates were supplied explicitly, they may need to be deserialized.
        if isinstance(kwargs.get("coordinates"), OrderedDict):
            kwargs["coordinates"] = Coordinates.from_definition(
                kwargs["coordinates"])
        elif isinstance(kwargs.get("coordinates"), string_types):
            kwargs["coordinates"] = Coordinates.from_json(
                kwargs["coordinates"])

        return kwargs
Example #3
0
    def _first_init(self, **kwargs):
        if 'reprojected_coordinates' in kwargs:
            if isinstance(kwargs['reprojected_coordinates'], list):
                kwargs[
                    'reprojected_coordinates'] = Coordinates.from_definition(
                        kwargs['reprojected_coordinates'])
            elif isinstance(kwargs['reprojected_coordinates'], str):
                kwargs['reprojected_coordinates'] = Coordinates.from_json(
                    kwargs['reprojected_coordinates'])

        return kwargs
Example #4
0
    def _first_init(self, **kwargs):
        if "reprojected_coordinates" in kwargs:
            if isinstance(kwargs["reprojected_coordinates"], dict):
                kwargs[
                    "reprojected_coordinates"] = Coordinates.from_definition(
                        kwargs["reprojected_coordinates"])
            elif isinstance(kwargs["reprojected_coordinates"], string_types):
                kwargs["reprojected_coordinates"] = Coordinates.from_json(
                    kwargs["reprojected_coordinates"])

        return super(ReprojectedSource, self)._first_init(**kwargs)
Example #5
0
    def _first_init(self, **kwargs):
        warnings.warn(
            "ReprojectedSource has been replaced by the Reproject algorithm node "
            "and will be removed in a future version of podpac.",
            DeprecationWarning,
        )

        if "reprojected_coordinates" in kwargs:
            if isinstance(kwargs["reprojected_coordinates"], dict):
                kwargs[
                    "reprojected_coordinates"] = Coordinates.from_definition(
                        kwargs["reprojected_coordinates"])
            elif isinstance(kwargs["reprojected_coordinates"], string_types):
                kwargs["reprojected_coordinates"] = Coordinates.from_json(
                    kwargs["reprojected_coordinates"])

        return super(ReprojectedSource, self)._first_init(**kwargs)