Пример #1
0
    def count(self,
              after_time=None,
              before_time=None,
              epsg_code=None,
              meta_string=None,
              shapegrid_id=None):
        """Counts gridsets matching the provided criteria.

        Args:
            after_time (str): Count gridsets modified after this time.
            before_time (str): Count gridsets modified before this time.
            epsg_code (int): The integer representing the map projection EPSG code for
                the gridsets to count.
            meta_string (str): Metadata string to use to count gridsets.
            shapegrid_id (int): Count gridsets built from the shapegrid with this
                identifier.

        Returns:
            int: The number of gridsets matching the provided criteria.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 meta_string=meta_string,
                                 shapegrid_id=shapegrid_id,
                                 before_time=before_time,
                                 epsg_code=epsg_code)
Пример #2
0
    def count(self,
              after_time=None,
              before_time=None,
              cell_sides=None,
              cell_size=None,
              epsg_code=None):
        """Counts shapegrids matching the provided criteria.

        Args:
            after_time (:obj:`str`, optional): Count shapegrids modified after
                this time (in ISO-8601 format).
            before_time (:obj:`str`, optional): Count shapegrids modified
                before this time (in ISO-8601 format).
            cell_sides (:obj:`int`, optional): Count shapegrids that have cells
                with the specified number of sides
                (4 - rectangles, 6 - hexagons).
            cell_size (:obj:`float`, optional): Count shapegrids with the
                specified cell size (resolution).
            epsg_code (:obj:`int`, optional): Count shapegrids that were
                created using the specified spatial projection represented by
                the EPSG code.

        Returns:
            int: The number of shapegrids matching the provided criteria.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 before_time=before_time,
                                 cell_sides=cell_sides,
                                 cell_size=cell_size,
                                 epsg_code=epsg_code)
Пример #3
0
    def count(self,
              after_time=None,
              alt_pred_code=None,
              before_time=None,
              date_code=None,
              epsg_code=None,
              gcm_code=None):
        """Counts scenarios matching the provided criteria.

        Args:
            after_time (str): Count scenarios modified after this time.
            alt_pred_code (str): Count scenarios containing this alternate prediction
                code.
            before_time (str): Count scenarios modified before this time.
            date_code (str): Count scenarios with this date code.
            epsg_code (int): Count scenarios using this map projection EPSG code.
            gcm_code (str): Count scenario using this GCM code.

        Returns:
            int: The number of scenarios matching the criteria.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 alt_pred_code=alt_pred_code,
                                 before_time=before_time,
                                 date_code=date_code,
                                 epsg_code=epsg_code,
                                 gcm_code=gcm_code)
Пример #4
0
    def count(self,
              after_time=None,
              before_time=None,
              epsg_code=None,
              squid=None):
        """Counts layers matching the specified criteria.

        Args:
            after_time (:obj:`str`, optional): Matching layers are modified
                after this time specified in ISO-8601 format.
            before_time (:obj:`str`, optional): Matching layers are modified
                before this time specified in ISO-8601 format.
            epsg_code (:obj:`int`, optional): Matching layers will have the map
                projection specified by this EPSG code.
            squid (:obj:`str`, optional): Matching layers will have this hash-
                based species identifier.

        Returns:
            int: The number of matching layers.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 before_time=before_time,
                                 epsg_code=epsg_code,
                                 squid=squid)
Пример #5
0
    def count(self,
              after_status=None,
              after_time=None,
              algorithm_code=None,
              before_status=None,
              before_time=None,
              display_name=None,
              epsg_code=None,
              model_scenario_code=None,
              occurrence_set_id=None,
              projection_scenario_code=None,
              scenario_id=None,
              status=None,
              gridset_id=None):
        """Counts projections matching the provided criteria.

        Args:
            after_status (int): Count projections with a status greater than this.
            after_time (str): Count projections modified after this time.
            algorithm_code (str): Count projections built with this algorithm.
            before_status (int): Count projections with a status less than this.
            before_time (str): Count projections modified before this time.
            display_name (str): Count projections with this display name.
            epsg_code (int): Count projections using this map projection.
            model_scenario_code (str): Count projections built from this model.
            occurrence_set_id (int): Count projections built from this occurrence set.
            projection_scenario_code (str): Count projections using this scenario.
            scenario_id (int): Count projections using this scenario identifier.
            status (int): Count projections with this exact status.
            gridset_id (int): Count projections in this gridset.

        Returns:
            int: The number of projections matching the criteria.
        """
        return RestService.count(
            self,
            '{}/count'.format(self.end_point),
            after_status=after_status,
            after_time=after_time,
            algorithm_code=algorithm_code,
            before_status=before_status,
            before_time=before_time,
            display_name=display_name,
            epsg_code=epsg_code,
            model_scenario_code=model_scenario_code,
            occurrence_set_id=occurrence_set_id,
            projection_scenario_code=projection_scenario_code,
            scenario_id=scenario_id,
            status=status,
            gridset_id=gridset_id)
