Skip to content

Commit 071fc46

Browse files
authored
Updated stub docstrings to follow Google style. (#4145)
1 parent c277620 commit 071fc46

1 file changed

Lines changed: 39 additions & 27 deletions

File tree

exercises/concept/meltdown-mitigation/conditionals.py

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
def 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 balanced in criticality 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
pass
@@ -20,21 +25,24 @@ def is_criticality_balanced(temperature, neutrons_emitted):
2025
def reactor_efficiency(voltage, current, theoretical_max_power):
2126
"""Assess reactor efficiency zone.
2227
23-
:param voltage: int or float - voltage value.
24-
:param current: int or float - current value.
25-
:param theoretical_max_power: int or float - power that corresponds to a 100% efficiency.
26-
:return: str - one of ('green', 'orange', 'red', or 'black').
28+
Parameters:
29+
voltage (int or float): Voltage value.
30+
current (int or float): Current value.
31+
theoretical_max_power (int or float): The power level that corresponds to a 100% efficiency.
2732
28-
Efficiency can be grouped into 4 bands:
33+
Returns:
34+
str: One of ('green', 'orange', 'red', or 'black').
2935
30-
1. green -> efficiency of 80% or more,
31-
2. orange -> efficiency of less than 80% but at least 60%,
32-
3. red -> efficiency below 60%, but still 30% or more,
33-
4. black -> less than 30% efficient.
36+
Note:
37+
Efficiency can be grouped into 4 bands:
38+
1. green -> efficiency of 80% or more,
39+
2. orange -> efficiency of less than 80% but at least 60%,
40+
3. red -> efficiency below 60%, but still 30% or more,
41+
4. black -> less than 30% efficient.
3442
35-
The percentage value is calculated as
36-
(generated power/ theoretical max power)*100
37-
where generated power = voltage * current
43+
The percentage value is calculated as
44+
(generated power/ theoretical max power)*100
45+
where generated power = voltage * current
3846
"""
3947

4048
pass
@@ -43,14 +51,18 @@ def reactor_efficiency(voltage, current, theoretical_max_power):
4351
def fail_safe(temperature, neutrons_produced_per_second, threshold):
4452
"""Assess and return status code for the reactor.
4553
46-
:param temperature: int or float - value of the temperature in kelvin.
47-
:param neutrons_produced_per_second: int or float - neutron flux.
48-
:param threshold: int or float - threshold for category.
49-
:return: str - one of ('LOW', 'NORMAL', 'DANGER').
54+
Parameters:
55+
temperature (int or float): The value of the temperature in kelvin.
56+
neutrons_produced_per_second (int or float): The neutron flux.
57+
threshold (int or float): The threshold for the category.
58+
59+
Returns:
60+
str: One of ('LOW', 'NORMAL', 'DANGER').
5061
51-
1. 'LOW' -> `temperature * neutrons per second` < 90% of `threshold`
52-
2. 'NORMAL' -> `temperature * neutrons per second` +/- 10% of `threshold`
53-
3. 'DANGER' -> `temperature * neutrons per second` is not in the above-stated ranges
62+
Note:
63+
1. 'LOW' -> `temperature * neutrons per second` < 90% of `threshold`
64+
2. 'NORMAL' -> `temperature * neutrons per second` +/- 10% of `threshold`
65+
3. 'DANGER' -> `temperature * neutrons per second` is not in the above-stated ranges
5466
"""
5567

5668
pass

0 commit comments

Comments
 (0)