Skip to content

Commit

Permalink
update: sort returns
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Dec 6, 2024
1 parent b101eb6 commit dd2229e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/py/mat3ra/made/tools/build/passivation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union
from typing import Union, List

from mat3ra.made.material import Material
from .configuration import PassivationConfiguration
Expand All @@ -23,7 +23,7 @@ def create_passivation(
def get_unique_coordination_numbers(
configuration: PassivationConfiguration,
cutoff: float = 3.0,
) -> set:
) -> List[int]:
"""
Get the unique coordination numbers for the provided passivation configuration as a set type.
Considers the coordination threshold and shadowing radius from the builder parameters if provided.
Expand Down
6 changes: 3 additions & 3 deletions src/py/mat3ra/made/tools/build/passivation/builders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, List, Set
from typing import Dict, List
from mat3ra.made.material import Material
from pydantic import BaseModel, Field
import numpy as np
Expand Down Expand Up @@ -281,7 +281,7 @@ def get_undercoordinated_atom_indices(self, material: Material) -> List[int]:
coordination_numbers = self.get_coordination_numbers(material)
return [idx for idx, number in coordination_numbers.items() if number <= self.coordination_threshold]

def get_unique_coordination_numbers(self, material: Material) -> Set[int]:
def get_unique_coordination_numbers(self, material: Material) -> List[int]:
"""
Get the unique coordination numbers for all atoms in the material.
Expand All @@ -292,7 +292,7 @@ def get_unique_coordination_numbers(self, material: Material) -> Set[int]:
Set[int]: A set of unique coordination numbers present in the material.
"""
coordination_numbers = self.get_coordination_numbers(material)
return set(coordination_numbers.values())
return sorted(list(set(coordination_numbers.values())))

angle_tolerance: float = Field(0.1, description="Tolerance for comparing angles between bond vectors.")
max_bonds_to_passivate: int = Field(
Expand Down

0 comments on commit dd2229e

Please sign in to comment.