Skip to content

Commit

Permalink
Default circuit file handling for stub
Browse files Browse the repository at this point in the history
  • Loading branch information
LMSlaugh committed Aug 1, 2023
1 parent 41f09a8 commit 65e8497
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions omf/models/restoration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def work(modelDir, inputDict):

def new(modelDir):
''' Create a new instance of this model. Returns true on success, false on failure. '''
omd_fn = "ieee240.dss.omd"
omd_fn = "ieee240.dss"
ex_fn = "example.csv" # example file input

with open(pJoin(omf.omfDir, "static", "testFiles", "restoration", ex_fn)) as ex_stream:
Expand All @@ -65,7 +65,13 @@ def new(modelDir):
"exampleFileName": ex_fn,
"exampleFileContent": ex_ins,
}
return __neoMetaModel__.new(modelDir, defaultInputs)

creationCode = __neoMetaModel__.new(modelDir, defaultInputs)
try:
shutil.copyfile(pJoin(__neoMetaModel__._omfDir, 'static', 'publicFeeders', defaultInputs['feederName1']+'.omd'), pJoin(modelDir, defaultInputs['feederName1']+'.omd'))
except:
return False
return creationCode

@neoMetaModel_test_setup
def _debugging():
Expand Down

0 comments on commit 65e8497

Please sign in to comment.