rajgop1 commited on
Commit
cf3fa26
·
1 Parent(s): 5ec37b3

UPdate: files added

Browse files
Files changed (3) hide show
  1. Dockerfile +11 -0
  2. app.py +80 -0
  3. requirements.txt +5 -0
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ COPY . .
10
+
11
+ CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "rajgopal-oil.hf.space"]
app.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hvplot.pandas
2
+ import pandas as pd
3
+ import numpy as np
4
+ import panel as pn
5
+ pn.extension('tabulator')
6
+
7
+
8
+ df = pd.read_excel("Reports.xlsx", sheet_name='Sheet1')
9
+ df["WATER CONTENT%"] = df["WATER CONTENT%"].fillna(0)
10
+ df["WATER CONTENT%"] = df["WATER CONTENT%"].astype(int)
11
+ yaxis_wells = pn.widgets.RadioButtonGroup(
12
+ name='Y axis',
13
+ options=['OIL(MT/DAY)', 'WATER CONTENT%', 'LIQUID RATE(M3/DAY)'],
14
+ button_type='success'
15
+ )
16
+ select_Asset = pn.widgets.Select(name='Asset', options=[
17
+ 'MHN', 'AMD', 'ANK', 'CBY', 'SBS', 'DVP/SIL', 'AGT', 'RJY', 'KKL'])
18
+ select_Year = pn.widgets.Select(name='Year', options=[2021, 2022, 2023])
19
+ unique_wells = df['WELL'].unique().tolist()
20
+ select_Wells = pn.widgets.Select(name='WELL', options=unique_wells)
21
+ select_month = pn.widgets.Select(name='Month', options=df['Month'].unique().tolist())
22
+ idf = df.interactive()
23
+ wells_pipeline = (
24
+ idf[
25
+ (idf.Asset == select_Asset) & (idf.Year==select_Year) & (idf.Month==select_month)]
26
+ .groupby(['Asset','WELL'])[['LIQUID RATE(M3/DAY)','OIL(MT/DAY)', 'WATER CONTENT%']].mean().round(2)
27
+ .reset_index()
28
+ .sort_values(by='OIL(MT/DAY)',ascending=False)
29
+ .reset_index(drop=True)
30
+ )
31
+ well_itable = wells_pipeline.pipe(pn.widgets.Tabulator, pagination='remote', page_size = 10, sizing_mode='stretch_width')
32
+ chart_pipeline = (
33
+ idf[
34
+ (idf.WELL == select_Wells )]
35
+ .groupby(['Asset','WELL', 'Year'])[['LIQUID RATE(M3/DAY)','OIL(MT/DAY)', 'WATER CONTENT%']].mean().round(2)
36
+ .reset_index()
37
+ .sort_values(by='OIL(MT/DAY)',ascending=False)
38
+ .reset_index(drop=True)
39
+ )
40
+ wells_plot = chart_pipeline.hvplot(x = 'Year',y=yaxis_wells,line_width=2, title="Well History since 2021")
41
+
42
+ wells_pipeline1 = (
43
+ idf[
44
+ (idf.Asset == select_Asset) & (idf.Year==select_Year) & (idf.Month==select_month)]
45
+ .groupby(['Asset','WELL', 'Year'])[['TOTAL GAS(M3/DAY)','COND(MT/DAY)']].mean().round(2)
46
+ .reset_index()
47
+ .sort_values(by='TOTAL GAS(M3/DAY)',ascending=False)
48
+ .reset_index(drop=True)
49
+ )
50
+ well_itable1 = wells_pipeline1.pipe(pn.widgets.Tabulator, pagination='remote', page_size = 10, sizing_mode='stretch_width')
51
+ yaxis_wells1 = pn.widgets.RadioButtonGroup(
52
+ name='Y axis',
53
+ options=['TOTAL GAS(M3/DAY)','COND(MT/DAY)'],
54
+ button_type='success'
55
+ )
56
+ chart_pipeline1 = (
57
+ idf[
58
+ (idf.WELL == select_Wells )]
59
+ .groupby(['Asset','WELL', 'Year'])[['TOTAL GAS(M3/DAY)','COND(MT/DAY)']].mean().round(2)
60
+ .reset_index()
61
+ .sort_values(by='TOTAL GAS(M3/DAY)',ascending=False)
62
+ .reset_index(drop=True)
63
+ )
64
+ wells_plot1 = chart_pipeline1.hvplot(x = 'Year',y=yaxis_wells1,line_width=2, title="Well History since 2021")
65
+
66
+ template = pn.template.FastListTemplate(
67
+ title='ONGC wells history',
68
+ sidebar=[pn.pane.Markdown("# Onshore well test history since 2021"),
69
+ pn.pane.Markdown("## Settings")],
70
+ main=[pn.Row(pn.Column(select_Asset, select_Year, select_month, well_itable.panel(width=400), margin=(0,25,0,25)),
71
+ pn.Column(yaxis_wells, select_Wells, wells_plot.panel(width=450), margin=(0,25))),
72
+ pn.Row(pn.Column(select_Asset, select_Year, select_month, well_itable1.panel(width=400), margin=(0,25,0,25)),
73
+ pn.Column(yaxis_wells1, select_Wells, wells_plot1.panel(width=450), margin=(0,25)))
74
+ ],
75
+ accent_base_color="#88d8b0",
76
+ header_background="#88d8b0",
77
+ sidebar_width=100
78
+ )
79
+ # template.show()
80
+ template.servable()
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ panel
2
+ hvplot
3
+ openpyxl
4
+ pandas
5
+ numpy