• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python report.Report类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vizgrimoire.report.Report的典型用法代码示例。如果您正苦于以下问题:Python Report类的具体用法?Python Report怎么用?Python Report使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Report类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_filter_items

    def get_filter_items(filter_, startdate, enddate, identities_db):
        items = None
        filter_name = filter_.get_name()

        if (filter_name == "repository"):
            metric = DataSource.get_metrics("repositories", SCR)
        elif (filter_name == "company"):
            metric = DataSource.get_metrics("organizations", SCR)
        elif (filter_name == "country"):
            metric = DataSource.get_metrics("countries", SCR)
        elif (filter_name == "domain"):
            metric = DataSource.get_metrics("domains", SCR)
        elif (filter_name == "project"):
            metric = DataSource.get_metrics("projects", SCR)
        elif (filter_name == "people2"):
            metric = DataSource.get_metrics("people2", SCR)
        else:
            logging.error("SCR " + filter_name + " not supported")
            return items

        # workaround due to bug https://phabricator.wikimedia.org/T116484
        from vizgrimoire.report import Report
        automator = Report.get_config()
        DS = SCR
        if DS.get_name()+"_start_date" in Report.get_config()['r']:
            metric.filters.startdate = "'"+Report.get_config()['r'][DS.get_name()+"_start_date"]+"'"
        if DS.get_name()+"_end_date" in Report.get_config()['r']:
            metric.filters.enddate = "'"+Report.get_config()['r'][DS.get_name()+"_end_date"]+"'"
        # end

        items = metric.get_list()
        return items
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:32,代码来源:SCR.py


示例2: ages_study_com

    def ages_study_com (ds, items, period,
                        startdate, enddate, destdir):
        """Perform ages study for companies, if it is specified in Report.

        Produces JSON files for those studies.

        Parameters
        ----------

        ds: { SCM | ITS | MLS }
           Data source
        items: ??
           Items
        period: ??
           Period
        startdate: ??
           Start date
        enddate: ??
           End date
        destdir: string
           Directory for writing the JSON files
        """

        from vizgrimoire.report import Report
        filter_name = "company"
        studies = Report.get_studies()
        ages = None
        for study in studies:
            if study.id == "ages":
                ages = study

        if ages is not None:
            # Get config parameters for producing a connection
            # to the database
            config = Report.get_config()
            db_identities = config['generic']['db_identities']
            dbuser = config['generic']['db_user']
            dbpass = config['generic']['db_password']

            start_string = ds.get_name() + "_start_date"
            end_string = ds.get_name() + "_end_date"
            if start_string in config['r']:
                startdate = "'" + config['r'][start_string] + "'"
            if end_string in config['r']:
                enddate = "'" + config['r'][end_string] + "'"
            ds_dbname = ds.get_db_name()
            dbname = config['generic'][ds_dbname]
            dsquery = ds.get_query_builder()
            dbcon = dsquery(dbuser, dbpass, dbname, db_identities)

            for item in items :
                filter_item = Filter(filter_name, item)
                metric_filters = MetricFilters(
                    period, startdate, enddate,
                    filter_item.get_type_analysis()
                    )
                obj = ages(dbcon, metric_filters)
                res = obj.create_report(ds, destdir)
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:58,代码来源:data_source.py


示例3: get_filter_bots

    def get_filter_bots(filter_):
        from vizgrimoire.report import Report
        bots = []

        # If not using Report (automator) bots are not supported.
        if Report.get_config() == None:
            return bots

        if filter_.get_name_plural()+'_out' in Report.get_config()['r']:
            fbots = Report.get_config()['r'][filter_.get_name_plural()+'_out']
            bots = fbots.split(",")
            logging.info("BOTS for " + filter_.get_name_plural())
            logging.info(bots)
        return bots
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:14,代码来源:data_source.py


