Skip to content

Commit f9d0090

Browse files
jirhikerCopilot
andauthored
Update transfers/tester.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8e2bd78 commit f9d0090

1 file changed

Lines changed: 35 additions & 5 deletions

File tree

transfers/tester.py

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,41 @@
1515
# ===============================================================================
1616
from transfers.util import get_transferable_wells, read_csv
1717

18-
df = read_csv("WellData")
19-
wells = get_transferable_wells(df)
20-
print(len(wells))
2118

22-
mp = wells[wells["MPHeight"].notna()]
23-
print(len(mp))
19+
def analyze_transferable_wells(csv_name: str = "WellData") -> tuple[int, int]:
20+
"""
21+
Analyze transferable wells from the given CSV source.
2422
23+
Parameters
24+
----------
25+
csv_name : str, optional
26+
The name or path of the CSV data source to read. Defaults to "WellData".
27+
28+
Returns
29+
-------
30+
tuple[int, int]
31+
A tuple containing:
32+
- the total number of transferable wells
33+
- the number of transferable wells with a non-null MPHeight value
34+
"""
35+
df = read_csv(csv_name)
36+
wells = get_transferable_wells(df)
37+
mp = wells[wells["MPHeight"].notna()]
38+
return len(wells), len(mp)
39+
40+
41+
def main() -> None:
42+
"""
43+
Entry point for manual execution.
44+
45+
Reads the default well data source, computes transferable wells and those
46+
with MPHeight defined, and prints their counts.
47+
"""
48+
total_wells, mp_wells = analyze_transferable_wells()
49+
print(total_wells)
50+
print(mp_wells)
51+
52+
53+
if __name__ == "__main__":
54+
main()
2555
# ============= EOF =============================================

0 commit comments

Comments
 (0)