Skip to content

Commit fe244c8

Browse files
committed
Addresses review comments
1 parent c3b8c85 commit fe244c8

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

RATapi/outputs.py

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,20 @@ def save(self, filepath: Union[str, Path] = "./results.json"):
575575

576576

577577
def write_core_results_fields(results: Union[Results, BayesResults], json_dict: Optional[dict] = None) -> dict:
578-
"""Modify the values of the fields that appear in both Results and BayesResults when saving to a json file."""
578+
"""Modify the values of the fields that appear in both Results and BayesResults when saving to a json file.
579+
580+
Parameters
581+
----------
582+
results: Union[Results, BayesResults]
583+
The results or BayesResults object we are writing to json.
584+
json_dict: Optional[dict]
585+
The dictionary containing the json output.
586+
587+
Returns
588+
-------
589+
json_dict: dict
590+
The output json dict updated with the fields that appear in both Results and BayesResults.
591+
"""
579592
if json_dict is None:
580593
json_dict = {}
581594

@@ -602,7 +615,19 @@ def write_core_results_fields(results: Union[Results, BayesResults], json_dict:
602615

603616

604617
def read_core_results_fields(results_dict: dict) -> dict:
605-
"""Modify the values of the fields that appear in both Results and BayesResults when loading a json file."""
618+
"""Modify the values of the fields that appear in both Results and BayesResults when loading a json file.
619+
620+
Parameters
621+
----------
622+
results_dict: Optional[dict]
623+
The dictionary containing the json input.
624+
625+
Returns
626+
-------
627+
results_dict: dict
628+
The input json dict with the fields that appear in both Results and BayesResults converted to numpy arrays
629+
where necessary.
630+
"""
606631
for field in results_fields["list_fields"]:
607632
results_dict[field] = [np.array(result_array) for result_array in results_dict[field]]
608633

@@ -620,7 +645,19 @@ def read_core_results_fields(results_dict: dict) -> dict:
620645

621646

622647
def read_bayes_results_fields(results_dict: dict) -> dict:
623-
"""Modify the values of the fields that appear only in BayesResults when loading a json file."""
648+
"""Modify the values of the fields that appear only in BayesResults when loading a json file.
649+
650+
Parameters
651+
----------
652+
results_dict: Optional[dict]
653+
The dictionary containing the json input.
654+
655+
Returns
656+
-------
657+
results_dict: dict
658+
The input json dict with the fields that appear in both Results and BayesResults converted to numpy arrays
659+
where necessary.
660+
"""
624661
for subclass_name in bayes_results_subclasses:
625662
subclass_dict = {}
626663

0 commit comments

Comments
 (0)