示例4: create_filter_report_top

    def create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = EventsDS.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        fn = os.path.join(destdir, filter_.get_filename(EventsDS()))
        createJSON(items, fn)

        for item in items :
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_name, item)

            if filter_name in ("repository"):
                logging.warn("Filter 'repository' detected for top info")
                top_authors = EventsDS.get_top_data(startdate, enddate, identities_db, filter_item, npeople)
                logging.warn(filter_item.get_top_filename(EventsDS())) 
                fn = os.path.join(destdir, filter_item.get_top_filename(EventsDS()))
                createJSON(top_authors, fn)
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:27,代码来源:EventsDS.py


示例5: create_filter_report_top

    def create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = SCR.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        fn = os.path.join(destdir, filter_.get_filename(SCR()))
        createJSON(items, fn)

        for item in items :
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_name, item)

            if filter_name in ("company","project","repository"):
                top_mergers = SCR.get_top_data(startdate, enddate, identities_db, filter_item, npeople)
                fn = os.path.join(destdir, filter_item.get_top_filename(SCR()))
                createJSON(top_mergers, fn)
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:25,代码来源:SCR.py


示例6: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items =  QAForums.get_filter_items(filter_, startdate, enddate, identities_db)
            if items == None:
                return
            items = items['name']
  
        filter_name = filter_.get_name()

        if not isinstance(items, list):
            items = [items]

        file_items = []
        for item in items:
            if re.compile("^\..*").match(item) is not None: item = "_"+item
            file_items.append(item)

        fn = os.path.join(destdir, filter_.get_filename(QAForums()))
        createJSON(file_items, fn)
        for item in items:
            logging.info(item)
            filter_item = Filter(filter_.get_name(), item)

            evol_data = QAForums.get_evolutionary_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(QAForums()))
            createJSON(completePeriodIds(evol_data, period, startdate, enddate), fn)

            agg = QAForums.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(QAForums()))
            createJSON(agg, fn)
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:32,代码来源:QAForums.py


示例7: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = MLS.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        items_files = [item.replace('/', '_').replace("<","__").replace(">","___")
            for item in items]

        fn = os.path.join(destdir, filter_.get_filename(MLS()))
        createJSON(items_files, fn)

        if filter_name in ("domain", "company", "repository"):
            items_list = {'name' : [], 'sent_365' : [], 'senders_365' : []}
        else:
            items_list = items

        for item in items :
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_.get_name(), item)

            evol_data = MLS.get_evolutionary_data(period, startdate, enddate, 
                                                  identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(MLS()))
            createJSON(evol_data, fn)

            agg = MLS.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(MLS()))
            createJSON(agg, fn)

            if filter_name in ("domain", "company", "repository"):
                items_list['name'].append(item.replace('/', '_').replace("<","__").replace(">","___"))
                items_list['sent_365'].append(agg['sent_365'])
                items_list['senders_365'].append(agg['senders_365'])

            top_senders = MLS.get_top_data(startdate, enddate, identities_db, filter_item, npeople, False)
            createJSON(top_senders, destdir+"/"+filter_item.get_top_filename(MLS()))

        fn = os.path.join(destdir, filter_.get_filename(MLS()))
        createJSON(items_list, fn)

        if (filter_name == "company"):
            ds = MLS
            if False:
                summary = MLS.get_filter_summary(
                    filter_, period, startdate, enddate,
                    identities_db, 10, self.db.projects_db
                    )
                createJSON (summary,
                            destdir + "/" + filter_.get_summary_filename(MLS))
            # Perform ages study, if it is specified in Report
            MLS.ages_study_com (items, period, startdate, enddate, destdir)
开发者ID:jsmanrique,项目名称:GrimoireLib,代码行数:60,代码来源:MLS.py


示例8: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = IRC.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return

        if not isinstance(items, (list)):
            items = [items]

        fn = os.path.join(destdir, filter_.get_filename(IRC()))
        createJSON(items, fn)

        for item in items :
            # item_name = "'"+ item+ "'"
            logging.info (item)

            filter_item = Filter(filter_.get_name(), item)

            evol_data = IRC.get_evolutionary_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(IRC()))
            createJSON(completePeriodIds(evol_data, period, startdate, enddate), fn)

            agg = IRC.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(IRC()))
            createJSON(agg, fn)
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:26,代码来源:IRC.py


