Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/darribas/gds_env
Browse files Browse the repository at this point in the history
  • Loading branch information
darribas committed Sep 4, 2024
2 parents 1a7e93a + 6ce4326 commit af26c09
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 811 deletions.
1 change: 0 additions & 1 deletion env/gds_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ dependencies:
- topojson
- urbanaccess
- xarray-spatial
- xarray_leaflet
- xlrd
- xlsxwriter
- xvec
Expand Down
8 changes: 3 additions & 5 deletions env/gds_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- flake8
- geoalchemy2
- geocube
- geopandas
- geopandas>=1.0
- geopy
- gpxpy
- gstools
Expand Down Expand Up @@ -55,14 +55,13 @@ dependencies:
- watermark
- polyline
- pooch
- pygeoda
#- pygeoda
- protobuf
- psycopg2
- pyarrow
- pyogrio
- pyppeteer
- pyrosm
- pysal
- pysal==24.7
- pystac-client
- pytest
- python-duckdb
Expand All @@ -82,7 +81,6 @@ dependencies:
- topojson
- urbanaccess
- xarray-spatial
- xarray_leaflet
- xlrd
- xlsxwriter
- xvec
Expand Down
1 change: 1 addition & 0 deletions env/installers/install_jupyter_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pip install \
jupyterlab-quarto \
jupyterlab_vim \
jupyterlab_widgets \
jupyter_leaflet \
jupytext
# Bash kernel
python -m bash_kernel.install
Expand Down
57 changes: 13 additions & 44 deletions env/py/check_py_stack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"f = './gds_py.yml'\n",
"arch = ! dpkg --print-architecture\n",
"f = f'../gds_{arch[0]}.yml'\n",
"bespoke = {\n",
" 'h3_py': 'h3',\n",
" 'python_duckdb': 'duckdb',\n",
Expand All @@ -57,8 +58,10 @@
" for l in fo.readlines():\n",
" if ('- ' in l) and ('#' not in l) and (':' not in l):\n",
" l = l.strip('\\n').strip(' ').strip('-').strip(' ')\n",
" l = l.split('==')[0]\n",
" l = l.split('>=')[0]\n",
" libs.append(l)\n",
" if l[:2] != 'r-':\n",
" libs.append(l)\n",
"libs = [i for i in libs if i not in [\n",
" 'conda-forge', 'libgdal-arrow-parquet', 'pip', 'cenpy', 'protobuf']\n",
" ]\n",
Expand Down Expand Up @@ -123,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": null,
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -393,7 +396,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Convert us.tiff to COG with rio-cogeo\n",
Expand All @@ -403,42 +408,6 @@
"! rio warp --dst-crs EPSG:4326 us_cog.tif us_cog_ll.tif"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# rioxarray + xarray_leaflet\n",
"import xarray, rioxarray\n",
"us = rioxarray.open_rasterio(\n",
" \"us_cog.tif\"\n",
").sel(\n",
" band=1, \n",
" y=slice(7000000, 5000000),\n",
" x=slice(-10000000, -8000000)\n",
")\n",
"import xarray_leaflet\n",
"from ipyleaflet import Map\n",
"\n",
"m = Map(zoom=1, basemap=basemaps.CartoDB.DarkMatter)\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"l = us.astype(\n",
" float\n",
").rio.reproject(\n",
" \"EPSG:4326\"\n",
").leaflet.plot(m)\n",
"l.interact(opacity=(0.0,1.0))"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -471,9 +440,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "GDS-11.0alpha",
"language": "python",
"name": "python3"
"name": "gds"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -485,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit af26c09

Please sign in to comment.