Ejemplo n.º 1
0
    def get_load_shed(self):
        """Returns LOAD_SHED data frame, either via loading or calculating.

        :return: (*pandas.DataFrame*) -- data frame of load shed (hour x bus).
        """
        scenario_id = self._scenario_info["id"]
        try:
            # It's either on the server or in our local ScenarioData folder
            output_data = OutputData(data_loc=self.data_loc)
            load_shed = output_data.get_data(scenario_id, "LOAD_SHED")
        except OSError:
            # The scenario was run without load_shed, and we must construct it
            grid = self.get_grid()
            infeasibilities = self._parse_infeasibilities()
            load_shed = construct_load_shed(self._scenario_info, grid,
                                            infeasibilities)

            filename = scenario_id + "_LOAD_SHED.pkl"
            output_dir = server_setup.OUTPUT_DIR
            filepath = os.path.join(server_setup.LOCAL_DIR, output_dir,
                                    filename)
            with open(filepath, "wb") as f:
                pickle.dump(load_shed, f)

        return load_shed
Ejemplo n.º 2
0
    def get_storage_e(self):
        """Returns STORAGE_E data frame. Energy state of charge.

        :return: (*pandas.DataFrame*) -- data frame of energy state of charge.
        """
        output_data = OutputData(data_loc=self.data_loc)
        storage_e = output_data.get_data(self._scenario_info["id"], "STORAGE_E")

        return storage_e
Ejemplo n.º 3
0
    def get_congl(self):
        """Returns CONGL data frame. CONGL = Congestion, Lower flow limit

        :return: (*pandas.DataFrame*) -- data frame of branch flow mu (lower).
        """
        output_data = OutputData(data_loc=self.data_loc)
        congl = output_data.get_data(self._scenario_info["id"], "CONGL")

        return congl
Ejemplo n.º 4
0
    def get_lmp(self):
        """Returns LMP data frame. LMP = locational marginal price

        :return: (*pandas.DataFrame*) -- data frame of nodal prices.
        """
        output_data = OutputData(data_loc=self.data_loc)
        lmp = output_data.get_data(self._scenario_info["id"], "LMP")

        return lmp
Ejemplo n.º 5
0
    def get_dcline_pf(self):
        """Returns PF_DCLINE data frame.

        :return: (*pandas.DataFrame*) -- data frame of power flow on DC line(s).
        """
        output_data = OutputData(data_loc=self.data_loc)
        dcline_pf = output_data.get_data(self._scenario_info["id"], "PF_DCLINE")

        return dcline_pf
Ejemplo n.º 6
0
    def get_pf(self):
        """Returns PF data frame.

        :return: (*pandas.DataFrame*) -- data frame of power flow.
        """
        output_data = OutputData(data_loc=self.data_loc)
        pf = output_data.get_data(self._scenario_info["id"], "PF")

        return pf
Ejemplo n.º 7
0
    def get_pg(self):
        """Returns PG data frame.

        :return: (*pandas.DataFrame*) -- data frame of power generated.
        """
        output_data = OutputData(data_loc=self.data_loc)
        pg = output_data.get_data(self._scenario_info["id"], "PG")

        return pg
Ejemplo n.º 8
0
    def get_storage_pg(self):
        """Returns STORAGE_PG data frame.

        :return: (*pandas.DataFrame*) -- data frame of power generated by
            storage units.
        """
        output_data = OutputData(data_loc=self.data_loc)
        storage_pg = output_data.get_data(self._scenario_info["id"], "STORAGE_PG")

        return storage_pg
Ejemplo n.º 9
0
    def get_averaged_cong(self):
        """Returns averaged CONGL and CONGU.

        :return: (*pandas.DataFrame*) -- data frame of averaged congestion with
            the branch id as indices an the averaged CONGL and CONGU as columns.
        """
        output_data = OutputData(data_loc=self.data_loc)
        mean_cong = output_data.get_data(self._scenario_info["id"], "AVERAGED_CONG")

        return mean_cong
Ejemplo n.º 10
0
 def _get_data(self, field):
     return OutputData().get_data(self._scenario_info["id"], field)