示例9: create_filter_report

    def create_filter_report(cls, filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = cls.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        fn = os.path.join(destdir, filter_.get_filename(cls()))
        createJSON(items, fn)

        if filter_name in ("domain", "company", "repository"):
            items_list = {'name' : [], 'closed_365' : [], 'closers_365' : []}
        else:
            items_list = items

        for item in items :
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_name, item)

            evol_data = cls.get_evolutionary_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(cls()))
            createJSON(evol_data, fn)

            agg = cls.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(cls()))
            createJSON(agg, fn)

            if filter_name in ["domain", "company", "repository"]:
                items_list['name'].append(item.replace('/', '_'))
                items_list['closed_365'].append(agg['closed_365'])
                items_list['closers_365'].append(agg['closers_365'])

            if filter_name in ["company","domain","repository"]:
                top = cls.get_top_data(startdate, enddate, identities_db, filter_item, npeople)
                fn = os.path.join(destdir, filter_item.get_top_filename(cls()))
                createJSON(top, fn)

        fn = os.path.join(destdir, filter_.get_filename(cls()))
        createJSON(items_list, fn)

        if (filter_name == "company"):
            ds = ITS
            summary = cls.get_filter_summary(
                filter_, period, startdate, enddate,
                identities_db, 10
                )
            createJSON (summary,
                        destdir + "/" + filter_.get_summary_filename(cls))

            # Perform ages study, if it is specified in Report
            cls.ages_study_com (items, period, startdate, enddate, destdir)
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:58,代码来源:ITS.py


示例10: get_its_from_organizations

    def get_its_from_organizations(self):
        automator = Report.get_config()
        identities_db = automator['generic']['db_identities']

        from_ = """
            FROM issues i
              JOIN people_uidentities pup ON i.submitted_by = pup.people_id 
              JOIN %s.enrollments enr ON enr.uuid = pup.uuid 
              JOIN %s.organizations org ON org.id = enr.organization_id 
        """ % (identities_db, identities_db)
        return from_
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:11,代码来源:companies_activity.py


示例11: get_top_data

 def get_top_data (startdate, enddate, i_db, filter_, npeople):
     from vizgrimoire.report import Report
     top = {}
     data = SCM.get_top_data_authors (startdate, enddate, i_db, filter_, npeople)
     top = dict(top.items() + data.items())
     organizations_on = False
     if Report.get_filter_automator('company') is not None:
         organizations_on = True
     if organizations_on:
         data = SCM.get_top_data_organizations (startdate, enddate, i_db, filter_, npeople)
         top = dict(top.items() + data.items())
     return top
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:12,代码来源:SCM.py


示例12: get_mls_from_organizations

    def get_mls_from_organizations(self):
        automator = Report.get_config()
        identities_db = automator['generic']['db_identities']

        from_ = """
            FROM messages m
              JOIN messages_people mp ON m.message_ID = mp.message_id
              JOIN people_uidentities pup ON mp.email_address = pup.people_id 
              JOIN %s.enrollments enr ON enr.upeople_id = pup.uuid 
              JOIN %s.organizations org ON org.id = enr.organization_id 
        """ % (identities_db, identities_db)
        return from_
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:12,代码来源:companies_activity.py


示例13: get_studies_data

    def get_studies_data(ds, period, startdate, enddate, evol):
        """ Get data from studies to be included in agg and evol global JSONs  """
        from vizgrimoire.report import Report
        data = {}

        db_identities = Report.get_config()['generic']['db_identities']
        dbuser = Report.get_config()['generic']['db_user']
        dbpass = Report.get_config()['generic']['db_password']

        studies = Report.get_studies()

        metric_filters = Report.get_default_filter()

        ds_dbname = ds.get_db_name()
        dbname = Report.get_config()['generic'][ds_dbname]
        dsquery = ds.get_query_builder()
        dbcon = dsquery(dbuser, dbpass, dbname, db_identities)
        evol_txt = "evol"
        if not evol: evol_txt = "agg"
        logging.info("Creating studies for " + ds.get_name() + " " + evol_txt)
        for study in studies:
            try:
                obj = study(dbcon, metric_filters)
                if evol:
                    res = obj.get_ts(ds)
                else:
                    res = obj.get_agg(ds)
                if res is not None:
                    data = dict(res.items() + data.items())
            except TypeError:
                # logging.info(study.id + " does no support standard API. Not used.")
                pass

        return data
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:34,代码来源:data_source.py


