Skip to content

Commit ca534e3

Browse files
committed
Update Celeris
1 parent 114bdac commit ca534e3

File tree

7 files changed

+3146
-1632
lines changed

7 files changed

+3146
-1632
lines changed

modules/createEVENT/Celeris/Celeris.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import matplotlib as mpl
4343
import matplotlib.pyplot as plt
4444
import numpy as np
45-
import pandas as pd
4645

4746
# Check if taichi is installed before importing taichi
4847
try:
@@ -281,23 +280,24 @@ def GetFloorsCount(BIMFilePath): # noqa: N802, N803, D103
281280
return int(bim['GeneralInformation']['stories'])
282281

283282

284-
def GetCelerisScript(BIMFilePath): # noqa: N802, N803, D103
285-
filePath = BIMFilePath # noqa: N806
286-
with open(filePath, encoding='utf-8') as file: # noqa: PTH123
287-
evt = json.load(file)
288-
file.close # noqa: B018
283+
def GetCelerisScript(): # noqa: N802, N803, D103
284+
# filePath = BIMFilePath # noqa: N806
285+
# with open(filePath, encoding='utf-8') as file: # noqa: PTH123
286+
# evt = json.load(file)
287+
# file.close # noqa: B018
289288

290-
fileNameKey = 'simulationScript' # noqa: N806
291-
filePathKey = fileNameKey + 'Path' # noqa: N806
289+
# fileNameKey = 'simulationScript' # noqa: N806
290+
# filePathKey = fileNameKey + 'Path' # noqa: N806
292291

293-
for event in evt['Events']:
294-
fileName = event[fileNameKey] # noqa: N806
295-
filePath = event[filePathKey] # noqa: N806
296-
return os.path.join(filePath, fileName) # noqa: PTH118
292+
# for event in evt['Events']:
293+
# fileName = event[fileNameKey] # noqa: N806
294+
# filePath = event[filePathKey] # noqa: N806
295+
# return os.path.join(filePath, fileName) # noqa: PTH118
297296

298297
defaultScriptPath = f'{os.path.realpath(os.path.dirname(__file__))}' # noqa: N806, PTH120
299298
defaultScriptName = 'setrun.py' # noqa: N806
300-
return defaultScriptPath + defaultScriptName
299+
defaultScriptPath = os.path.join(defaultScriptPath, defaultScriptName) # noqa: PTH118
300+
return defaultScriptPath # noqa: PTH118
301301

302302

303303
def main():
@@ -330,25 +330,21 @@ def main():
330330
default='EVENT.json',
331331
)
332332
parser.add_argument('--getRV', help='getRV', required=False, action='store_true')
333-
# parser.add_argument('--filenameSAM', default=None)
334-
333+
335334
# parsing arguments
336335
arguments, unknowns = parser.parse_known_args()
337336

338-
# import subprocess
339-
340337
# Get json of filenameAIM
341-
scriptName = GetCelerisScript(arguments.filenameAIM) # noqa: N816
342-
343338
filePath = arguments.filenameAIM # noqa: N816
344339
with open(filePath, encoding='utf-8') as file: # noqa: PTH123
345340
evt = json.load(file)
346341
file.close # noqa: B018
347342

343+
scriptName = GetCelerisScript() # noqa: N816
344+
caseDirectory = './examples/CrescentCity' # noqa: N816
348345
configFilename = 'config.json' # noqa: N816
349346
bathymetryFilename = 'bathymetry.txt' # noqa: N816
350347
waveFilename = 'wave.txt' # noqa: N816
351-
caseDirectory = './examples/CrescentCity' # noqa: N816
352348

353349
for event in evt['Events']:
354350
# Redesign the input structure in backend CelerisAi later.

0 commit comments

Comments
 (0)