Update app.py
Browse files
app.py
CHANGED
@@ -4,17 +4,17 @@ import pandas as pd
|
|
4 |
import numpy as np
|
5 |
|
6 |
|
7 |
-
def plot_usage_volume(system1, users1, timeline1, system2, users2, timeline2
|
8 |
# Create empty dataframe to hold usage data
|
9 |
data = pd.DataFrame(columns=["System", "Month", "Usage"])
|
10 |
|
11 |
# Generate usage data for each system based on typical rollout behaviors
|
12 |
-
for i, system in enumerate([system1, system2
|
13 |
# Calculate the monthly usage volume based on the estimated number of users and timeline
|
14 |
usage = np.concatenate([
|
15 |
-
np.linspace(0, [users1, users2
|
16 |
-
np.linspace([users1, users2
|
17 |
-
np.linspace([users1, users2
|
18 |
])
|
19 |
|
20 |
# Add the usage data to the dataframe
|
@@ -39,16 +39,12 @@ inputs = [
|
|
39 |
gr.inputs.Number(label="System 1 Timeline (months)", default=12),
|
40 |
gr.inputs.Textbox(label="System 2 Name", default="System2"),
|
41 |
gr.inputs.Number(label="System 2 Users", default=500),
|
42 |
-
gr.inputs.Number(label="System 2 Timeline (months)", default=18)
|
43 |
-
gr.inputs.Textbox(label="System 3 Name", default="System3"),
|
44 |
-
gr.inputs.Number(label="System 3 Users", default=2000),
|
45 |
-
gr.inputs.Number(label="System 3 Timeline (months)", default=24)
|
46 |
]
|
47 |
|
48 |
# Define the output component
|
49 |
output = gr.Plot(label="Usage Volume Plot")
|
50 |
|
51 |
-
|
52 |
# Create the interface
|
53 |
iface = gr.Interface(fn=plot_usage_volume, inputs=inputs, outputs=output, title="System Rollout Usage Volume Plot")
|
54 |
|
|
|
4 |
import numpy as np
|
5 |
|
6 |
|
7 |
+
def plot_usage_volume(system1, users1, timeline1, system2, users2, timeline2):
|
8 |
# Create empty dataframe to hold usage data
|
9 |
data = pd.DataFrame(columns=["System", "Month", "Usage"])
|
10 |
|
11 |
# Generate usage data for each system based on typical rollout behaviors
|
12 |
+
for i, system in enumerate([system1, system2]):
|
13 |
# Calculate the monthly usage volume based on the estimated number of users and timeline
|
14 |
usage = np.concatenate([
|
15 |
+
np.linspace(0, [users1, users2][i], int([timeline1, timeline2][i] * 0.25)),
|
16 |
+
np.linspace([users1, users2][i] * 0.5, [users1, users2][i], int([timeline1, timeline2][i] * 0.5)),
|
17 |
+
np.linspace([users1, users2][i], [users1, users2][i] * 0.75, int([timeline1, timeline2][i] * 0.25))
|
18 |
])
|
19 |
|
20 |
# Add the usage data to the dataframe
|
|
|
39 |
gr.inputs.Number(label="System 1 Timeline (months)", default=12),
|
40 |
gr.inputs.Textbox(label="System 2 Name", default="System2"),
|
41 |
gr.inputs.Number(label="System 2 Users", default=500),
|
42 |
+
gr.inputs.Number(label="System 2 Timeline (months)", default=18)
|
|
|
|
|
|
|
43 |
]
|
44 |
|
45 |
# Define the output component
|
46 |
output = gr.Plot(label="Usage Volume Plot")
|
47 |
|
|
|
48 |
# Create the interface
|
49 |
iface = gr.Interface(fn=plot_usage_volume, inputs=inputs, outputs=output, title="System Rollout Usage Volume Plot")
|
50 |
|