示例14: get_scm_from_organizations

 def get_scm_from_organizations(self, committers = False):
     automator = Report.get_config()
     identities_db = automator['generic']['db_identities']
     if (committers): field = "s.committer_id"
     else:  field = "s.author_id"
     from_ = """
         FROM scmlog s
           JOIN actions a ON a.commit_id = s.id
           JOIN people_uidentities pup ON %s = pup.people_id
           JOIN %s.enrollments enr ON enr.uuid = pup.uuid
           JOIN %s.organizations org ON org.id = enr.organization_id
     """ % (field, identities_db, identities_db)
     return from_
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:13,代码来源:companies_activity.py


示例15: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = EventsDS.get_filter_items(filter_, startdate, enddate, identities_db)
        if (items == None): return

        filter_name = filter_.get_name()
        items = items['name']

        if not isinstance(items, list):
            items = [items]

        file_items = []
        for item in items:
            if re.compile("^\..*").match(item) is not None: item = "_"+item
            file_items.append(item)

        fn = os.path.join(destdir, filter_.get_filename(EventsDS()))
        createJSON(file_items, fn)

        if filter_name in ("repository"):
            items_list = {'name' : [], 'events_365' : [], 'rsvps_365' : []}
        else:
            items_list = items

        for item in items:
            logging.info(item)
            filter_item = Filter(filter_.get_name(), item)

            evol_data = EventsDS.get_evolutionary_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(EventsDS()))
            createJSON(completePeriodIds(evol_data, period, startdate, enddate), fn)

            agg = EventsDS.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(EventsDS()))
            createJSON(agg, fn)

            if filter_name in ("repository"):
                items_list['name'].append(item.replace('/', '_'))
                items_list['events_365'].append(agg['events_365'])
                items_list['rsvps_365'].append(agg['rsvps_365'])

        EventsDS.create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db)

        fn = os.path.join(destdir, filter_.get_filename(EventsDS()))
        createJSON(items_list, fn)
开发者ID:jgbarah,项目名称:GrimoireLib,代码行数:47,代码来源:EventsDS.py


示例16: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = SCR.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        # Include metrics to sort in javascript.
        items_list = {"name":[],"review_time_days_median":[],"submitted":[]}

        for item in items :
            item_file = item.replace("/","_")
            items_list["name"].append(item_file)

            logging.info (item)
            filter_item = Filter(filter_name, item)

            evol = SCR.get_evolutionary_data(period, startdate, enddate,
                                               identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(SCR()))
            createJSON(evol, fn)

            # Static
            agg = SCR.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(SCR()))
            createJSON(agg, fn)

            if 'submitted' in agg:
                items_list["submitted"].append(agg["submitted"])
            else: items_list["submitted"].append("NA")
            if 'review_time_days_median' in agg:
                items_list["review_time_days_median"].append(agg['review_time_days_median'])
            else: items_list["review_time_days_median"].append("NA")

        fn = os.path.join(destdir, filter_.get_filename(SCR()))
        createJSON(items_list, fn)

        SCR.create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db)
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:44,代码来源:SCR.py


