44def is_criticality_balanced (temperature , neutrons_emitted ):
55 """Verify criticality is balanced.
66
7- :param temperature: int or float - temperature value in kelvin.
8- :param neutrons_emitted: int or float - number of neutrons emitted per second.
9- :return: bool - is criticality balanced?
10-
11- A reactor is said to be critical if it satisfies the following conditions:
12- - The temperature is less than 800 K.
13- - The number of neutrons emitted per second is greater than 500.
14- - The product of temperature and neutrons emitted per second is less than 500000.
7+ Parameters:
8+ temperature (int or float): The temperature value in kelvin.
9+ neutrons_emitted (int or float): The number of neutrons emitted per second.
10+
11+ Returns:
12+ bool: Is criticality balanced?
13+
14+ Note:
15+ A reactor is said to be balanced in criticality if it satisfies the following conditions:
16+ - The temperature is less than 800 K.
17+ - The number of neutrons emitted per second is greater than 500.
18+ - The product of temperature and neutrons emitted per second is less than 500000.
19+
1520 """
1621
1722 output = temperature * neutrons_emitted
@@ -26,21 +31,24 @@ def is_criticality_balanced(temperature, neutrons_emitted):
2631def reactor_efficiency (voltage , current , theoretical_max_power ):
2732 """Assess reactor efficiency zone.
2833
29- :param voltage: int or float - voltage value.
30- :param current: int or float - current value.
31- :param theoretical_max_power: int or float - power that corresponds to a 100% efficiency .
32- :return: str - one of ('green', 'orange', 'red', or 'black') .
34+ Parameters:
35+ voltage ( int or float): Voltage value.
36+ current ( int or float): Current value .
37+ theoretical_max_power (int or float): The power level that corresponds to a 100% efficiency .
3338
34- Efficiency can be grouped into 4 bands:
39+ Returns:
40+ str: One of ('green', 'orange', 'red', or 'black').
3541
36- 1. green -> efficiency of 80% or more,
37- 2. orange -> efficiency of less than 80% but at least 60%,
38- 3. red -> efficiency below 60%, but still 30% or more,
39- 4. black -> less than 30% efficient.
42+ Note:
43+ Efficiency can be grouped into 4 bands:
44+ 1. green -> efficiency of 80% or more,
45+ 2. orange -> efficiency of less than 80% but at least 60%,
46+ 3. red -> efficiency below 60%, but still 30% or more,
47+ 4. black -> less than 30% efficient.
4048
41- The percentage value is calculated as
42- (generated power/ theoretical max power)*100
43- where generated power = voltage * current
49+ The percentage value is calculated as
50+ (generated power/ theoretical max power)*100
51+ where generated power = voltage * current
4452 """
4553
4654 generated_power = voltage * current
@@ -61,14 +69,18 @@ def reactor_efficiency(voltage, current, theoretical_max_power):
6169def fail_safe (temperature , neutrons_produced_per_second , threshold ):
6270 """Assess and return status code for the reactor.
6371
64- :param temperature: int or float - value of the temperature in kelvin.
65- :param neutrons_produced_per_second: int or float - neutron flux.
66- :param threshold: int or float - threshold for category.
67- :return: str - one of ('LOW', 'NORMAL', 'DANGER').
72+ Parameters:
73+ temperature (int or float): The value of the temperature in kelvin.
74+ neutrons_produced_per_second (int or float): The neutron flux.
75+ threshold (int or float): The threshold for the category.
76+
77+ Returns:
78+ str: One of ('LOW', 'NORMAL', 'DANGER').
6879
69- 1. 'LOW' -> `temperature * neutrons per second` < 90% of `threshold`
70- 2. 'NORMAL' -> `temperature * neutrons per second` +/- 10% of `threshold`
71- 3. 'DANGER' -> `temperature * neutrons per second` is not in the above-stated ranges
80+ Note:
81+ 1. 'LOW' -> `temperature * neutrons per second` < 90% of `threshold`
82+ 2. 'NORMAL' -> `temperature * neutrons per second` +/- 10% of `threshold`
83+ 3. 'DANGER' -> `temperature * neutrons per second` is not in the above-stated ranges
7284 """
7385
7486 output = temperature * neutrons_produced_per_second
0 commit comments