File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -713,6 +713,20 @@ def __eq__(self, other):
713
713
def _json_string (self ) -> str :
714
714
"""Returns string representation of a :class:`Tidy3dBaseModel`.
715
715
716
+ Returns
717
+ -------
718
+ str
719
+ Json-formatted string holding :class:`Tidy3dBaseModel` data.
720
+ """
721
+ return self ._json ()
722
+
723
+ def _json (self , indent = INDENT , exclude_unset = False , ** kwargs ) -> str :
724
+ """Overwrites the model ``json`` representation with some extra customized handling.
725
+
726
+ Parameters
727
+ -----------
728
+ **kwargs : kwargs passed to `self.json()`
729
+
716
730
Returns
717
731
-------
718
732
str
@@ -727,12 +741,9 @@ def make_json_compatible(json_string: str) -> str:
727
741
json_string = json_string .replace ("Infinity" , '"Infinity"' )
728
742
return json_string .replace (tmp_string , '"-Infinity"' )
729
743
730
- json_string = self .json (indent = INDENT , exclude_unset = False )
744
+ json_string = self .json (indent = indent , exclude_unset = exclude_unset , ** kwargs )
731
745
json_string = make_json_compatible (json_string )
732
746
return json_string
733
- # json_dict = json.loads(json_string)
734
-
735
- # return json.dumps(json_dict)
736
747
737
748
@classmethod
738
749
def add_type_field (cls ) -> None :
You can’t perform that action at this time.
0 commit comments