ppsingh commited on
Commit
98fd7c7
1 Parent(s): 13e8148

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -39
app.py CHANGED
@@ -1,47 +1,11 @@
1
  import streamlit as st
2
- import os
3
- import pkg_resources
4
-
5
- # Using this wacky hack to get around the massively ridicolous managed env loading order
6
- def is_installed(package_name, version):
7
- try:
8
- pkg = pkg_resources.get_distribution(package_name)
9
- return pkg.version == version
10
- except pkg_resources.DistributionNotFound:
11
- return False
12
 
13
  # shifted from below - this must be the first streamlit call; otherwise: problems
14
  st.set_page_config(page_title = 'Climate Policy Intelligence',
15
  initial_sidebar_state='expanded', layout="wide")
16
 
17
- @st.cache_resource # cache the function so it's not called every time app.py is triggered
18
- def install_packages():
19
- install_commands = []
20
-
21
- if not is_installed("spaces", "0.12.0"):
22
- install_commands.append("pip install spaces==0.17.0")
23
-
24
- if not is_installed("pydantic", "1.10.2"):
25
- install_commands.append("pip install pydantic==1.10.2")
26
-
27
- if not is_installed("typer", "0.4.0"):
28
- install_commands.append("pip install typer==0.4.0")
29
-
30
- if install_commands:
31
- os.system(" && ".join(install_commands))
32
-
33
- # install packages if necessary
34
- #install_packages()
35
 
36
- import appStore.target as target_extraction
37
- import appStore.netzero as netzero
38
- import appStore.sector as sector
39
- import appStore.adapmit as adapmit
40
- import appStore.ghg as ghg
41
- import appStore.policyaction as policyaction
42
- import appStore.conditional as conditional
43
- import appStore.indicator as indicator
44
- import appStore.reader as reader
45
  import appStore.doc_processing as processing
46
  from utils.uploadAndExample import add_upload
47
  from PIL import Image
@@ -127,8 +91,7 @@ with st.expander("ℹ️ - About this app", expanded=False):
127
  """)
128
 
129
  st.write("")
130
- apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
131
- policyaction.app, conditional.app, sector.app, adapmit.app,indicator.app, reader.app]
132
  #conditional.app, sector.app]
133
  #adapmit.app]
134
 
 
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
2
 
3
  # shifted from below - this must be the first streamlit call; otherwise: problems
4
  st.set_page_config(page_title = 'Climate Policy Intelligence',
5
  initial_sidebar_state='expanded', layout="wide")
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ import appStore.target as tapp_extraction
 
 
 
 
 
 
 
 
9
  import appStore.doc_processing as processing
10
  from utils.uploadAndExample import add_upload
11
  from PIL import Image
 
91
  """)
92
 
93
  st.write("")
94
+ apps = [processing.app, tapp_extraction.app]
 
95
  #conditional.app, sector.app]
96
  #adapmit.app]
97