|
42 | 42 | import matplotlib as mpl |
43 | 43 | import matplotlib.pyplot as plt |
44 | 44 | import numpy as np |
45 | | -import pandas as pd |
46 | 45 |
|
47 | 46 | # Check if taichi is installed before importing taichi |
48 | 47 | try: |
@@ -281,23 +280,24 @@ def GetFloorsCount(BIMFilePath): # noqa: N802, N803, D103 |
281 | 280 | return int(bim['GeneralInformation']['stories']) |
282 | 281 |
|
283 | 282 |
|
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 |
289 | 288 |
|
290 | | - fileNameKey = 'simulationScript' # noqa: N806 |
291 | | - filePathKey = fileNameKey + 'Path' # noqa: N806 |
| 289 | + # fileNameKey = 'simulationScript' # noqa: N806 |
| 290 | + # filePathKey = fileNameKey + 'Path' # noqa: N806 |
292 | 291 |
|
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 |
297 | 296 |
|
298 | 297 | defaultScriptPath = f'{os.path.realpath(os.path.dirname(__file__))}' # noqa: N806, PTH120 |
299 | 298 | defaultScriptName = 'setrun.py' # noqa: N806 |
300 | | - return defaultScriptPath + defaultScriptName |
| 299 | + defaultScriptPath = os.path.join(defaultScriptPath, defaultScriptName) # noqa: PTH118 |
| 300 | + return defaultScriptPath # noqa: PTH118 |
301 | 301 |
|
302 | 302 |
|
303 | 303 | def main(): |
@@ -330,25 +330,21 @@ def main(): |
330 | 330 | default='EVENT.json', |
331 | 331 | ) |
332 | 332 | parser.add_argument('--getRV', help='getRV', required=False, action='store_true') |
333 | | - # parser.add_argument('--filenameSAM', default=None) |
334 | | - |
| 333 | + |
335 | 334 | # parsing arguments |
336 | 335 | arguments, unknowns = parser.parse_known_args() |
337 | 336 |
|
338 | | - # import subprocess |
339 | | - |
340 | 337 | # Get json of filenameAIM |
341 | | - scriptName = GetCelerisScript(arguments.filenameAIM) # noqa: N816 |
342 | | - |
343 | 338 | filePath = arguments.filenameAIM # noqa: N816 |
344 | 339 | with open(filePath, encoding='utf-8') as file: # noqa: PTH123 |
345 | 340 | evt = json.load(file) |
346 | 341 | file.close # noqa: B018 |
347 | 342 |
|
| 343 | + scriptName = GetCelerisScript() # noqa: N816 |
| 344 | + caseDirectory = './examples/CrescentCity' # noqa: N816 |
348 | 345 | configFilename = 'config.json' # noqa: N816 |
349 | 346 | bathymetryFilename = 'bathymetry.txt' # noqa: N816 |
350 | 347 | waveFilename = 'wave.txt' # noqa: N816 |
351 | | - caseDirectory = './examples/CrescentCity' # noqa: N816 |
352 | 348 |
|
353 | 349 | for event in evt['Events']: |
354 | 350 | # Redesign the input structure in backend CelerisAi later. |
|
0 commit comments