Skip to content

Commit

Permalink
Merge pull request #260 from janezd/fr-fix-division
Browse files Browse the repository at this point in the history
FR: Divide into double, not Py_ssize_t
  • Loading branch information
janezd authored Oct 26, 2023
2 parents 3cd58f9 + 1bf2dfd commit 6cd0ee5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions orangecontrib/network/network/layout/_fr_layout.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#cython: boundscheck=False
#cython: wraparound=False
#cython: initializedcheck=False
#cython: cdivision=True
#cython: embedsignature=True
#cython: infer_types=False
#cython: language_level=3
Expand Down Expand Up @@ -70,7 +69,7 @@ cpdef void repulse_sampled(arr_f2_t pos, arr_i1_t sample,
Py_ssize_t i, j, s

Py_ssize_t sample_size = sample.shape[0]
Py_ssize_t inv_sample_ratio = n_nodes / sample_size
double inv_sample_ratio = n_nodes / sample_size
double k2 = sqr(k)

for i in range(n_nodes):
Expand Down Expand Up @@ -168,9 +167,6 @@ def fruchterman_reingold_step(arr_f2_t pos,
Py_ssize_t n_nodes = pos.shape[0]
Py_ssize_t n_dim = pos.shape[1]

Py_ssize_t sample_size = sample.shape[0]
Py_ssize_t inv_sample_ratio = n_nodes / sample_size

with nogil:
disp[:, :] = 0
attract(pos, edge_src, edge_dst, edge_weights, k, disp)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ deps =
{env:PYQT_PYPI_NAME:PyQt5}=={env:PYQT_PYPI_VERSION:5.15.*}
{env:WEBENGINE_PYPI_NAME:PyQtWebEngine}=={env:WEBENGINE_PYPI_VERSION:5.15.*}
oldest: orange3==3.34.0
oldest: pandas<2.1
latest: https://github.com/biolab/orange3/archive/refs/heads/master.zip#egg=orange3
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
latest: https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
Expand Down

0 comments on commit 6cd0ee5

Please sign in to comment.