File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# ===============================================================================
1616from 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 =============================================
You can’t perform that action at this time.
0 commit comments