コード例 #1
0
ファイル: test_plotter.py プロジェクト: bhourahine/CyGutz
    def testName(self):
        entry_Li = ComputedEntry("Li", -1.90753119)

        with open(os.path.join(test_dir, "LiTiO2_batt.json"), "r") as f:
            entries_LTO = json.load(f, cls=MontyDecoder)
            ie_LTO = InsertionElectrode(entries_LTO, entry_Li)

        with open(os.path.join(test_dir, "FeF3_batt.json"), 'r') as fid:
            entries = json.load(fid, cls=MontyDecoder)
            ce_FF = ConversionElectrode.from_composition_and_entries(
                Composition("FeF3"), entries)

        plotter = VoltageProfilePlotter(xaxis="frac_x")
        plotter.add_electrode(ie_LTO, "LTO insertion")
        plotter.add_electrode(ce_FF, "FeF3 conversion")
        self.assertIsNotNone(plotter.get_plot_data(ie_LTO))
        self.assertIsNotNone(plotter.get_plot_data(ce_FF))
コード例 #2
0
ファイル: test_plotter.py プロジェクト: AtlasL/pymatgen
    def testName(self):
        entry_Li = ComputedEntry("Li", -1.90753119)

        with open(os.path.join(test_dir, "LiTiO2_batt.json"), "r") as f:
            entries_LTO = json.load(f, cls=MontyDecoder)
            ie_LTO = InsertionElectrode(entries_LTO, entry_Li)

        with open(os.path.join(test_dir, "FeF3_batt.json"), 'r') as fid:
            entries = json.load(fid, cls=MontyDecoder)
            ce_FF = ConversionElectrode.from_composition_and_entries(
                Composition("FeF3"),
                entries)

        plotter = VoltageProfilePlotter(xaxis="frac_x")
        plotter.add_electrode(ie_LTO, "LTO insertion")
        plotter.add_electrode(ce_FF, "FeF3 conversion")
        self.assertIsNotNone(plotter.get_plot_data(ie_LTO))
        self.assertIsNotNone(plotter.get_plot_data(ce_FF))
コード例 #3
0
    def testPlotly(self):
        plotter = VoltageProfilePlotter(xaxis="frac_x")
        plotter.add_electrode(self.ie_LTO, "LTO insertion")
        plotter.add_electrode(self.ce_FF, "FeF3 conversion")
        fig = plotter.get_plotly_figure()
        self.assertEqual(fig.layout.xaxis.title.text, "Atomic Fraction of Li")
        plotter = VoltageProfilePlotter(xaxis="x_form")
        plotter.add_electrode(self.ce_FF, "FeF3 conversion")
        fig = plotter.get_plotly_figure()
        self.assertEqual(fig.layout.xaxis.title.text,
                         "x in Li<sub>x</sub>FeF3")

        plotter.add_electrode(self.ie_LTO, "LTO insertion")
        fig = plotter.get_plotly_figure()
        self.assertEqual(fig.layout.xaxis.title.text,
                         "x Workion Ion per Host F.U.")
コード例 #4
0
 def testName(self):
     plotter = VoltageProfilePlotter(xaxis="frac_x")
     plotter.add_electrode(self.ie_LTO, "LTO insertion")
     plotter.add_electrode(self.ce_FF, "FeF3 conversion")
     self.assertIsNotNone(plotter.get_plot_data(self.ie_LTO))
     self.assertIsNotNone(plotter.get_plot_data(self.ce_FF))