Skip to content

Commit

Permalink
extension to arbitrary types
Browse files Browse the repository at this point in the history
  • Loading branch information
killiansheriff committed Oct 3, 2024
1 parent 0b084b6 commit 4bf55fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WarrenCowleyParameters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def _find_neighbor_indices(self):

def _calculate_concentration(self, particle_types):
unique_types, counts = np.unique(particle_types, return_counts=True)

return unique_types, counts / len(particle_types)

def _create_central_atom_type_mask(self, unique_types, particle_types):
Expand All @@ -164,7 +163,8 @@ def _compute_wc_params(

# Number of i-X bonds
neighbor_counts = np.bincount(
neighbor_types_flat, minlength=len(concentrations) + 1
neighbor_types_flat,
minlength=np.max(self.unique_types) + 1, # len(concentrations) + 1
)

pij = neighbor_counts[unique_types] / (neighbor_types.shape[0] * Nb)
Expand Down

0 comments on commit 4bf55fc

Please sign in to comment.