11# Copyright 2026, Battelle Energy Alliance, LLC All Rights Reserved.
2+ from __future__ import annotations
3+
4+ import montepy
25from .surface_type import SurfaceType
36from .surface import Surface , InitInput
47from montepy .exceptions import *
58from montepy .utilities import *
6-
7- from numbers import Real
8- from typing import Union
9+ import montepy .types as ty
910
1011
1112def _enforce_positive_radius (self , value ):
@@ -26,10 +27,12 @@ class GeneralSphere(Surface):
2627 The number to set for this object.
2728 """
2829
30+ @args_checked
2931 def __init__ (
3032 self ,
3133 input : InitInput = None ,
32- number : int = None ,
34+ number : ty .PositiveInt = None ,
35+ surface_type : SurfaceType | str = None ,
3336 ):
3437 self ._coordinates = [
3538 self ._generate_default_node (float , None ),
@@ -72,14 +75,10 @@ def coordinates(self):
7275 return tuple (c .value for c in self ._coordinates )
7376
7477 @coordinates .setter
75- def coordinates (self , coordinates ):
76- if not isinstance (coordinates , (list , tuple )):
77- raise TypeError ("coordinates must be a list" )
78+ @args_checked
79+ def coordinates (self , coordinates : ty .Iterable [ty .Real ]):
7880 if len (coordinates ) != 3 :
7981 raise ValueError ("coordinates must have exactly three elements" )
80- for val in coordinates :
81- if not isinstance (val , Real ):
82- raise TypeError (f"Coordinate must be a number. { val } given." )
8382 for i , val in enumerate (coordinates ):
8483 self ._coordinates [i ].value = val
8584
@@ -90,6 +89,9 @@ def validate(self):
9089 if any ({c is None for c in self .coordinates }):
9190 raise IllegalState (f"Surface: { self .number } does not have coordinates set." )
9291
93- def find_duplicate_surfaces (self , surfaces , tolerance ): # pragma: no cover
92+ @args_checked
93+ def find_duplicate_surfaces (
94+ self , surfaces : montepy .Surfaces , tolerance : ty .PositiveReal
95+ ): # pragma: no cover
9496 """Duplicate sphere finding is not yet implemented"""
9597 return []
0 commit comments