Skip to content

Commit 6ced3c7

Browse files
committed
pre-commit run --all-files
1 parent 56847d2 commit 6ced3c7

File tree

344 files changed

+12238
-9726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+12238
-9726
lines changed

.flake8

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[flake8]
2-
max-line-length = 100
3-
ignore = D100,D101,D102,D103,D104,D105,D200,D201,D202,D204,D205,D208,D209,D210,D300,D301,D400,D401,D403,E24,E121,E123,E126,E226,E266,E402,E704,E731,F821,I100,I101,I201,N802,N803,N804,N806,W503,W504,W605
2+
max-line-length = 88
3+
ignore = D100,D101,D102,D103,D104,D105,D200,D201,D202,D204,D205,D208,D209,D210,D300,D301,D400,D401,D403,E24,E121,E123,E126,E226,E266,E402,E704,E731,F821,I100,I101,I201,N802,N803,N804,N806,W503,W504,W605, E203
44
exclude =
55
.git
66
__pycache__
77
build
88
dist
99
fury/_version.py
1010
docs/source/conf.py
11+
docs/experimental
1112
*test*
1213
*sphinx*
13-
*/__init__.py
14+
*/__init__.py

.git_archival.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node: $Format:%H$
22
node-date: $Format:%cI$
33
describe-name: $Format:%(describe:match=[0-9]*)$
4-
ref-names: $Format:%D$
4+
ref-names: $Format:%D$

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,3 @@ tmp/
107107
temp/
108108

109109
_version.py
110-

.mailmap

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Hariharan Ayappane <hari.ayapps@gmail.com> haran2001 <56040092+haran2001@users.n
5252
Praneeth Shetty <praneethshetty10@gmail.com> ganimtron-10 <praneethshetty10@gmail.com>
5353
Praneeth Shetty <praneethshetty10@gmail.com> Praneeth Shetty <64432063+ganimtron-10@users.noreply.github.com>
5454
Anand Shivam <anandshivam54321@gmail.com> Xtanion <anandshivam54321@gmail.com>
55-
Meha Bhalodiya <mehabhalodiya@gmail.com> mehabhalodiya <mehabhalodiya@gmail.com>
55+
Meha Bhalodiya <mehabhalodiya@gmail.com> mehabhalodiya <mehabhalodiya@gmail.com>

.pep8speaks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ message: # Customize the comment made by the bot
99
updated: # Messages when new commits are added to the PR
1010
header: "Hello @{name}, Thank you for updating!"
1111
footer: "To test for issues locally, `pip install flake8` and then run `flake8 fury`."
12-
no_errors: "Cheers! There are no style issues detected in this Pull Request. :beers: "
12+
no_errors: "Cheers! There are no style issues detected in this Pull Request. :beers: "

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
exclude: ".*/data/.*"
1+
exclude: ".*/(data|docs/experimental)/.*"
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.1.0
4+
rev: v4.4.0
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
@@ -25,7 +25,7 @@ repos:
2525
rev: 6.0.0
2626
hooks:
2727
- id: flake8
28-
exclude: "^(doc|tools)/"
28+
exclude: "^(docs/experimental|tools)/"
2929
- repo: https://github.com/pre-commit/mirrors-mypy
3030
rev: v0.991
3131
hooks:
@@ -42,7 +42,7 @@ repos:
4242
args: ["fury"]
4343
pass_filenames: false
4444
- repo: https://github.com/pre-commit/pre-commit-hooks
45-
rev: v3.2.0
45+
rev: v4.4.0
4646
hooks:
4747
- id: detect-aws-credentials
48-
- id: detect-private-key
48+
- id: detect-private-key

AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ Contributors
8484
* Jacob Wasserth
8585
* Yaroslav Halchenko
8686
* MIHIR
87-
* Shivam Anand
87+
* Shivam Anand

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2323
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2424
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2525
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ci/activate_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ else
1010
echo Cannot activate virtual environment
1111
ls -R venv
1212
false
13-
fi
13+
fi

ci/azure-pipelines.yml.old

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ jobs:
7676
else {
7777
exit $overall_code
7878
}
79-
displayName: 'Run Tests'
79+
displayName: 'Run Tests'

ci/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ elif [ "$INSTALL_TYPE" == "conda" ]; then
3333
$PIPI .
3434
fi
3535

36-
set +ex
36+
set +ex

ci/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ else
4444
done
4545
fi
4646

47-
set +ex
47+
set +ex

ci/travis/deploy_docs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ then
3535
)
3636
else
3737
echo "-- will only push docs from master --"
38-
fi
38+
fi

ci/windows/install_opengl.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ function main () {
4848
DownloadMesaOpenGL "64"
4949
}
5050

51-
main
51+
main

ci/windows/run_with_env.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ IF %PYTHON_ARCH% == 64 (
8585
ECHO Using default MSVC build environment for 32 bit architecture
8686
ECHO Executing: %COMMAND_TO_RUN%
8787
call %COMMAND_TO_RUN% || EXIT 1
88-
)
88+
)

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ To generate the documentation without running the examples:
4444
```bash
4545
$ make clean
4646
$ make html-no-examples
47-
```
47+
```

docs/examples/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Demos
22
=====
33

4-
Below is a gallery of Demos. A bunch of apps powered by FURY.
4+
Below is a gallery of Demos. A bunch of apps powered by FURY.

docs/examples/collision-particles.py

+59-46
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,31 @@
1313
# as the particle with higher velocity. For simplicity, in this demo we
1414
# do not apply forces.
1515

16-
import numpy as np
17-
from fury import window, actor, ui, utils
1816
import itertools
1917

18+
import numpy as np
19+
20+
from fury import actor, ui, utils, window
2021

2122
##############################################################################
2223
# Here, we define the edges of the box.
2324

2425

2526
def box_edges(box_lx, box_ly, box_lz):
2627

27-
edge1 = 0.5 * np.array([[box_lx, box_ly, box_lz],
28-
[box_lx, box_ly, -box_lz],
29-
[-box_lx, box_ly, -box_lz],
30-
[-box_lx, box_ly, box_lz],
31-
[box_lx, box_ly, box_lz]])
32-
edge2 = 0.5 * np.array([[box_lx, box_ly, box_lz],
33-
[box_lx, -box_ly, box_lz]])
34-
edge3 = 0.5 * np.array([[box_lx, box_ly, -box_lz],
35-
[box_lx, -box_ly, -box_lz]])
36-
edge4 = 0.5 * np.array([[-box_lx, box_ly, -box_lz],
37-
[-box_lx, -box_ly, -box_lz]])
38-
edge5 = 0.5 * np.array([[-box_lx, box_ly, box_lz],
39-
[-box_lx, -box_ly, box_lz]])
28+
edge1 = 0.5 * np.array(
29+
[
30+
[box_lx, box_ly, box_lz],
31+
[box_lx, box_ly, -box_lz],
32+
[-box_lx, box_ly, -box_lz],
33+
[-box_lx, box_ly, box_lz],
34+
[box_lx, box_ly, box_lz],
35+
]
36+
)
37+
edge2 = 0.5 * np.array([[box_lx, box_ly, box_lz], [box_lx, -box_ly, box_lz]])
38+
edge3 = 0.5 * np.array([[box_lx, box_ly, -box_lz], [box_lx, -box_ly, -box_lz]])
39+
edge4 = 0.5 * np.array([[-box_lx, box_ly, -box_lz], [-box_lx, -box_ly, -box_lz]])
40+
edge5 = 0.5 * np.array([[-box_lx, box_ly, box_lz], [-box_lx, -box_ly, box_lz]])
4041
lines = [edge1, -edge1, edge2, edge3, edge4, edge5]
4142
return lines
4243

@@ -46,41 +47,55 @@ def box_edges(box_lx, box_ly, box_lz):
4647
# When collision happens, the particle with lower velocity gets the
4748
# color of the particle with higher velocity
4849

50+
4951
def collision():
5052
global xyz
5153
num_vertices = vertices.shape[0]
5254
sec = int(num_vertices / num_particles)
5355

5456
for i, j in np.ndindex(num_particles, num_particles):
5557

56-
if (i == j):
58+
if i == j:
5759
continue
5860
distance = np.linalg.norm(xyz[i] - xyz[j])
5961
vel_mag_i = np.linalg.norm(vel[i])
6062
vel_mag_j = np.linalg.norm(vel[j])
6163
# Collision happens if the distance between the centers of two
6264
# particles is less or equal to the sum of their radii
63-
if (distance <= (radii[i] + radii[j])):
65+
if distance <= (radii[i] + radii[j]):
6466
vel[i] = -vel[i]
6567
vel[j] = -vel[j]
6668
if vel_mag_j > vel_mag_i:
67-
vcolors[i * sec: i * sec + sec] = \
68-
vcolors[j * sec: j * sec + sec]
69+
vcolors[i * sec : i * sec + sec] = vcolors[j * sec : j * sec + sec]
6970
if vel_mag_i > vel_mag_j:
70-
vcolors[j * sec: j * sec + sec] = \
71-
vcolors[i * sec: i * sec + sec]
71+
vcolors[j * sec : j * sec + sec] = vcolors[i * sec : i * sec + sec]
7272
xyz[i] = xyz[i] + vel[i] * dt
7373
xyz[j] = xyz[j] + vel[j] * dt
7474
# Collision between particles-walls;
75-
vel[:, 0] = np.where(((xyz[:, 0] <= - 0.5 * box_lx + radii[:]) |
76-
(xyz[:, 0] >= (0.5 * box_lx - radii[:]))),
77-
- vel[:, 0], vel[:, 0])
78-
vel[:, 1] = np.where(((xyz[:, 1] <= - 0.5 * box_ly + radii[:]) |
79-
(xyz[:, 1] >= (0.5 * box_ly - radii[:]))),
80-
- vel[:, 1], vel[:, 1])
81-
vel[:, 2] = np.where(((xyz[:, 2] <= -0.5 * box_lz + radii[:]) |
82-
(xyz[:, 2] >= (0.5 * box_lz - radii[:]))),
83-
- vel[:, 2], vel[:, 2])
75+
vel[:, 0] = np.where(
76+
(
77+
(xyz[:, 0] <= -0.5 * box_lx + radii[:])
78+
| (xyz[:, 0] >= (0.5 * box_lx - radii[:]))
79+
),
80+
-vel[:, 0],
81+
vel[:, 0],
82+
)
83+
vel[:, 1] = np.where(
84+
(
85+
(xyz[:, 1] <= -0.5 * box_ly + radii[:])
86+
| (xyz[:, 1] >= (0.5 * box_ly - radii[:]))
87+
),
88+
-vel[:, 1],
89+
vel[:, 1],
90+
)
91+
vel[:, 2] = np.where(
92+
(
93+
(xyz[:, 2] <= -0.5 * box_lz + radii[:])
94+
| (xyz[:, 2] >= (0.5 * box_lz - radii[:]))
95+
),
96+
-vel[:, 2],
97+
vel[:, 2],
98+
)
8499

85100

86101
##############################################################################
@@ -94,8 +109,9 @@ def collision():
94109
box_lz = 10
95110
steps = 1000
96111
dt = 0.05
97-
xyz = np.array([box_lx, box_ly, box_lz]) * (np.random.rand(num_particles, 3)
98-
- 0.5) * 0.6
112+
xyz = (
113+
np.array([box_lx, box_ly, box_lz]) * (np.random.rand(num_particles, 3) - 0.5) * 0.6
114+
)
99115
vel = 4 * (np.random.rand(num_particles, 3) - 0.5)
100116
colors = np.random.rand(num_particles, 3)
101117
radii = np.random.rand(num_particles) + 0.01
@@ -108,22 +124,21 @@ def collision():
108124
box_centers = np.array([[0, 0, 0]])
109125
box_directions = np.array([[0, 1, 0]])
110126
box_colors = np.array([[1, 1, 1, 0.2]])
111-
box_actor = actor.box(box_centers, box_directions, box_colors,
112-
scales=(box_lx, box_ly, box_lz))
127+
box_actor = actor.box(
128+
box_centers, box_directions, box_colors, scales=(box_lx, box_ly, box_lz)
129+
)
113130
scene.add(box_actor)
114131

115132
lines = box_edges(box_lx, box_ly, box_lz)
116133
line_actor = actor.streamtube(lines, colors=(1, 0.5, 0), linewidth=0.1)
117134
scene.add(line_actor)
118135

119-
sphere_actor = actor.sphere(centers=xyz,
120-
colors=colors,
121-
radii=radii)
136+
sphere_actor = actor.sphere(centers=xyz, colors=colors, radii=radii)
122137
scene.add(sphere_actor)
123138

124-
showm = window.ShowManager(scene,
125-
size=(900, 768), reset_camera=True,
126-
order_transparent=True)
139+
showm = window.ShowManager(
140+
scene, size=(900, 768), reset_camera=True, order_transparent=True
141+
)
127142

128143
tb = ui.TextBlock2D(bold=True)
129144
scene.zoom(0.8)
@@ -134,9 +149,8 @@ def collision():
134149

135150
vertices = utils.vertices_from_actor(sphere_actor)
136151
vcolors = utils.colors_from_actor(sphere_actor, 'colors')
137-
no_vertices_per_sphere = len(vertices)/num_particles
138-
initial_vertices = vertices.copy() - \
139-
np.repeat(xyz, no_vertices_per_sphere, axis=0)
152+
no_vertices_per_sphere = len(vertices) / num_particles
153+
initial_vertices = vertices.copy() - np.repeat(xyz, no_vertices_per_sphere, axis=0)
140154

141155

142156
def timer_callback(_obj, _event):
@@ -146,8 +160,7 @@ def timer_callback(_obj, _event):
146160
xyz = xyz + vel * dt
147161
collision()
148162

149-
vertices[:] = initial_vertices + \
150-
np.repeat(xyz, no_vertices_per_sphere, axis=0)
163+
vertices[:] = initial_vertices + np.repeat(xyz, no_vertices_per_sphere, axis=0)
151164
utils.update_actor(sphere_actor)
152165

153166
scene.reset_clipping_range()
@@ -164,4 +177,4 @@ def timer_callback(_obj, _event):
164177
if interactive:
165178
showm.start()
166179

167-
window.record(showm.scene, size=(900, 768), out_path="simple_collisions.png")
180+
window.record(showm.scene, size=(900, 768), out_path='simple_collisions.png')
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Integrate Physics using pybullet
22
--------------------------------
33

4-
These demos show how to use connect FURY with a physics engine library.
4+
These demos show how to use connect FURY with a physics engine library.

0 commit comments

Comments
 (0)