Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abiyfantaye committed Sep 30, 2024
2 parents 63d4294 + da3e5bc commit ca4878c
Show file tree
Hide file tree
Showing 345 changed files with 4,202,434 additions and 46,715 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
theRes
nd
ned
pres
writeT
sOrD
responseD
WORKD
workd
oT
WriteT
Suh
WLL
VIE
Momento
lamda
dum
numer
reord
fro
Equil
ot
repID
BROWER
PEASE
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ fmkTest.sh
#Remove .vscode
.vscode

.coverage


applications.*
25 changes: 25 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
theRes
nd
ned
pres
writeT
sOrD
responseD
WORKD
workd
oT
WriteT
Suh
WLL
VIE
Momento
lamda
dum
numer
reord
fro
Equil
ot
repID
BROWER
PEASE
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SimCenterBackendApplications

[![Build status](https://ci.appveyor.com/api/projects/status/2fitp6tm5sj00qwr?svg=true)](https://ci.appveyor.com/project/fmckenna/simcenterbackendapplications)
[![Build status](https://ci.appveyor.com/api/projects/status/2fitp6tm5sj00qwr?svg=true)](https://ci.appveyor.com/project/JustinBonus/simcenterbackendapplications)

This repo contains the backend applications that make up SimCeA (SimCenter Aquarium). SimCeA is a collection of applications developed by SimCenter that are utilized when the research applications (quoFEM, EE-UQ, WE-UQ, PBE, and RDT) perform the numerical computations. These computations are performed using scientific workflows; the software that runs the workflows are found in the modules/Workflow directory. The applications these workflows invoke when running are found in the other directories under modules.

Expand Down
31 changes: 18 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 1.0.{build}
version: 24.09.{build}

image:
- Visual Studio 2019
- macOS
- Ubuntu1804
- Visual Studio 2019

stack: python 3.7
stack: python 3.9

for:
# macOS
Expand All @@ -18,14 +18,15 @@ for:

init:
- export PATH="$HOME/Qt/5.15.2/clang_64/bin:$HOME/venv3.9/bin:$PATH"
- python -m pip install --upgrade pip
- pip install conan
- python3 -m pip install --upgrade pip
- pip install conan==1.60.1
- conan user
- conan remote add simcenter https://nherisimcenter.jfrog.io/artifactory/api/conan/simcenter

install:
- uname
- git clone https://github.com/NHERI-SimCenter/SimCenterBackendApplications.git
- rm -rf SimCenterBackendApplications
- git clone https://github.com/JustinBonus/SimCenterBackendApplications.git

build_script:

Expand All @@ -39,6 +40,7 @@ for:
- qmake --version
- gcc --version
- python --version
- python3 --version

# Ubuntu1804
-
Expand All @@ -49,18 +51,19 @@ for:
clone_folder: ~/SimCenter

init:
- export PATH="$HOME/Qt/5.15.2/gcc_64/bin:$HOME/venv3.8.6/bin:$PATH"
- export PATH="$HOME/Qt/5.15.2/gcc_64/bin:$HOME/venv3.9/bin:$PATH"
- export PATH="/home/appveyor/.local/bin:$PATH"

install:
- uname
- sudo update-alternatives --set gcc /usr/bin/gcc-9
- sudo apt-get -y install libglu1-mesa-dev freeglut3-dev mesa-common-dev libblas-dev liblapack-dev
- python -m pip install --upgrade pip
- pip install conan
- python3 -m pip install --upgrade pip
- pip install conan==1.60.1
- conan user
- conan remote add simcenter https://nherisimcenter.jfrog.io/artifactory/api/conan/simcenter
- git clone https://github.com/NHERI-SimCenter/SimCenterBackendApplications.git
- rm -rf SimCenterBackendApplications
- git clone https://github.com/JustinBonus/SimCenterBackendApplications.git

build_script:
# build SimCenterBackendApplications
Expand All @@ -73,6 +76,7 @@ for:
- qmake --version
- gcc --version
- python --version
- python3 --version

# Visual Studio 2019
-
Expand All @@ -85,11 +89,11 @@ for:

init:
- cmd: set PYTHON=C:\PYTHON38-x64
- cmd: set PYTHONNET_PYDLL=%PYTHON%\python3.8.dll
- cmd: set PYTHONNET_PYDLL=%PYTHON%\python3.9.dll
- cmd: set QT=C:\Qt\5.15.2\msvc2019_64\bin
- cmd: set PATH=%PYTHON%;%PYTHON%\Scripts;%QT%;%PATH%
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- cmd: pip.exe install conan
- cmd: pip.exe install conan==1.60.1
- cmd: conan user
- cmd: conan profile new default --detect
- cmd: conan profile show default
Expand All @@ -99,7 +103,8 @@ for:
- cmd: echo %PATH%

install:
- cmd: git clone https://github.com/NHERI-SimCenter/SimCenterBackendApplications.git
- cmd: rm -rf SimCenterBackendApplications
- cmd: git clone https://github.com/JustinBonus/SimCenterBackendApplications.git
- cmd: dir

build_script:
Expand Down
5 changes: 3 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from conans import CMake, ConanFile


class simCenterBackendApps(ConanFile): # noqa: D101
name = 'SimCenterBackendApplications'
version = '1.2.2'
Expand Down Expand Up @@ -30,8 +31,8 @@ class simCenterBackendApps(ConanFile): # noqa: D101
'jsonformoderncpp/3.7.0',
'nanoflann/1.3.2',
'nlopt/2.7.1',
"boost/1.71.0",
'kissfft/131.1.0'
'boost/1.71.0',
'kissfft/131.1.0',
]

# Custom attributes for Bincrafters recipe conventions
Expand Down
2 changes: 2 additions & 0 deletions ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ fro
Equil
ot
repID
BROWER
PEASE
4 changes: 2 additions & 2 deletions makeEXE.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

echo "Building SimCenterBackendApplicationss ..."
echo "Building SimCenterBackendApplications ..."
mkdir -p build
cd build
conan install .. --build missing
status=$?; if [[ $status != 0 ]]; then echo "conan failed"; exit $status; fi
cmake ..
cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF ..
status=$?; if [[ $status != 0 ]]; then echo "cmake failed"; exit $status; fi
cmake --build . --config Release
status=$?; if [[ $status != 0 ]]; then echo "make failed"; exit $status; fi
Expand Down
9 changes: 9 additions & 0 deletions modules/Workflow/WorkflowApplications.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@
"ExecutablePath": "applications/createEVENT/stochasticWave/StochasticWave.py",
"ApplicationSpecificInputs":[]
},
{
"Name": "TaichiEvent",
"ExecutablePath": "applications/createEVENT/TaichiEvent/TaichiEvent.py",
"ApplicationSpecificInputs":[]
},
{
"Name": "GeoClawOpenFOAM",
"ExecutablePath": "applications/createEVENT/GeoClawOpenFOAM/GeoClawOpenFOAM.py",
Expand Down Expand Up @@ -974,6 +979,10 @@
"Name": "IMasEDP",
"ExecutablePath": "applications/performSIMULATION/IMasEDP/IMasEDP.py"
},
{
"Name": "CapacitySpectrumMethod",
"ExecutablePath": "applications/performSIMULATION/capacitySpectrum/runCMS.py"
},
{
"Name": "SurrogateSimulation",
"ExecutablePath": "applications/performSIMULATION/surrogateSimulation/SurrogateSimulation.py"
Expand Down
56 changes: 16 additions & 40 deletions modules/Workflow/whale/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,27 +1507,33 @@ def augment_asset_files(self): # noqa: C901
return assetFilesList # noqa: DOC201, RUF100

def perform_system_performance_assessment(self, asset_type):
"""For an asset type run the system level performance assessment application
"""Run the system level performance assessment application.
Longer description
For an asset type run the system level performance assessment
application.
Parameters
----------
asset_type: string
Asset type to run perform system assessment of
""" # noqa: D400
if 'SystemPerformance' in self.workflow_apps.keys(): # noqa: SIM118
"""
# Make sure that we are in the run directory before we run REWET
# Every other path will be relative to the Run Directory (result dir)
os.chdir(self.run_dir)

# Check if system performance is requested
if 'SystemPerformance' in self.workflow_apps:
performance_app = self.workflow_apps['SystemPerformance'][asset_type]
else:
log_msg(
f'No Performance application to run for asset type: {asset_type}.',
prepend_timestamp=False,
)
log_div()
return False # noqa: DOC201, RUF100
return False

if performance_app.rel_path == None: # noqa: E711
if performance_app.rel_path is None:
log_msg(
f'No Performance application to run for asset type: {asset_type}.',
prepend_timestamp=False,
Expand All @@ -1536,8 +1542,7 @@ def perform_system_performance_assessment(self, asset_type):
return False

log_msg(
'Performing System Performance Application for asset type: '
+ asset_type,
f'Performing System Performance Application for asset type: {asset_type}',
prepend_timestamp=False,
)
log_div()
Expand All @@ -1550,18 +1555,13 @@ def perform_system_performance_assessment(self, asset_type):
# defaults added to a system performance app are asset_type, input_dir and running_parallel (default False)
#

# app_command_list.append('--asset_type')
# app_command_list.append(asset_type)
app_command_list.append('--input')
app_command_list.append(self.input_file)
# app_command_list.append('--working_dir')
# app_command_list.append(self.working_dir)

# Sina added this part for parallel run in REWET
if self.parType == 'parSETUP':
log_msg(
'\nParallel settings for System Performance for asset type:'
+ asset_type,
f'\nParallel settings for System Performance for asset type:{asset_type}',
prepend_timestamp=False,
)
app_command_list.append('--par')
Expand All @@ -1583,34 +1583,10 @@ def perform_system_performance_assessment(self, asset_type):
)

log_msg(
'System Performance Application Completed for asset type: ' + asset_type,
f'System Performance Application Completed for asset type: {asset_type}',
prepend_timestamp=False,
)

# end of Sina's odifications for parallel run

# if (self.parType == 'parSETUP'):

# log_msg('\nWriting System Performance application for asset type:' + asset_type, prepend_timestamp=False)
# self.parCommandFile.write("\n# Writing System Performance application for asset type:" + asset_type +"\n")

# if performance_app.runsParallel == False:
# self.parCommandFile.write(command + "\n")
# else:
# self.parCommandFile.write(self.mpiExec + " -n " + str(self.numProc) + " " + command + " --running_parallel True\n")

# else:

# log_msg('\n{}\n'.format(command), prepend_timestamp=False,
# prepend_blank_space=False)

# result, returncode = run_command(command)

# log_msg('Output: ', prepend_timestamp=False, prepend_blank_space=False)
# log_msg('\n{}\n'.format(result), prepend_timestamp=False, prepend_blank_space=False)

# log_msg('System Performance Application Completed for asset type: ' + asset_type, prepend_timestamp=False)

log_div()
return True

Expand Down Expand Up @@ -2870,7 +2846,7 @@ def aggregate_results( # noqa: C901, PLR0912, PLR0915
bldg_dir = Path(os.path.dirname(asst_data[a_i]['file'])).resolve() # noqa: PTH120
main_dir = bldg_dir
assetTypeHierarchy = [bldg_dir.name] # noqa: N806
while main_dir.parent.name != self.run_dir.name:
while main_dir.parent.name != 'Results':
main_dir = bldg_dir.parent
assetTypeHierarchy = [main_dir.name] + assetTypeHierarchy # noqa: N806, RUF005

Expand Down
9 changes: 5 additions & 4 deletions modules/createAIM/GeoJSON_to_ASSET/GeoJSON_to_ASSET.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import argparse # noqa: INP001, D100
import argparse # noqa: D100, INP001
import importlib
import json
import os
Expand All @@ -8,7 +8,8 @@
import warnings

import geopandas as gpd
import momepy

# import momepy
import numpy as np
import pandas as pd
import shapely
Expand Down Expand Up @@ -179,10 +180,10 @@ def defineConnectivities( # noqa: N802, D102
# Convert find connectivity and add start_node, end_node attributes
edges = self.gdf
datacrs = edges.crs
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal')
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal') # noqa: F821
with warnings.catch_warnings(): # Suppress the warning of disconnected components in the graph
warnings.simplefilter('ignore')
nodes, edges, sw = momepy.nx_to_gdf(
nodes, edges, sw = momepy.nx_to_gdf( # noqa: F821
graph, points=True, lines=True, spatial_weights=True
)
# edges = edges.set_index('ind')
Expand Down
Loading

0 comments on commit ca4878c

Please sign in to comment.