当前位置: 首页>>代码示例>>Python>>正文


Python Report.get_studies方法代码示例

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


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

示例1: get_studies_data

# 需要导入模块: from vizgrimoire.report import Report [as 别名]
# 或者: from vizgrimoire.report.Report import get_studies [as 别名]
    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,代码行数:36,代码来源:data_source.py

示例2: ages_study_com

# 需要导入模块: from vizgrimoire.report import Report [as 别名]
# 或者: from vizgrimoire.report.Report import get_studies [as 别名]
    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,代码行数:60,代码来源:data_source.py


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