@@ -487,12 +487,17 @@ def save(self, path: str) -> None:
487
487
with open (path , 'w' ) as f :
488
488
json .dump (self ._log_all (), f , indent = 4 , sort_keys = True , cls = PythonObjectEncoder )
489
489
490
- def load (self , path : str , check_reproducibility : bool = False ) -> None :
490
+ def load (self ,
491
+ path : str ,
492
+ check_reproducibility : bool = False ,
493
+ skip_unsettable : bool = False ) -> None :
491
494
"""Loads the arguments in JSON format. Note: Due to JSON, tuples are loaded as lists.
492
495
493
496
:param path: Path to the JSON file where the arguments will be loaded from.
494
497
:param check_reproducibility: When True, raises an error if the loaded reproducibility
495
498
information doesn't match the current reproducibility information.
499
+ :param skip_unsettable: When True, skips attributes that cannot be set in the Tap object,
500
+ e.g. properties without setters.
496
501
"""
497
502
with open (path ) as f :
498
503
args_dict = json .load (f , object_hook = as_python_object )
@@ -528,7 +533,7 @@ def load(self, path: str, check_reproducibility: bool = False) -> None:
528
533
raise ValueError (f'{ no_reproducibility_message } : Uncommitted changes '
529
534
f'in current args.' )
530
535
531
- self .from_dict (args_dict )
536
+ self .from_dict (args_dict , skip_unsettable = skip_unsettable )
532
537
533
538
def __str__ (self ) -> str :
534
539
"""Returns a string representation of self.
0 commit comments