示例17: _get_metrics_for_pending_all

    def _get_metrics_for_pending_all(self, isevol):
        """ Return the metric for all items normalized """
        metrics = self._get_metrics_for_pending()
        if isevol:
            submitted = metrics['submitted'].get_ts()
            merged = metrics['merged'].get_ts()
            abandoned = metrics['abandoned'].get_ts()
        else:
            submitted = metrics['submitted'].get_agg()
            merged = metrics['merged'].get_agg()
            abandoned = metrics['abandoned'].get_agg()

        from vizgrimoire.report import Report
        filter = Report.get_filter(self.filters.type_analysis[0])
        items = Pullpo.get_filter_items(filter, self.filters.startdate,
                                     self.filters.enddate, self.db.identities_db)
        items = items.pop('name')

        from vizgrimoire.GrimoireUtils import fill_and_order_items
        id_field = self.db.get_group_field_alias(self.filters.type_analysis[0])
        submitted = check_array_values(submitted)
        merged = check_array_values(merged)
        abandoned = check_array_values(abandoned)

        submitted = fill_and_order_items(items, submitted, id_field,
                                         isevol, self.filters.period,
                                         self.filters.startdate, self.filters.enddate)
        merged = fill_and_order_items(items, merged, id_field,
                                         isevol, self.filters.period,
                                         self.filters.startdate, self.filters.enddate)
        abandoned = fill_and_order_items(items, abandoned, id_field,
                                         isevol, self.filters.period,
                                         self.filters.startdate, self.filters.enddate)
        metrics_for_pendig_all = {
          id_field: submitted[id_field],
          "submitted": submitted["submitted"],
          "merged": merged["merged"],
          "abandoned": abandoned["abandoned"]
        }
        if isevol:
            metrics_for_pendig_all[self.filters.period] = submitted[self.filters.period]

        return metrics_for_pendig_all
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:43,代码来源:pullpo_metrics.py


示例18: create_filter_report_top

    def create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = MLS.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        for item in items :
            item = item.replace("'", "\\'")
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_.get_name(), item)

            top_senders = MLS.get_top_data(startdate, enddate, identities_db, filter_item, npeople, False)
            createJSON(top_senders, destdir+"/"+filter_item.get_top_filename(MLS()))
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:21,代码来源:MLS.py


示例19: create_filter_report

    def create_filter_report(filter_, period, startdate, enddate, destdir, npeople, identities_db):
        from vizgrimoire.report import Report
        items = Report.get_items()
        if items is None:
            items = SCM.get_filter_items(filter_, startdate, enddate, identities_db)
            if (items == None): return
            items = items['name']

        filter_name = filter_.get_name()

        if not isinstance(items, (list)):
            items = [items]

        fn = os.path.join(destdir, filter_.get_filename(SCM()))
        escaped_items = [i.replace('/','_') for i in items]
        logging.info("D1")
        createJSON(escaped_items, fn)

        for item in items :
            item_name = "'"+ item+ "'"
            logging.info (item_name)
            filter_item = Filter(filter_name, item)

            evol_data = SCM.get_evolutionary_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_evolutionary_filename(SCM()))
            createJSON(evol_data, fn)

            agg = SCM.get_agg_data(period, startdate, enddate, identities_db, filter_item)
            fn = os.path.join(destdir, filter_item.get_static_filename(SCM()))
            createJSON(agg, fn)

        SCM.create_filter_report_top(filter_, period, startdate, enddate, destdir, npeople, identities_db)

        if (filter_name == "company"):
            ds = SCM
            #summary =  SCM.get_filter_summary(filter_, period, startdate, enddate, identities_db, 10)
            #createJSON (summary, destdir+"/"+ filter_.get_summary_filename(SCM))
            # Perform ages study, if it is specified in Report
            SCM.ages_study_com (items, period, startdate, enddate, destdir)
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:39,代码来源:SCM.py


示例20: __get_data__

    def __get_data__ (period, startdate, enddate, identities_db, filter_ = None, evol = False):
        data = {}
        DS = SCR
        from vizgrimoire.GrimoireUtils import fill_and_order_items

        type_analysis = None
        if filter_ is not None:
            type_analysis = [filter_.get_name(), filter_.get_item()]

        from vizgrimoire.report import Report
        automator = Report.get_config()

        if evol:
            metrics_on = DS.get_metrics_core_ts()
            automator_metrics = DS.get_name()+"_metrics_ts"
        else:
            metrics_on = DS.get_metrics_core_agg()
            automator_metrics = DS.get_name()+"_metrics_agg"

        if automator_metrics in automator['r']:
            metrics_on = automator['r'][automator_metrics].split(",")
            logging.info(automator_metrics + " found ")
            # print(metrics_on)

        people_out = []
        if "people_out" in Report.get_config()['r']:
            people_out = Report.get_config()['r']["people_out"]
            people_out = people_out.split(",")

        metrics_reports = SCR.get_metrics_core_reports()
        if filter_ is None:
            from vizgrimoire.report import Report
            reports_on = Report.get_config()['r']['reports'].split(",")
            for r in metrics_reports:
                if r in reports_on: metrics_on += [r]

        if type_analysis and type_analysis[1] is None:
            items = DS.get_filter_items(filter_, startdate, enddate, identities_db)
            items = items.pop('name')

        if DS.get_name()+"_start_date" in Report.get_config()['r']:
            startdate = "'"+Report.get_config()['r'][DS.get_name()+"_start_date"]+"'"
        if DS.get_name()+"_end_date" in Report.get_config()['r']:
            enddate = "'"+Report.get_config()['r'][DS.get_name()+"_end_date"]+"'"

        mfilter = MetricFilters(period, startdate, enddate, type_analysis, 10, people_out, None)
        all_metrics = SCR.get_metrics_set(SCR)

        # SCR specific: remove some metrics from filters
        if filter_ is not None:
            metrics_not_filters =  SCR.get_metrics_not_filters()
            metrics_on_filters = list(set(metrics_on) - set(metrics_not_filters))
            if filter_.get_name() == "repository":
                if 'review_time' in metrics_on: metrics_on_filters+= ['review_time']
                if 'submitted' in metrics_on: metrics_on_filters+= ['submitted']
            metrics_on = metrics_on_filters
        # END SCR specific

        for item in all_metrics:
            if item.id not in metrics_on: continue
            # logging.info(item.id)
            mfilter_orig = item.filters
            mfilter.global_filter = mfilter_orig.global_filter
            item.filters = mfilter
            if not evol: mvalue = item.get_agg()
            else:        mvalue = item.get_ts()

            if type_analysis and type_analysis[1] is None:
                logging.info(item.id)
                id_field = SCRQuery.get_group_field_alias(type_analysis[0])
                mvalue = check_array_values(mvalue)
                mvalue = fill_and_order_items(items, mvalue, id_field,
                                              evol, period, startdate, enddate)
            data = dict(data.items() + mvalue.items())
            item.filters = mfilter_orig

        # SCR SPECIFIC #
        if evol:
            if type_analysis and type_analysis[1] is None: pass
            else:
                metrics_on_changes = ['merged','abandoned','new']
                for item in all_metrics:
                    if item.id in metrics_on_changes and filter_ is None:
                        mfilter_orig = item.filters
                        item.filters = mfilter
                        mvalue = item.get_ts_changes()
                        data = dict(data.items() + mvalue.items())
                        item.filters = mfilter_orig
        # END SCR SPECIFIC #

        if not evol:
            init_date = DS.get_date_init(startdate, enddate, identities_db, type_analysis)
            end_date = DS.get_date_end(startdate, enddate, identities_db, type_analysis)

            if type_analysis and type_analysis[1] is None:
                if id_field is None:
                    id_field = dsquery.get_group_field_alias(type_analysis[0])
                init_date = fill_and_order_items(items, init_date, id_field,
                                                 evol, period, startdate, enddate)
                end_date = fill_and_order_items(items, end_date, id_field,
#.........这里部分代码省略.........
开发者ID:VizGrimoire,项目名称:GrimoireLib,代码行数:101,代码来源:SCR.py



注:本文中的vizgrimoire.report.Report类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vizshape.addSphere函数代码示例发布时间:2022-05-26
下一篇:
Python data_source.DataSource类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap