oplus/standard_output/standard_output.py
def get_data(self, environment_title_or_num=-1, frequency=None):
        """
        Parameters
        ----------
        environment_title_or_num
        frequency: 'str', default None
            'timestep', 'hourly', 'daily', 'monthly', 'annual', 'run_period'
            If None, will look for the smallest frequency of environment.
        """

        # manage environment num
        if isinstance(environment_title_or_num, int):
            environment_title = tuple(self._raw_environments.keys())[environment_title_or_num]
        else:
            environment_title = environment_title_or_num

        if environment_title not in self._dfs:
            raise ValueError(f"No environment named {environment_title}. Available environments: {tuple(self._dfs)}.")

        # get environment dataframes
        environment_dfs = self._dfs[environment_title]

        # find first non null frequency if not given
        if frequency is None:
            for frequency in FREQUENCIES:
                if environment_dfs[frequency] is not None:
                    break

        # check frequency
        if frequency not in FREQUENCIES:
            raise ValueError(f"Unknown frequency: {frequency}. Available frequencies: {FREQUENCIES}")

        return self._dfs[environment_title][frequency]
def get_data(self, environment_title_or_num=-1, frequency=None):
        """
        Parameters
        ----------
        environment_title_or_num
        frequency: 'str', default None
            'timestep', 'hourly', 'daily', 'monthly', 'annual', 'run_period'
            If None, will look for the smallest frequency of environment.
        """

        # manage environment num
        if isinstance(environment_title_or_num, int):
            environment_title = tuple(self._raw_environments.keys())[environment_title_or_num]
        else:
            environment_title = environment_title_or_num

        if environment_title not in self._dfs:
            raise ValueError(f"No environment named {environment_title}. Available environments: {tuple(self._dfs)}.")

        # get environment dataframes
        environment_dfs = self._dfs[environment_title]

        # find first non null frequency if not given
        if frequency is None:
            for frequency in FREQUENCIES:
                if environment_dfs[frequency] is not None:
                    break

        # check frequency
        if frequency not in FREQUENCIES:
            raise ValueError(f"Unknown frequency: {frequency}. Available frequencies: {FREQUENCIES}")

        return self._dfs[environment_title][frequency]
Parameters
        ----------
        environment_title_or_num
        frequency: 'str', default None
            'timestep', 'hourly', 'daily', 'monthly', 'annual', 'run_period'
            If None, will look for the smallest frequency of environment.