Skip to content

Commit

Permalink
Remove noqa: ... for disabled rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannis-vm committed Aug 15, 2024
1 parent 0b5cdcb commit d2f6897
Show file tree
Hide file tree
Showing 330 changed files with 18,687 additions and 18,692 deletions.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python # noqa: EXE001, D100, CPY001
#!/usr/bin/env python

from bincrafters import build_template_default

Expand Down
26 changes: 13 additions & 13 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import os # noqa: D100, CPY001
import os

from conans import CMake, ConanFile


class simCenterBackendApps(ConanFile): # noqa: D101
class simCenterBackendApps(ConanFile):
name = 'SimCenterBackendApplications'
version = '1.2.2'
description = 'Backend applications for SimCenter software'
license = 'BSD 3-Clause'
author = 'Michael Gardner [email protected]'
url = 'https://github.com/NHERI-SimCenter/SimCenterBackendApplications'
settings = { # noqa: RUF012
settings = {
'os': None,
'build_type': None,
'compiler': None,
'arch': ['x86_64', 'armv8'],
}
options = {'shared': [True, False]} # noqa: RUF012
default_options = { # noqa: RUF012
options = {'shared': [True, False]}
default_options = {
'mkl-static:threaded': False,
'ipp-static:simcenter_backend': True,
'libcurl:with_ssl': 'openssl',
}
generators = 'cmake'
build_policy = 'missing'
requires = [ # noqa: RUF012
requires = [
'jansson/2.13.1',
'zlib/1.2.11',
'libcurl/8.1.1',
Expand All @@ -40,30 +40,30 @@ class simCenterBackendApps(ConanFile): # noqa: D101
_build_subfolder = 'build_subfolder'
# Set short paths for Windows
short_paths = True
scm = { # noqa: RUF012
scm = {
'type': 'git', # Use "type": "svn", if local repo is managed using SVN
'subfolder': _source_subfolder,
'url': 'auto',
'revision': 'auto',
}

def configure(self): # noqa: D102
def configure(self):
self.options.shared = False

def configure_cmake(self): # noqa: D102
def configure_cmake(self):
cmake = CMake(self)
cmake.configure(source_folder=self._source_subfolder)
return cmake

def build(self): # noqa: D102
def build(self):
cmake = self.configure_cmake()
cmake.build()

def package(self): # noqa: D102
def package(self):
self.copy(pattern='LICENSE', dst='licenses', src=self._source_subfolder)
cmake = self.configure_cmake()
cmake.install()
self.copy('*', dst='bin', src=self._source_subfolder + '/applications')

def package_info(self): # noqa: D102
self.env_info.PATH.append(os.path.join(self.package_folder, 'bin')) # noqa: PTH118
def package_info(self):
self.env_info.PATH.append(os.path.join(self.package_folder, 'bin'))
40 changes: 20 additions & 20 deletions modules/Workflow/AggregateResults.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # noqa: INP001, D100
#
# Copyright (c) 2018 Leland Stanford Junior University
# Copyright (c) 2018 The Regents of the University of California
#
Expand Down Expand Up @@ -46,14 +46,14 @@
import pandas as pd


def log_msg(msg): # noqa: D103
print( # noqa: T201
'{} {}'.format(datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S:%fZ')[:-4], msg) # noqa: DTZ003
def log_msg(msg):
print(
'{} {}'.format(datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S:%fZ')[:-4], msg)
)


def main(threads=1): # noqa: C901, D103
headers = dict( # noqa: C408
def main(threads=1):
headers = dict(
IM=[0, 1, 2, 3],
BIM=[
0,
Expand All @@ -68,10 +68,10 @@ def main(threads=1): # noqa: C901, D103
if use_dask:
log_msg(f'{threads} threads requested. Using DASK.')

import math # noqa: PLC0415
import math

from dask import delayed # noqa: PLC0415
from dask.distributed import Client, LocalCluster # noqa: PLC0415
from dask import delayed
from dask.distributed import Client, LocalCluster

@delayed
def read_csv_files(file_list, header):
Expand All @@ -85,13 +85,13 @@ def read_csv_np(file, header):
data[data == ''] = np.nan

tuples = [tuple(h) for h in res[:first_row].T[1:]]
MI = pd.MultiIndex.from_tuples(tuples, names=res[:first_row].T[0]) # noqa: N806
MI = pd.MultiIndex.from_tuples(tuples, names=res[:first_row].T[0])

df = pd.DataFrame( # noqa: PD901
df = pd.DataFrame(
data, columns=MI, index=res[first_row:].T[0], dtype=float
)

return df # noqa: RET504
return df

@delayed
def read_csv_files_np(file_list, header):
Expand All @@ -106,7 +106,7 @@ def read_csv_files_np(file_list, header):
for res_type in ['IM', 'BIM', 'EDP', 'DM', 'DV']:
log_msg(f'Loading {res_type} files...')

files = glob.glob(f'./results/{res_type}/*/{res_type}_*.csv') # noqa: PTH207
files = glob.glob(f'./results/{res_type}/*/{res_type}_*.csv')
# files = files[:1000]

if len(files) > 0:
Expand All @@ -115,7 +115,7 @@ def read_csv_files_np(file_list, header):
chunk = math.ceil(file_count / threads)
df_list = []

print(f'Creating threads for {file_count} files...') # noqa: T201
print(f'Creating threads for {file_count} files...')

for t_i in range(threads):
# print(t_i)
Expand Down Expand Up @@ -152,7 +152,7 @@ def read_csv_files_np(file_list, header):
log_msg('Concatenating all files')
df_all = pd.concat(df_list, axis=0, sort=False)

df_all.sort_index(axis=0, inplace=True) # noqa: PD002
df_all.sort_index(axis=0, inplace=True)

# save the results
log_msg('Saving results')
Expand All @@ -168,7 +168,7 @@ def read_csv_files_np(file_list, header):
# df_all.to_csv('{}.csv'.format(res_type))

else:
print(f'No {res_type} files found') # noqa: T201
print(f'No {res_type} files found')

if use_dask:
log_msg('Closing cluster...')
Expand All @@ -178,7 +178,7 @@ def read_csv_files_np(file_list, header):
# aggregate the realizations files
log_msg('Aggregating individual realizations...')

files = glob.glob( # noqa: PTH207
files = glob.glob(
'./results/{}/*/{}_*.hdf'.format('realizations', 'realizations')
)

Expand All @@ -199,7 +199,7 @@ def read_csv_files_np(file_list, header):

df_all.index = df_all.index.astype(np.int32)

df_all.sort_index(axis=0, inplace=True) # noqa: PD002
df_all.sort_index(axis=0, inplace=True)

try:
df_all.astype(np.float32).to_hdf(
Expand All @@ -210,7 +210,7 @@ def read_csv_files_np(file_list, header):
complevel=1,
complib='blosc:blosclz',
)
except: # noqa: E722
except:
df_all.to_hdf(
'realizations.hdf',
key,
Expand All @@ -228,7 +228,7 @@ def read_csv_files_np(file_list, header):
if __name__ == '__main__':
# Defining the command line arguments

workflowArgParser = argparse.ArgumentParser('Aggregate the results from rWHALE.') # noqa: N816
workflowArgParser = argparse.ArgumentParser('Aggregate the results from rWHALE.')

workflowArgParser.add_argument(
'-threads',
Expand Down
Loading

0 comments on commit d2f6897

Please sign in to comment.