File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 dispersion_on = True ,
4040 constant_profiles = False ,
4141)
42+
43+ standard_input .to_json (FOLDER / "intermediate_params.json" )
44+ breakpoint ()
4245if __name__ == "__main__" :
4346 my_simulation .exports = ["P_g" , "a" , "aJ_T2" ]
4447 output = my_simulation .solve (fast_solve = True )
Original file line number Diff line number Diff line change 11from __future__ import annotations
22from dataclasses import dataclass , replace
3+ from datetime import datetime
4+ from sparging import helpers
35from sparging .correlations import Correlation , all_correlations
46import pint
57from typing import List
@@ -220,15 +222,29 @@ def __post_init__(self):
220222 def to_json (self , path : str ):
221223 import json
222224
225+ output = {
226+ "metadata" : {
227+ "git_commit" : helpers .get_git_hash (),
228+ "date" : datetime .now ().isoformat (),
229+ },
230+ }
231+
232+ output ["intermediate parameters" ] = {}
233+ for node in self .graph .nodes :
234+ output ["intermediate parameters" ][node ] = {
235+ "value" : str (self .graph .nodes [node ]["value" ]),
236+ "origin" : self .graph .nodes [node ]["origin" ],
237+ }
223238 with open (path , "w" ) as f :
224239 json .dump (
225- {
226- key : str (value )
227- for key , value in self .__dict__ .items ()
228- if isinstance (value , pint .Quantity )
229- },
240+ output ,
241+ # {
242+ # key: str(value)
243+ # for key, value in self.__dict__.items()
244+ # if isinstance(value, pint.Quantity)
245+ # },
230246 f ,
231- indent = 2 ,
247+ indent = 4 ,
232248 )
233249
234250 @classmethod
You can’t perform that action at this time.
0 commit comments