Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate dc parameter into two #91

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

sbaldu
Copy link
Collaborator

@sbaldu sbaldu commented Feb 21, 2025

This PR separates the dc parameter in two:

  • the usual one, now only used for the calculation of local density
  • a new one, seed_dc used in the kernel for finding clusters

def __init__(self, dc_: float, rhoc_: float, dm_: [float, None] = None, ppbin: int = 10):
self.dc_ = dc_
def __init__(self, dc_: float, rhoc_: float, dm_: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):
self.dc = dc

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Attribute name "dc" doesn't conform to snake_case naming style Warning

Attribute name "dc" doesn't conform to snake_case naming style
@@ -258,13 +261,17 @@
self.elapsed_time = 0.

def set_params(self, dc: float, rhoc: float,
dm: [float, None], ppbin: int = 128) -> None:
self.dc_ = dc
dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128) -> None:

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (102/100) Warning

Line too long (102/100)
bool is_seed{(delta_i > d_c) && (rho_i >= rho_c)};
bool is_outlier{(delta_i > dm) && (rho_i < rho_c)};
bool is_seed{(delta_i > seed_dc) && (rho_i >= rhoc)};
bool is_outlier{(delta_i > dm) && (rho_i < rhoc)};

Check warning

Code scanning / Cppcheck (reported by Codacy)

The scope of the variable 'is_outlier' can be reduced. Warning

