Skip to content

Commit c7497da

Browse files
authored
Merge pull request #146 from utilForever/codacy
Restore Codacy
2 parents 5b786fe + 705f311 commit c7497da

31 files changed

Lines changed: 393 additions & 322 deletions

.codacy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exclude_paths:
2+
- "3RD-PARTY.md"
3+
- "Documents/doxygen/**"
4+
- "Libraries/**"
5+
- "Sources/Core/Flatbuffers/generated/**"

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
build
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
10+
1111
A clear and concise description of what the bug is.
1212

1313
**To Reproduce**
14+
1415
Steps to reproduce the behavior:
16+
1517
1. Go to '...'
1618
2. Click on '....'
1719
3. Scroll down to '....'
1820
4. See error
1921

2022
**Expected behavior**
23+
2124
A clear and concise description of what you expected to happen.
2225

2326
**Screenshots**
27+
2428
If applicable, add screenshots to help explain your problem.
2529

2630
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
31+
32+
- OS: [e.g. iOS]
33+
- Browser [e.g. chrome, safari]
34+
- Version [e.g. 22]
3035

3136
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
37+
38+
- Device: [e.g. iPhone6]
39+
- OS: [e.g. iOS8.1]
40+
- Browser [e.g. stock browser, safari]
41+
- Version [e.g. 22]
3642

3743
**Additional context**
38-
Add any other context about the problem here.
44+
45+
Add any other context about the problem here.

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
popd
2424
mv ../../Doxygen/html ./build
2525
- name: Deploy
26-
uses: JamesIves/github-pages-deploy-action@v4
26+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4
2727
with:
2828
token: ${{ secrets.GITHUB_TOKEN }}
2929
branch: gh-pages

.github/workflows/ubuntu-codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
lcov --gcov-tool "${GCOV_TOOL}" --ignore-errors mismatch --directory build --capture --output-file build/coverage.info
5555
lcov --ignore-errors unused --gcov-tool "${GCOV_TOOL}" --ignore-errors mismatch --remove build/coverage.info '/usr/*' '*/Tests/*' --output-file build/coverage.info.cleaned
5656
- name: Upload Coverage Reports to Codecov
57-
uses: codecov/codecov-action@v5
57+
uses: codecov/codecov-action@04b047e8bb82a0c002c8312c1c880fbc6a999d45 # v5
5858
with:
5959
fail_ci_if_error: true
6060
files: ./build/coverage.info.cleaned

.github/workflows/windows-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
"$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7070
& $nvccExe -V
7171
- name: Add MSBuild to PATH
72-
uses: microsoft/setup-msbuild@v2
72+
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3
7373
- name: Configure Build
7474
shell: powershell
7575
run: |

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Configure Build
3838
run: mkdir build && cd build && cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release ..
3939
- name: Add MSBuild to PATH
40-
uses: microsoft/setup-msbuild@v2
40+
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3
4141
- name: Build
4242
run: cd build && MSBuild.exe ${{ matrix.solution }} /p:Configuration=Release
4343
- name: Run Unit Test

Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ LABEL maintainer "Chris Ohk <utilforever@gmail.com>"
44
ENV DEBIAN_FRONTEND noninteractive
55

66
RUN apt-get update && apt-get install -y \
7-
build-essential \
8-
python3-dev \
9-
python3-pip \
10-
python3-venv \
11-
python3-setuptools \
12-
cmake \
7+
build-essential=12.8ubuntu1.1 \
8+
python3-dev=3.8.2-0ubuntu2 \
9+
python3-pip=20.0.2-5ubuntu1.11 \
1310
--no-install-recommends \
11+
&& pip3 install --no-cache-dir cmake==3.31.6 \
1412
&& rm -rf /var/lib/apt/lists/*
1513

1614
COPY . /app
@@ -21,9 +19,8 @@ RUN cmake .. && \
2119
make install && \
2220
bin/UnitTests
2321

24-
WORKDIR /app/ENV3
25-
RUN pip3 install -r ../requirements.txt && \
26-
pip3 install .. && \
27-
python3 -m pytest ../Tests/PythonTests
22+
WORKDIR /app
23+
RUN pip3 install --no-cache-dir -r requirements.txt . && \
24+
python3 -m pytest Tests/PythonTests
2825

2926
WORKDIR /

Examples/PythonExamples/apic_example_01.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from pyCubbyFlow import * # lgtm [py/polluting-import]
1+
from pyCubbyFlow import (
2+
APICSolver3,
3+
Frame,
4+
Logging,
5+
RigidBodyCollider3,
6+
Sphere3,
7+
VolumeParticleEmitter3,
8+
)
29
import numpy as np
310
import matplotlib.pyplot as plt
411
import matplotlib.animation as animation
@@ -14,8 +21,7 @@ def main():
1421

1522
# Setup emitter
1623
sphere = Sphere3(center=(0.5, 1.0, 0.5), radius=0.15)
17-
emitter = VolumeParticleEmitter3(
18-
implicitSurface=sphere, spacing=1.0 / (2 * resX))
24+
emitter = VolumeParticleEmitter3(implicitSurface=sphere, spacing=1.0 / (2 * resX))
1925
solver.particleEmitter = emitter
2026

2127
# Setup collider
@@ -26,8 +32,10 @@ def main():
2632
# Visualization
2733
fig = plt.figure(figsize=(3, 6))
2834
ax = fig.add_axes([0, 0, 1, 1], frameon=False)
29-
ax.set_xlim(0, 1), ax.set_xticks([])
30-
ax.set_ylim(0, 2), ax.set_yticks([])
35+
ax.set_xlim(0, 1)
36+
ax.set_xticks([])
37+
ax.set_ylim(0, 2)
38+
ax.set_yticks([])
3139

3240
# Make first frame
3341
frame = Frame(0, 1.0 / ANIM_FPS)
@@ -44,13 +52,14 @@ def updateFig(*args):
4452
frame.Advance()
4553
pos = np.array(solver.particleSystemData.positions, copy=False)
4654
scat.set_offsets(np.vstack((pos[:, 0], pos[:, 1])).transpose())
47-
return scat,
55+
return (scat,)
4856

49-
animation.FuncAnimation(fig, updateFig, frames=ANIM_NUM_FRAMES,
50-
interval=1, blit=True)
57+
animation.FuncAnimation(
58+
fig, updateFig, frames=ANIM_NUM_FRAMES, interval=1, blit=True
59+
)
5160
plt.show()
5261

5362

54-
if __name__ == '__main__':
63+
if __name__ == "__main__":
5564
Logging.Mute()
5665
main()

Examples/PythonExamples/apic_example_02.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
from pyCubbyFlow import * # lgtm [py/polluting-import]
1+
from pyCubbyFlow import (
2+
APICSolver3,
3+
FDMMGPCGSolver3,
4+
Frame,
5+
GridFractionalSinglePhasePressureSolver3,
6+
Logging,
7+
RigidBodyCollider3,
8+
Sphere3,
9+
VolumeParticleEmitter3,
10+
)
211
import numpy as np
312
import matplotlib.pyplot as plt
413
import matplotlib.animation as animation
@@ -18,8 +27,7 @@ def main():
1827

1928
# Setup emitter
2029
sphere = Sphere3(center=(0.5, 1.0, 0.5), radius=0.15)
21-
emitter = VolumeParticleEmitter3(
22-
implicitSurface=sphere, spacing=1.0 / (2 * resX))
30+
emitter = VolumeParticleEmitter3(implicitSurface=sphere, spacing=1.0 / (2 * resX))
2331
solver.particleEmitter = emitter
2432

2533
# Setup collider
@@ -30,8 +38,10 @@ def main():
3038
# Visualization
3139
fig = plt.figure(figsize=(3, 6))
3240
ax = fig.add_axes([0, 0, 1, 1], frameon=False)
33-
ax.set_xlim(0, 1), ax.set_xticks([])
34-
ax.set_ylim(0, 2), ax.set_yticks([])
41+
ax.set_xlim(0, 1)
42+
ax.set_xticks([])
43+
ax.set_ylim(0, 2)
44+
ax.set_yticks([])
3545

3646
# Make first frame
3747
frame = Frame(0, 1.0 / ANIM_FPS)
@@ -48,13 +58,14 @@ def updateFig(*args):
4858
frame.Advance()
4959
pos = np.array(solver.particleSystemData.positions, copy=False)
5060
scat.set_offsets(np.vstack((pos[:, 0], pos[:, 1])).transpose())
51-
return scat,
61+
return (scat,)
5262

53-
animation.FuncAnimation(fig, updateFig, frames=ANIM_NUM_FRAMES,
54-
interval=1, blit=True)
63+
animation.FuncAnimation(
64+
fig, updateFig, frames=ANIM_NUM_FRAMES, interval=1, blit=True
65+
)
5566
plt.show()
5667

5768

58-
if __name__ == '__main__':
69+
if __name__ == "__main__":
5970
Logging.Mute()
6071
main()

0 commit comments

Comments
 (0)