Part1
Browse files- Dockerfile +11 -0
- README.md +1 -1
- app.py +7 -6
- requirements.txt +12 -0
Dockerfile
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM gitlab-registry.nrp-nautilus.io/cboettig/images
|
| 2 |
+
WORKDIR /app
|
| 3 |
+
|
| 4 |
+
COPY . .
|
| 5 |
+
|
| 6 |
+
# huggingface uses port 7860 by default
|
| 7 |
+
CMD streamlit run app.py \
|
| 8 |
+
--server.address 0.0.0.0 \
|
| 9 |
+
--server.port 7860 \
|
| 10 |
+
--server.headless true \
|
| 11 |
+
--server.fileWatcherType none
|
README.md
CHANGED
|
@@ -3,7 +3,7 @@ title: Espm288
|
|
| 3 |
emoji: 🌖
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: green
|
| 6 |
-
sdk:
|
| 7 |
sdk_version: 1.44.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 3 |
emoji: 🌖
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
sdk_version: 1.44.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
app.py
CHANGED
|
@@ -8,19 +8,20 @@ st.title("Exploring Redlining in the USA") #website title
|
|
| 8 |
option = st.selectbox(
|
| 9 |
"Pick a city:",
|
| 10 |
("Oakland", "San Francisco", "Chicago"),
|
| 11 |
-
index =
|
| 12 |
placeholder = "Select a city",
|
| 13 |
)
|
| 14 |
|
| 15 |
-
redlines = con.read_geo("/vsicurl/https://dsl.richmond.edu/panorama/redlining/static/mappinginequality.gpkg")
|
| 16 |
|
| 17 |
-
city = redlines.filter(_.city ==
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
st.write("You selected:", option)
|
| 21 |
|
| 22 |
import leafmap.maplibregl as leafmap
|
| 23 |
-
m = leafmap.Map()
|
| 24 |
-
m.add_gdf(
|
| 25 |
-
|
| 26 |
m.to_streamlit()
|
|
|
|
| 8 |
option = st.selectbox(
|
| 9 |
"Pick a city:",
|
| 10 |
("Oakland", "San Francisco", "Chicago"),
|
| 11 |
+
index = 1,
|
| 12 |
placeholder = "Select a city",
|
| 13 |
)
|
| 14 |
|
| 15 |
+
redlines = con.read_geo("/vsicurl/https://dsl.richmond.edu/panorama/redlining/static/mappinginequality.gpkg")
|
| 16 |
|
| 17 |
+
city = redlines.filter(_.city == option)
|
| 18 |
|
| 19 |
+
city_gdf = city.execute() # convert city into a gdf
|
| 20 |
|
| 21 |
st.write("You selected:", option)
|
| 22 |
|
| 23 |
import leafmap.maplibregl as leafmap
|
| 24 |
+
m = leafmap.Map(style = "voyager")
|
| 25 |
+
m.add_gdf(city_gdf)
|
| 26 |
+
m.add_gdf(city_gdf, "fill", paint = { "fill-color": ["get", "fill"], "fill-opacity": 0.8})
|
| 27 |
m.to_streamlit()
|
requirements.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pandas
|
| 2 |
+
seaborn
|
| 3 |
+
ibis-framework[duckdb]
|
| 4 |
+
nbval
|
| 5 |
+
leafmap[maplibre]
|
| 6 |
+
geopandas
|
| 7 |
+
pystac-client
|
| 8 |
+
odc-stac
|
| 9 |
+
rioxarray
|
| 10 |
+
exactextract
|
| 11 |
+
plotnine
|
| 12 |
+
altair
|