def test_make_modifications_report(self):
        """
        Create a report object, do assertions on its properties, then assert that it gets written
        """
        h5 = os.path.join(self._data_dir, "basemods.h5")

        make_modifications_report(h5, 'rpt.json', self._output_dir, 60)

        # deserialize report

        log.info("Deserializing report {r}".format(
            r=os.path.join(self._output_dir, 'rpt.json')))
        s = None
        with open(os.path.join(self._output_dir, 'rpt.json'), 'r') as f:
            s = json.load(f)

        report = dict_to_report(s)

        self.assertEqual(1, len(report.plotGroups))
        self.assertEqual(2, len(report.plotGroups[0].plots))

        scatter = report.plotGroups[0].plots[0]
        histo = report.plotGroups[0].plots[1]

        self._assert_image_file(report.plotGroups[0].thumbnail)
        self._assert_image_file(scatter.image)
        self._assert_image_file(histo.image)
    def test_make_modifications_report(self):
        """
        Create a report object, do assertions on its properties, then assert that it gets written
        """
        csv = os.path.join(self._data_dir, 'modifications.csv.gz')

        make_modifications_report(csv, 'rpt.json', self._output_dir, 60, False)

        # deserialize report

        log.info("Deserializing report {r}".format(
            r=os.path.join(self._output_dir, 'rpt.json')))
        s = None
        with open(os.path.join(self._output_dir, 'rpt.json'), 'r') as f:
            s = json.load(f)

        report = dict_to_report(s)

        self.assertEqual(1, len(report.plotGroups))
        self.assertEqual(2, len(report.plotGroups[0].plots))

        scatter = report.plotGroups[0].plots[0]
        histo = report.plotGroups[0].plots[1]

        self._assert_image_file(report.plotGroups[0].thumbnail)
        self._assert_image_file(scatter.image)
        self._assert_image_file(histo.image)
    def test_make_modifications_report(self):
        """
        Create a report object, do assertions on its properties, then assert that it gets written
        """
        h5 = os.path.join(self._data_dir, "basemods.h5")

        make_modifications_report(h5, "rpt.json", self._output_dir, 60)

        # deserialize report

        log.info("Deserializing report {r}".format(r=os.path.join(self._output_dir, "rpt.json")))
        s = None
        with open(os.path.join(self._output_dir, "rpt.json"), "r") as f:
            s = json.load(f)

        report = dict_to_report(s)

        validate_report_complete(self, report)

        self.assertEqual(1, len(report.plotGroups))
        self.assertEqual(2, len(report.plotGroups[0].plots))

        scatter = report.plotGroups[0].plots[0]
        histo = report.plotGroups[0].plots[1]

        self._assert_image_file(report.plotGroups[0].thumbnail)
        self._assert_image_file(scatter.image)
        self._assert_image_file(histo.image)
示例#4
0
    def _create_modifications_report(self):
        """
        Creates a Base Modifications report
        """
        from pbreports.report.modifications import make_modifications_report
        datadir = os.path.join(ROOT_DATA_DIR, 'modifications')
        log.info('Creating modifications report using datadir {d}'.format(
            d=datadir))

        csv = os.path.join(datadir, 'modifications.csv.gz')
        report_json = 'modifications.json'
        output_json = os.path.join(self._output_dir, report_json)
        dpi = 60
        dumpdata = False

        make_modifications_report(csv, report_json, self._output_dir, dpi,
                                  dumpdata)

        return self._deserialize_report(output_json)
    def _create_modifications_report(self):
        """
        Creates a Base Modifications report
        """
        from pbreports.report.modifications import make_modifications_report
        datadir = os.path.join(ROOT_DATA_DIR, 'modifications')
        log.info(
            'Creating modifications report using datadir {d}'.format(d=datadir))

        csv = os.path.join(datadir, 'modifications.csv.gz')
        report_json = 'modifications.json'
        output_json = os.path.join(self._output_dir, report_json)
        dpi = 60
        dumpdata = False

        make_modifications_report(
            csv, report_json, self._output_dir, dpi, dumpdata)

        return self._deserialize_report(output_json)
示例#6
0
 def run_report(args):
     return make_modifications_report(args.csv, args.report, args.output, args.dpi, args.dumpdata)