11import re
22
3- from . import f
43from . import _option
4+ from .... import types
55from .... import errors
66
77
@@ -13,56 +13,58 @@ class Cel_1(_option.SdefOption):
1313 _KEYWORD = 'cel'
1414
1515 _ATTRS = {
16- 'option ' : f . FOption ,
16+ 'number ' : types . Distribution ,
1717 }
1818
19- _REGEX = re .compile (rf'\Acel( (?: { f . FOption ._REGEX .pattern [2 :- 2 ]} ) )\Z' , re .IGNORECASE )
19+ _REGEX = re .compile (rf'\Acel( { types . Distribution ._REGEX .pattern [2 :- 2 ]} )\Z' , re .IGNORECASE )
2020
21- def __init__ (self , option : str | f . FOption ):
21+ def __init__ (self , number : str | int | types . Distribution ):
2222 """
2323 Initializes ``Cel_1``.
2424
2525 Parameters:
26- option: Dependent distribution option .
26+ number: Cell number .
2727
2828 Raises:
2929 InpError: SEMANTICS_OPTION.
3030 """
3131
32- self .option : f . FOption = option
32+ self .number : types . Distribution = number
3333
3434 @property
35- def option (self ) -> f . FOption :
35+ def number (self ) -> types . Distribution :
3636 """
37- Dependent distribution option
37+ Cell number
3838
3939 Raises:
4040 InpError: SEMANTICS_OPTION.
4141 TypeError:
4242 """
4343
44- return self ._option
44+ return self ._number
4545
46- @option .setter
47- def option (self , option : str | f . FOption ) -> None :
46+ @number .setter
47+ def number (self , number : str | int | types . Distribution ) -> None :
4848 """
49- Sets ``option ``.
49+ Sets ``number ``.
5050
5151 Parameters:
52- option: Dependent distribution option .
52+ number: Cell number .
5353
5454 Raises:
5555 InpError: SEMANTICS_OPTION.
5656 TypeError:
5757 """
5858
59- if option is not None :
60- if isinstance (option , f .FOption ):
61- option = option
62- elif isinstance (option , str ):
63- option = f .FOption .from_mcnp (option )
59+ if number is not None :
60+ if isinstance (number , types .Distribution ):
61+ number = number
62+ elif isinstance (number , int ):
63+ number = types .Distribution (number )
64+ elif isinstance (number , str ):
65+ number = types .Distribution .from_mcnp (number )
6466
65- if option is None :
66- raise errors .InpError (errors .InpCode .SEMANTICS_OPTION , option )
67+ if number is None :
68+ raise errors .InpError (errors .InpCode .SEMANTICS_OPTION , number )
6769
68- self ._option : f . FOption = option
70+ self ._number : types . Distribution = number
0 commit comments