sysdynpy/exporter.py
def export_data(cls, results, file_format, system_elements, rel_path="./results"):
        """Saves the simulation results to the file system.

         rel path: .\\somepath  ./somepath  somepath ../somepath ..\\somepath

        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param file_format: 'csv' or 'json'
        :type file_format: str
        :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
        """
        out_path, results_filtered = None, None
        try:
           out_path, results_filtered = \
                cls._prepare_export(results, file_format, system_elements, rel_path)
        except ValueError as v:
            raise v
        
        if file_format == "csv":
            with open(out_path, "w", encoding="utf-8", newline='') as outfile:
                writer = csv.writer(outfile, delimiter=";")
                writer.writerow(results_filtered.keys())
                writer.writerows(zip(*results_filtered.values()))

        if file_format == "json":
            with open(out_path, "w", encoding="utf-8", newline='') as outfile:
                json.dump(results_filtered, outfile, ensure_ascii=False)
Saves the simulation results to the file system.

         rel path: .\\somepath  ./somepath  somepath ../somepath ..\\somepath

        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param file_format: 'csv' or 'json'
        :type file_format: str
        :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
        
Saves the simulation results to the file system.
Saves the simulation results to the file system .
def export_data(cls, results, file_format, system_elements, rel_path="./results"):
        out_path, results_filtered = None, None
        try:
           out_path, results_filtered = \
                cls._prepare_export(results, file_format, system_elements, rel_path)
        except ValueError as v:
            raise v
        if file_format == "csv":
            with open(out_path, "w", encoding="utf-8", newline='') as outfile:
                writer = csv.writer(outfile, delimiter=";")
                writer.writerow(results_filtered.keys())
                writer.writerows(zip(*results_filtered.values()))
        if file_format == "json":
            with open(out_path, "w", encoding="utf-8", newline='') as outfile:
                json.dump(results_filtered, outfile, ensure_ascii=False)
def export_data ( cls , results , file_format , system_elements , rel_path = "./results" ) : out_path , results_filtered = None , None try : out_path , results_filtered = cls . _prepare_export ( results , file_format , system_elements , rel_path ) except ValueError as v : raise v if file_format == "csv" : with open ( out_path , "w" , encoding = "utf-8" , newline = '' ) as outfile : writer = csv . writer ( outfile , delimiter = ";" ) writer . writerow ( results_filtered . keys ( ) ) writer . writerows ( zip ( * results_filtered . values ( ) ) ) if file_format == "json" : with open ( out_path , "w" , encoding = "utf-8" , newline = '' ) as outfile : json . dump ( results_filtered , outfile , ensure_ascii = False )
Saves the simulation results to the file system.
Saves the simulation results to the file system .
"""Saves the simulation results to the file system.

         rel path: .\\somepath  ./somepath  somepath ../somepath ..\\somepath

        :param results: The result of the simulation
        :type results: dict, see :py:func:`~sysdynpy.simulator.get_simulation_results`
            for more details.
        :param file_format: 'csv' or 'json'
        :type file_format: str
        :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
        """
cls
results
The result of the simulation
The result of the simulation
file_format
'csv' or 'json'
' csv ' or ' json '
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 " .