Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def cmda_redevelopment_calculator(uds, num_owners, guideline_value, construction_cost, current_area):
|
| 4 |
+
# Calculations
|
| 5 |
+
normal_fsi_area = 2.0 * uds
|
| 6 |
+
premium_fsi_area = 2.8 * uds
|
| 7 |
+
extra_area = 0.8 * uds # This is the part that needs premium FSI
|
| 8 |
+
|
| 9 |
+
# Premium FSI charges
|
| 10 |
+
premium_fsi_charge = 0.4 * guideline_value * extra_area
|
| 11 |
+
|
| 12 |
+
# Total construction cost (for full 2.8x UDS build)
|
| 13 |
+
total_construction_cost = premium_fsi_area * construction_cost
|
| 14 |
+
|
| 15 |
+
# Area per owner (equal split)
|
| 16 |
+
area_per_owner = premium_fsi_area / num_owners
|
| 17 |
+
uds_per_owner = uds / num_owners
|
| 18 |
+
current_area_per_owner = current_area / num_owners
|
| 19 |
+
|
| 20 |
+
# Benefit per owner
|
| 21 |
+
area_gain_per_owner = area_per_owner - current_area_per_owner
|
| 22 |
+
|
| 23 |
+
return {
|
| 24 |
+
"Normal FSI Buildable Area (2.0 x UDS)": f"{normal_fsi_area:.2f} sq.ft",
|
| 25 |
+
"Max Buildable Area with Premium FSI (2.8 x UDS)": f"{premium_fsi_area:.2f} sq.ft",
|
| 26 |
+
"Extra Area via Premium FSI (0.8 x UDS)": f"{extra_area:.2f} sq.ft",
|
| 27 |
+
"Premium FSI Charges": f"₹ {premium_fsi_charge:,.2f}",
|
| 28 |
+
"Total Construction Cost (at 2.8 x UDS)": f"₹ {total_construction_cost:,.2f}",
|
| 29 |
+
"Built-up Area per Owner": f"{area_per_owner:.2f} sq.ft",
|
| 30 |
+
"Current Area per Owner": f"{current_area_per_owner:.2f} sq.ft",
|
| 31 |
+
"Net Area Gain per Owner": f"{area_gain_per_owner:.2f} sq.ft"
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
# Gradio interface
|
| 35 |
+
inputs = [
|
| 36 |
+
gr.Number(label="Current UDS (in sq.ft)", value=450),
|
| 37 |
+
gr.Number(label="Number of Owners", value=4),
|
| 38 |
+
gr.Number(label="Guideline Value (₹/sq.ft)", value=5000),
|
| 39 |
+
gr.Number(label="Construction Cost (₹/sq.ft)", value=3500),
|
| 40 |
+
gr.Number(label="Current Total Area (in sq.ft)", value=1800)
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
outputs = gr.JSON(label="CMDA Redevelopment Report")
|
| 44 |
+
|
| 45 |
+
app = gr.Interface(
|
| 46 |
+
fn=cmda_redevelopment_calculator,
|
| 47 |
+
inputs=inputs,
|
| 48 |
+
outputs=outputs,
|
| 49 |
+
title="CMDA Redevelopment Calculator (Equal Share Model)",
|
| 50 |
+
description="This calculator estimates redevelopment potential based on UDS, FSI rules, and premium FSI charges. Assumes equal area distribution among owners."
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
if __name__ == "__main__":
|
| 54 |
+
app.launch()
|