Пример #6
0
    def count(self, after_status=None, after_time=None, before_status=None,
              before_time=None, display_name=None, epsg_code=None,
              gridset_id=None, minimum_number_of_points=None, squid=None,
              status=None, user=None):
        """Counts the number of occurrence sets matching the provided criteria.

        Args:
            after_status (:obj:`int`, optional): Only return occurrence sets
                that have a status value greater than this number.
            after_time (:obj:`str`, optional): Only return occurrence sets
                modified after this time (in ISO-8601 format).
            before_status (:obj:`int`, optional): Only return occurrence sets
                that have a status value less than this number.
            before_time (:obj:`str`, optional): Only return occurrence sets
                modified before this time (in ISO-8601 format).
            display_name (:obj:`str`, optional): Only return occurrence sets
                that have this display name.
            epsg_code (:obj:`int`, optional): Only return occurrence sets that
                have this EPSG code.
            gridset_id (:obj:`int`, optional): Only return occurrence sets that
                are part of the gridset with this ID.
            minimum_number_of_points (:obj:`int`, optional): Only return
                occurrence sets that have at least this many points.
            squid (:obj:`str`, optional): Only return occurrence sets that have
                this squid (hash value for species identifier).
            status (:obj:`int`, optional): Only return occurrence sets that
                have this status.
            user (:obj:`str`, optional): If 'public', return public occurrence
                sets.  If 'anon', return anonymous occurrence sets.  If None,
                return the user's occurrence sets.

        Returns:
            int: The number of matching occurrence set records.
        """
        return RestService.count(
            self,
            '{}/count'.format(self.end_point),
            after_status=after_status,
            after_time=after_time,
            before_status=before_status,
            before_time=before_time,
            display_name=display_name,
            epsg_code=epsg_code,
            gridset_id=gridset_id,
            minimum_number_of_points=minimum_number_of_points,
            squid=squid,
            status=status,
            user=user
        )
Пример #7
0
    def count(self, after_time=None, before_time=None, scenario_id=None):
        """Counts scenario packages matching the criteria.

        Args:
            after_time (str): Count scenario packages modified after this time.
            before_time (str): Count scenario packages modified before this time.
            scenario_id (int): Count scenario packages containing this scenario.

        Returns:
            int: The number of matching scenario packages.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 before_time=before_time,
                                 scenario_id=scenario_id)
Пример #8
0
    def count(self,
              after_time=None,
              alt_pred_code=None,
              before_time=None,
              date_code=None,
              epsg_code=None,
              env_code=None,
              env_type_id=None,
              gcm_code=None,
              scenario_id=None):
        """Counts environmental layers matching the specified criteria.

        Args:
            after_time (:obj:`str`, optional): Matching environmental layers
                are modified after this time specified in ISO-8601 format.
            alt_pred_code (:obj:`str`, optional): Matching environmental layers
                must have this alternate prediction code.
            before_time (:obj:`str`, optional): Matching environmental layers
                are modified before this time specified in ISO-8601 format.
            date_code (:obj:`str`, optional): Matching environmental layers
                will have this date code.
            epsg_code (:obj:`int`, optional): Matching environmental layers
                will have the map projection specified by this EPSG code.
            env_code (:obj:`str`, optional): Matching environmental layers
                will have this environment code.
            env_type_id (:obj:`str`, optional): Matching environmental layers
                will have this environmental layer type identifier.
            gcm_code (:obj:`str`, optional): Matching environmental layers
                will have this GCM code.
            scenario_id (:obj:`int`, optional): Matching environmental layers
                will belong to the Lifemapper scenario specified by this
                identifier.

        Returns:
            int - The number of matching environmental layers.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 alt_pred_code=alt_pred_code,
                                 before_time=before_time,
                                 date_code=date_code,
                                 epsg_code=epsg_code,
                                 env_code=env_code,
                                 env_type_id=env_type_id,
                                 gcm_code=gcm_code,
                                 scenario_id=scenario_id)
Пример #9
0
    def count(self,
              after_time=None,
              before_time=None,
              has_branch_lengths=None,
              is_binary=None,
              is_ultrametric=None,
              meta_string=None,
              name=None,
              user=None):
        """Counts the number of trees matching the provided criteria.

        Args:
            after_time (:obj:`str`, optional): Only trees modified after this
                time (in ISO-8601 format).
            before_time (:obj:`str`, optional): Only return trees modified
                before this time (in ISO-8601 format).
            has_branch_lengths (:obj:`bool`, optional): Return trees that have
                or do not have branch lengths.
            is_binary (:obj:`bool`, optional): Return trees that are or are not
                binary.
            is_ultrametric (:obj:`bool`, optional): Return trees that are or
                are not ultrametric.
            meta_string (:obj:`str`, optional): Return trees with this metadata
                string attached to them.
            name (:obj:`str`, optional): Return trees that have this name.
            user (:obj:`str`, optional): If 'public', return public trees.  If
                'anon', return anonymous trees.  If None, return the user's
                trees.

        Returns:
            int: The number of matching trees.
        """
        return RestService.count(self,
                                 '{}/count'.format(self.end_point),
                                 after_time=after_time,
                                 before_time=before_time,
                                 has_branch_lengths=has_branch_lengths,
                                 is_binary=is_binary,
                                 is_ultrametric=is_ultrametric,
                                 meta_string=meta_string,
                                 name=name,
                                 user=user)