-
-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Labels
EnhancementNew feature or request, including adjustments in current codesNew feature or request, including adjustments in current codesGood first issueGood for newcomersGood for newcomersMonte CarloMonte Carlo and related contentsMonte Carlo and related contents
Description
Description
Following the progress made in #242 and #912, the MonteCarlo class currently relies primarily on .txt files for exporting and reloading simulation data. To increase interoperability with data analysis tools, I propose adding native support for .csv and .json formats directly within the class constructor and its file-handling logic.
Proposed Changes
1. Update MonteCarlo.__init__
Introduce an export_type parameter to allow users to specify the desired output format at initialization.
def __init__(
self,
filename,
environment,
rocket,
flight,
export_list=None,
data_collector=None,
export_type="txt" # New parameter
):- Supported types:
"txt","csv","json". - Behavior: The class should internalize this preference to determine how results are written to disk.
2. Standardize Export Logic
The implementation should ensure that the resulting files are consistent with the output currently generated by:
export_results_to_csv()export_results_to_json()
3. Enhanced File Loading
When a filename is passed to the constructor that points to an existing file, the class should detect the extension and handle the data ingestion accordingly.
- If
filename="results.csv", the class should parse it as a CSV. - If
filename="results.json", it should parse it as JSON. - Maintain compatibility with existing
.txtparsing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or request, including adjustments in current codesNew feature or request, including adjustments in current codesGood first issueGood for newcomersGood for newcomersMonte CarloMonte Carlo and related contentsMonte Carlo and related contents