Skip to content

Commit

Permalink
RFC: eliminate some unused deprecated Cython macros
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Mar 18, 2023
1 parent ba88d3e commit 0258316
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
31 changes: 16 additions & 15 deletions yt/geometry/particle_oct_container.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ from ..utilities.lib.ewah_bool_wrap cimport BoolArrayCollection

import os

# If set to 1, ghost cells are added at the refined level regardless of if the
# coarse cell containing it is refined in the selector.
# If set to 0, ghost cells are only added at the refined level if the coarse
# index for the ghost cell is refined in the selector.
DEF RefinedExternalGhosts = 1

_bitmask_version = np.uint64(5)

Expand Down Expand Up @@ -1682,16 +1677,22 @@ cdef class ParticleBitmapSelector:
mi1_n = self.neighbor_list1[m]
mi2_n = self.neighbor_list2[m]
self.coarse_ghosts_bool[mi1_n] = 1
IF RefinedExternalGhosts == 1:
if mi1_n == mi1:
self.refined_ghosts_bool[mi2_n] = 1
else:
self.refined_ghosts_list._set(mi1_n, mi2_n)
ELSE:
if mi1_n == mi1:
self.refined_ghosts_bool[mi2_n] = 1
elif self.is_refined(mi1_n) == 1:
self.refined_ghosts_list._set(mi1_n, mi2_n)

# Ghost cells are added at the refined level regardless of if the
# coarse cell containing it is refined in the selector.
if mi1_n == mi1:
self.refined_ghosts_bool[mi2_n] = 1
else:
self.refined_ghosts_list._set(mi1_n, mi2_n)

# alternative implementation by Megan Lang
# see ed95b1ac2f7105092b1116f9c76568ae27024751
# Ghost cells are only added at the refined level if the coarse
# index for the ghost cell is refined in the selector.
#if mi1_n == mi1:
# self.refined_ghosts_bool[mi2_n] = 1
#elif self.is_refined(mi1_n) == 1:
# self.refined_ghosts_list._set(mi1_n, mi2_n)

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down
2 changes: 0 additions & 2 deletions yt/utilities/lib/_octree_raytracing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import numpy as np

cimport cython

DEF Nch = 4


cdef class _OctreeRayTracing:
def __init__(self, np.ndarray LE, np.ndarray RE, int depth):
Expand Down
2 changes: 0 additions & 2 deletions yt/utilities/lib/amr_kdtools.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ cimport numpy as np
from cython.view cimport array as cvarray
from libc.stdlib cimport free, malloc

DEF Nch = 4

@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
Expand Down
1 change: 0 additions & 1 deletion yt/utilities/lib/grid_traversal.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ from yt.utilities.lib.fp_utils cimport fmin

from .fixed_interpolator cimport *

DEF Nch = 4

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down

0 comments on commit 0258316

Please sign in to comment.