Skip to content
Prev Previous commit
Next Next commit
docs: update import method docstrings for CSV/JSON support
  • Loading branch information
khushalkottaru committed Mar 31, 2026
commit a19bc442422a9d9fb10bcf798c6f4b58fb2a1b51
22 changes: 14 additions & 8 deletions rocketpy/simulation/monte_carlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,21 +1097,23 @@ def set_processed_results(self):

def import_outputs(self, filename=None):
"""
Import Monte Carlo results from .txt file and save it into a dictionary.
Import Monte Carlo results from a file and save it into a dictionary.
Supports .txt (JSONL), .csv, and .json file formats.

Parameters
----------
filename : str, optional
Name or directory path to the file to be imported. If none,
self.filename will be used.
self.filename will be used with the default .outputs.txt suffix.
Files with .csv or .json extensions are also accepted.

Returns
-------
None

Notes
-----
Notice that you can import the outputs, inputs, and errors from the a
Notice that you can import the outputs, inputs, and errors from a
file without the need to run simulations. You can use previously saved
files to process analyze the results or to continue a simulation.
"""
Expand All @@ -1131,13 +1133,15 @@ def import_outputs(self, filename=None):

def import_inputs(self, filename=None):
"""
Import Monte Carlo inputs from .txt file and save it into a dictionary.
Import Monte Carlo inputs from a file and save it into a dictionary.
Supports .txt (JSONL), .csv, and .json file formats.

Parameters
----------
filename : str, optional
Name or directory path to the file to be imported. If none,
self.filename will be used.
self.filename will be used with the default .inputs.txt suffix.
Files with .csv or .json extensions are also accepted.

Returns
-------
Expand All @@ -1156,13 +1160,15 @@ def import_inputs(self, filename=None):

def import_errors(self, filename=None):
"""
Import Monte Carlo errors from .txt file and save it into a dictionary.
Import Monte Carlo errors from a file and save it into a dictionary.
Supports .txt (JSONL), .csv, and .json file formats.

Parameters
----------
filename : str, optional
Name or directory path to the file to be imported. If none,
self.filename will be used.
self.filename will be used with the default .errors.txt suffix.
Files with .csv or .json extensions are also accepted.

Returns
-------
Expand All @@ -1181,7 +1187,7 @@ def import_errors(self, filename=None):

def import_results(self, filename=None):
"""
Import Monte Carlo results from .txt file and save it into a dictionary.
Import Monte Carlo results from a file and save it into a dictionary.

Parameters
----------
Expand Down