sysdynpy/exporter.py
def _prepare_export(cls, results, file_format, system_elements, rel_path):
        """Prepares the export. 

        Contains actions that have to be done regardless of export format.
        These actions include:

        * check if file format is supported
        * check if given system elements are in results
        * filter results to only contain given system elements
        * join the given relative path to the location the script is executed from
        
        All these actions are done in separate methods.

        :param file_format: One of the file formats in :py:attr:`~_supported_formats`
        :type file_format: str
        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param system_elements: Names of the system elements to export data for.
        :type system_elements: list of strings
        :param rel_path: The path where to store the exported file (including the filename).
            Relative to the current working directory. Can include the file format.
            If it is not included it will be appended. Make sure the folder
            already exists, it will not be created. Defaults to "./results".

            Examples:

                |  .\\\\\\\\path\\\\\\\\to\\\\\\\\file.csv
                |  ./path/to/file.json
                |  ..\\\\\\\\path\\\\\\\\to\\\\\\\\file.json
                |  ../path/to/file
        :type rel_path: str
        :return: A tuple with two elements:

            * the joined, absolute output path
            * a filtered version of the result dictionary, including only the
                system elements to export
        :rtype: (str, dict)
        """
        # check if file format is supported
        try:
            cls._check_file_format(file_format)
        except ValueError as v:
            raise v

        # check if all given system elements are in results
        try:
            _check_if_system_elements_in_results(results, system_elements)
        except ValueError as v:
            raise v

         # filter results to only contain given system elements
        results_filtered = _filter_results(results, system_elements)
        
        # create file output path
        out_path = _create_abs_output_path(rel_path, file_format)

        return out_path, results_filtered
Prepares the export. 

        Contains actions that have to be done regardless of export format.
        These actions include:

        * check if file format is supported
        * check if given system elements are in results
        * filter results to only contain given system elements
        * join the given relative path to the location the script is executed from
        
        All these actions are done in separate methods.

        :param file_format: One of the file formats in :py:attr:`~_supported_formats`
        :type file_format: str
        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param system_elements: Names of the system elements to export data for.
        :type system_elements: list of strings
        :param rel_path: The path where to store the exported file (including the filename).
            Relative to the current working directory. Can include the file format.
            If it is not included it will be appended. Make sure the folder
            already exists, it will not be created. Defaults to "./results".

            Examples:

                |  .\\\\\\\\path\\\\\\\\to\\\\\\\\file.csv
                |  ./path/to/file.json
                |  ..\\\\\\\\path\\\\\\\\to\\\\\\\\file.json
                |  ../path/to/file
        :type rel_path: str
        :return: A tuple with two elements:

            * the joined, absolute output path
            * a filtered version of the result dictionary, including only the
                system elements to export
        :rtype: (str, dict)
        
Prepares the export.
Contains actions that have to be done regardless of export format.
These actions include.

check if file format is supported
check if given system elements are in results
filter results to only contain given system elements
join the given relative path to the location the script is executed from

All these actions are done in separate methods.
Prepares the export . Contains actions that have to be done regardless of export format . These actions include . check if file format is supported check if given system elements are in results filter results to only contain given system elements join the given relative path to the location the script is executed from All these actions are done in separate methods .
def _prepare_export(cls, results, file_format, system_elements, rel_path):
        try:
            cls._check_file_format(file_format)
        except ValueError as v:
            raise v
        try:
            _check_if_system_elements_in_results(results, system_elements)
        except ValueError as v:
            raise v
        results_filtered = _filter_results(results, system_elements)
        out_path = _create_abs_output_path(rel_path, file_format)
        return out_path, results_filtered
def _prepare_export ( cls , results , file_format , system_elements , rel_path ) : try : cls . _check_file_format ( file_format ) except ValueError as v : raise v try : _check_if_system_elements_in_results ( results , system_elements ) except ValueError as v : raise v results_filtered = _filter_results ( results , system_elements ) out_path = _create_abs_output_path ( rel_path , file_format ) return out_path , results_filtered
Prepares the export.
Prepares the export .
"""Prepares the export. 

        Contains actions that have to be done regardless of export format.
        These actions include:

        * check if file format is supported
        * check if given system elements are in results
        * filter results to only contain given system elements
        * join the given relative path to the location the script is executed from
        
        All these actions are done in separate methods.

        :param file_format: One of the file formats in :py:attr:`~_supported_formats`
        :type file_format: str
        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param system_elements: Names of the system elements to export data for.
        :type system_elements: list of strings
        :param rel_path: The path where to store the exported file (including the filename).
            Relative to the current working directory. Can include the file format.
            If it is not included it will be appended. Make sure the folder
            already exists, it will not be created. Defaults to "./results".

            Examples:

                |  .\\\\\\\\path\\\\\\\\to\\\\\\\\file.csv
                |  ./path/to/file.json
                |  ..\\\\\\\\path\\\\\\\\to\\\\\\\\file.json
                |  ../path/to/file
        :type rel_path: str
        :return: A tuple with two elements:

            * the joined, absolute output path
            * a filtered version of the result dictionary, including only the
                system elements to export
        :rtype: (str, dict)
        """ # check if file format is supported # check if all given system elements are in results # filter results to only contain given system elements # create file output path
A tuple with two elements:
the joined, absolute output path
a filtered version of the result dictionary, including only the
system elements to export
A tuple with two elements : the joined absolute output path a filtered version of the result dictionary including only the system elements to export
(str, dict)
cls
results
The result of the simulation
The result of the simulation
file_format
One of the file formats in :py:attr:`~_supported_formats`
One of the file formats in : py : attr : ` ~_supported_formats `
system_elements
Names of the system elements to export data for.
Names of the system elements to export data for .
rel_path
The path where to store the exported file (including the filename).
Relative to the current working directory. Can include the file format.
If it is not included it will be appended. Make sure the folder
already exists, it will not be created. Defaults to "./results".




The path where to store the exported file ( including the filename ) . Relative to the current working directory . Can include the file format . If it is not included it will be appended . Make sure the folder already exists it will not be created . Defaults to " . / results " .