From dd2229eed6913d254cd0350f87761b722520db86 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:56:13 -0800 Subject: [PATCH] update: sort returns --- src/py/mat3ra/made/tools/build/passivation/__init__.py | 4 ++-- src/py/mat3ra/made/tools/build/passivation/builders.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/py/mat3ra/made/tools/build/passivation/__init__.py b/src/py/mat3ra/made/tools/build/passivation/__init__.py index 2feba8d0..0033dd16 100644 --- a/src/py/mat3ra/made/tools/build/passivation/__init__.py +++ b/src/py/mat3ra/made/tools/build/passivation/__init__.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Union, List from mat3ra.made.material import Material from .configuration import PassivationConfiguration @@ -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. diff --git a/src/py/mat3ra/made/tools/build/passivation/builders.py b/src/py/mat3ra/made/tools/build/passivation/builders.py index 0b0dfbdc..e734d87b 100644 --- a/src/py/mat3ra/made/tools/build/passivation/builders.py +++ b/src/py/mat3ra/made/tools/build/passivation/builders.py @@ -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 @@ -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. @@ -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(