The scope of the variable 'is_outlier' can be reduced.
@@ -24,17 +24,26 @@
template <uint8_t Ndim>
class CLUEAlgoAlpaka {
public:
explicit CLUEAlgoAlpaka(float dc, float rhoc, float dm, int pPBin, Queue queue)
: dc_{dc}, rhoc_{rhoc}, dm_{dm}, pointsPerTile_{pPBin} {
explicit CLUEAlgoAlpaka(

Check notice

Code scanning / Cppcheck (reported by Codacy)

Member variable 'CLUEAlgoAlpaka::m_tiles' is not initialized in the constructor. Note

Member variable 'CLUEAlgoAlpaka::m_tiles' is not initialized in the constructor.
explicit CLUEAlgoAlpaka(float dc, float rhoc, float dm, int pPBin, Queue queue)
: dc_{dc}, rhoc_{rhoc}, dm_{dm}, pointsPerTile_{pPBin} {
explicit CLUEAlgoAlpaka(
float dc, float rhoc, float dm, int pPBin, Queue queue, float seed_dc = -1.f)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 17.8 rule Note

MISRA 17.8 rule
TilesAlpaka<Ndim>* tile_buffer)
: dc_{dc}, rhoc_{rhoc}, dm_{dm}, pointsPerTile_{pPBin} {
TilesAlpaka<Ndim>* tile_buffer,
float seed_dc = -1.f)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 17.8 rule Note

MISRA 17.8 rule
TilesAlpaka<Ndim>* tile_buffer,
float seed_dc = -1.f)

: m_dc{dc}, m_seed_dc{seed_dc}, m_rhoc{rhoc}, m_dm{dm}, m_pointsPerTile{pPBin} {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
d_followers =
clue::make_device_buffer<VecArray<int32_t, max_followers>[]>(queue_, reserve);
clue::make_device_buffer<VecArray<int32_t, max_followers>[]>(queue, reserve);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
def __init__(self, dc_: float, rhoc_: float, dm_: [float, None] = None, ppbin: int = 10):
self.dc_ = dc_
def __init__(self, dc_: float, rhoc_: float, dm_: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):
self.dc = dc

Check warning

Code scanning / Pylint (reported by Codacy)

Attribute name "dc" doesn't conform to snake_case naming style Warning

Attribute name "dc" doesn't conform to snake_case naming style
@@ -258,13 +261,17 @@
self.elapsed_time = 0.

def set_params(self, dc: float, rhoc: float,
dm: [float, None], ppbin: int = 128) -> None:
self.dc_ = dc
dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128) -> None:

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (102/100) Warning

Line too long (102/100)
@@ -675,32 +682,32 @@

start = time.time_ns()
if backend == "cpu serial":
cluster_id_is_seed = cpu_serial.mainRun(self.dc_, self.rhoc, self.dm, self.ppbin,
data.coords, data.results,
cluster_id_is_seed = cpu_serial.mainRun(self.dc, self.rhoc, self.dm, self.seed_dc,

Check warning

Code scanning / Prospector (reported by Codacy)

Unused variable 'cluster_id_is_seed' (unused-variable) Warning

Unused variable 'cluster_id_is_seed' (unused-variable)
self.kernel, data.n_dim,
data.n_points, block_size, device_id)
else:
print("CUDA module not found. Please re-compile the library and try again.")

elif backend == "gpu hip":
if hip_found:
cluster_id_is_seed = gpu_hip.mainRun(self.dc_, self.rhoc, self.dm, self.ppbin,
data.coords, data.results,
cluster_id_is_seed = gpu_hip.mainRun(self.dc, self.rhoc, self.dm, self.seed_dc,

Check warning

Code scanning / Prospector (reported by Codacy)

local variable 'cluster_id_is_seed' is assigned to but never used (F841) Warning

local variable 'cluster_id_is_seed' is assigned to but never used (F841)
@@ -675,32 +682,32 @@

start = time.time_ns()
if backend == "cpu serial":
cluster_id_is_seed = cpu_serial.mainRun(self.dc_, self.rhoc, self.dm, self.ppbin,
data.coords, data.results,
cluster_id_is_seed = cpu_serial.mainRun(self.dc, self.rhoc, self.dm, self.seed_dc,

Check notice

Code scanning / Pylintpython3 (reported by Codacy)

Unused variable 'cluster_id_is_seed' Note

Unused variable 'cluster_id_is_seed'
@@ -675,32 +682,32 @@

start = time.time_ns()
if backend == "cpu serial":
cluster_id_is_seed = cpu_serial.mainRun(self.dc_, self.rhoc, self.dm, self.ppbin,
data.coords, data.results,
cluster_id_is_seed = cpu_serial.mainRun(self.dc, self.rhoc, self.dm, self.seed_dc,

Check notice

Code scanning / Pylint (reported by Codacy)

Unused variable 'cluster_id_is_seed' Note

Unused variable 'cluster_id_is_seed'
self.dm = dm_
if dm_ is None:
self.dm = dc_
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):

Check warning

Code scanning / Prospector (reported by Codacy)

Too many arguments (6/5) (too-many-arguments) Warning

Too many arguments (6/5) (too-many-arguments)
self.dm = dm_
if dm_ is None:
self.dm = dc_
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Too many arguments (6/5) Warning

Too many arguments (6/5)
self.dm = dm_
if dm_ is None:
self.dm = dc_
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (122/100) Warning

Line too long (122/100)
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):
self.dc = dc
self.rhoc = rhoc
self.dm = dm

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Attribute name "dm" doesn't conform to snake_case naming style Warning

Attribute name "dm" doesn't conform to snake_case naming style
self.dm = dm_
if dm_ is None:
self.dm = dc_
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):

Check warning

Code scanning / Pylint (reported by Codacy)

Too many arguments (6/5) Warning

Too many arguments (6/5)
self.dm = dm_
if dm_ is None:
self.dm = dc_
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (122/100) Warning

Line too long (122/100)
def __init__(self, dc: float, rhoc: float, dm: [float, None] = None, seed_dc: [float, None] = None, ppbin: int = 128):
self.dc = dc
self.rhoc = rhoc
self.dm = dm

Check warning

Code scanning / Pylint (reported by Codacy)

Attribute name "dm" doesn't conform to snake_case naming style Warning

Attribute name "dm" doesn't conform to snake_case naming style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant