Skip to content

Commit

Permalink
Merge pull request #230 from vincentcasseau/main
Browse files Browse the repository at this point in the history
Github Actions: autopep8 formatter - adding more error codes to match that of Fast
  • Loading branch information
vincentcasseau authored Dec 5, 2024
2 parents 5bdafa9 + 768a43c commit 4f0d6b3
Show file tree
Hide file tree
Showing 1,049 changed files with 9,221 additions and 9,641 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/autopep8_formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ jobs:
- name: Run autopep8
run: |
pythonFiles=`find Cassiopee/ -type f -not -path "*/build/*" -not -path "*/ThirdParty/*" -name "*.py" -not -name "Internal.py"`
autopep8 --in-place --indent-size=4 --select=E101 \
$pythonFiles
autopep8 --in-place --indent-size=2 --select=E101 \
Cassiopee/Converter/Converter/Internal.py
errorCodes="E101,E11,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E251,E252,E711,E713,E714,E721,E722,W291,W293,W391"
autopep8 --in-place --indent-size=4 --select=$errorCodes $pythonFiles
autopep8 --in-place --indent-size=2 --select=$errorCodes Cassiopee/Converter/Converter/Internal.py
- name: Commit changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Apps/Apps/App.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General class of Cassiopee App
# Data oriented
# Data oriented
# One method: run

__version__ = '3.1'
Expand Down
16 changes: 8 additions & 8 deletions Cassiopee/Apps/Apps/Chimera/Chimera.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Converter.PyTree as C
import Converter.Internal as Internal
import Converter.Internal as Internal
import Post.PyTree as P
import Transform.PyTree as T
import Converter.Filter as Filter
Expand All @@ -9,7 +9,7 @@
import Geom.PyTree as D

IMETHOD = 'AABB'
# Extraction de la solution sur une surface dans le plan (X,R) a partir d un maillage recouvrant
# Extraction de la solution sur une surface dans le plan (X,R) a partir d un maillage recouvrant
# et d une courbe ou un nuage de points definis dans le plan(X,R)
# t_sol et t_pts sont dans le systeme de coordonnees cartesiennes
# t_sol et t_pts sont des fichiers
Expand All @@ -31,7 +31,7 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1.,
C.convertPyTree2File(PtsXR,"Pts_XR.cgns")
DTheta=C.getMaxValue(PtsXR,"CoordinateZ")-C.getMinValue(PtsXR,"CoordinateZ")

if isinstance(t_sol,str):
if isinstance(t_sol,str):
h = Filter.Handle(t_sol)
t = h.loadSkeleton()
h._loadZonesWoVars(t)
Expand Down Expand Up @@ -79,10 +79,10 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1.,
# resBB = G.BB(res,method=IMETHOD)
res = XOR.conformUnstr(res,tol=0.,itermax=1)

if isinstance(t_sol,str):
if isinstance(t_sol,str):
if len(variables)==0:# on interpole tout
t = C.convertFile2PyTree(t_sol)
else:
else:
h = Filter.Handle(t_sol)
t = h.loadSkeleton()
h._loadZonesWoVars(t)
Expand All @@ -97,22 +97,22 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1.,
if G.bboxIntersection(resBB,zbbd,method=IMETHOD,isBB=True)==1:
zd = Internal.getNodeFromName(t,zbbd[0])
dnrZones.append(zd)
P._extractMesh(dnrZones,res,order=2,constraint=10.,mode=mode)
P._extractMesh(dnrZones,res,order=2,constraint=10.,mode=mode)
C._rmVars(res,[cellNName])
return res

def extractIJSurface(t_sol, t_pts, XC=(0.,0.,0.), AXIS=(1.,0.,0.), loc='centers', cellNName='cellN',variables=[]):
# distrib en i (le long de la ligne) et j
NI = 101; NJ = 201
dhi = G.cart((0.,0.,0.),(1./(NI-1),1,1),(NI,1,1))
# on peut mettre un resserrement :
# on peut mettre un resserrement :
# dhi = G.enforcePlusX(dhi, ...
dhj = G.cart((0.,0.,0.),(1./(NJ-1),1,1),(NJ,1,1))

if loc == 'centers': cellNName2 = 'centers:'+cellNName
else: cellNName2 = cellNName

if isinstance(t_sol,str):
if isinstance(t_sol,str):
h = Filter.Handle(t_sol)
t = h.loadSkeleton()
h._loadZonesWoVars(t)
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Apps/Apps/Chimera/ExtractDoublyDefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _extrapOnBCDataSet(t, variables):

for var in variables:
v = var.split(':',1)
if len(v) == 2:
if len(v) == 2:
if v[0] == 'centers' or v[0] == 'nodes': v = v[1]
else: v = var
else: v = var
Expand Down
1 change: 0 additions & 1 deletion Cassiopee/Apps/Apps/Chimera/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Loading

0 comments on commit 4f0d6b3

Please sign in to comment.