Skip to content

Commit eb7183a

Browse files
committed
Updated rf-notebook package version.
1 parent 192aef9 commit eb7183a

File tree

5 files changed

+40
-21
lines changed

5 files changed

+40
-21
lines changed

pyrasterframes/src/main/python/docs/unsupervised-learning.pymd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We import various Spark components needed to construct our `Pipeline`.
2020
```python, imports, echo=True
2121
import pandas as pd
2222
from pyrasterframes import TileExploder
23-
from pyrasterframes.rasterfunctions import rf_assemble_tile, rf_crs, rf_extent, rf_tile, rf_dimensions
23+
from pyrasterframes.rasterfunctions import *
2424

2525
from pyspark.ml.feature import VectorAssembler
2626
from pyspark.ml.clustering import KMeans
@@ -40,7 +40,7 @@ catalog_df = pd.DataFrame([
4040

4141
df = spark.read.raster(catalog_df, catalog_col_names=catalog_df.columns)
4242
df = df.withColumn('crs', rf_crs(df.b1)) \
43-
.withColumn('extent', rf_crs(df.b1))
43+
.withColumn('extent', rf_extent(df.b1))
4444
df.printSchema()
4545
```
4646

@@ -129,5 +129,9 @@ retiled
129129
The resulting output is shown below.
130130

131131
```python, viz
132-
display(retiled.select('prediction').first()['prediction'])
132+
133+
# display(retiled.select('prediction').first()['prediction'])
134+
from pyrasterframes.rf_types import Extent
135+
aoi = Extent.from_row(retiled.select(rf_agg_extent('extent')).first()[0])
136+
retiled.select(rf_agg_overview_raster('prediction', 186, 169, aoi, 'extent', 'crs'))
133137
```

pyrasterframes/src/main/python/pyrasterframes/rasterfunctions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def rf_agg_overview_raster(tile_col: Column, cols: int, rows: int, aoi: Extent,
349349
return Column(jfcn(_to_java_column(tile_col), cols, rows, aoi.__jvm__))
350350
else:
351351
return Column(jfcn(
352-
_to_java_column(tile_extent_col), _to_java_column(tile_crs_col), _to_java_column(tile_col),
352+
_to_java_column(tile_col), _to_java_column(tile_extent_col), _to_java_column(tile_crs_col),
353353
cols, rows, aoi.__jvm__
354354
))
355355

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
ipython=6.2.1
2+
pyspark=2.4.4
3+
gdal=2.4.3
4+
numpy>=1.17.3,<2.0
5+
pandas>=0.25.3,<1.0
6+
shapely>=1.6.4,<1.7
7+
rasterio>=1.1.1,<1.2
8+
folium>=0.10.1,<0.11
9+
geopandas>=0.6.2,<0.7
10+
descartes>=1.1.0,<1.2
111
pytz
2-
Shapely>=1.6.0
3-
pyspark==2.4.4
4-
numpy>=1.7
5-
pandas>=0.24.2
6-
matplotlib<3.0.0 # no python 2.7 support after v2.x.x
7-
ipython==6.2.1
8-
rasterio>=1.0.0
9-
folium # for documentation
12+
matplotlib

rf-notebook/src/main/docker/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# jupyter/scipy-notebook isn't semantically versioned.
22
# We pick this arbitrary one from Sept 2019 because it's what latest was on Oct 17 2019.
3-
FROM jupyter/scipy-notebook:1386e2046833
3+
FROM jupyter/scipy-notebook:7a0c7325e470
44

55
LABEL maintainer="Astraea, Inc. <[email protected]>"
66

7-
EXPOSE 4040 4041 4042 4043 4044
8-
97
USER root
108

119
RUN \
@@ -36,21 +34,25 @@ ENV PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.7-src.zip
3634
ENV SPARK_OPTS --driver-java-options=-Xms1024M --driver-java-options=-Xmx4096M --driver-java-options=-Dlog4j.logLevel=info
3735
ENV RF_LIB_LOC=/usr/local/rasterframes
3836

39-
COPY conda_cleanup.sh $RF_LIB_LOC/
37+
COPY conda_cleanup.sh requirements-nb.txt $RF_LIB_LOC/
4038
RUN chmod u+x $RF_LIB_LOC/conda_cleanup.sh
4139

42-
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/conda/lib"
43-
# Sphinx (for Notebook->html) and pyarrow (from pyspark build)
4440
RUN \
45-
conda install --quiet --yes --channel conda-forge \
46-
pyarrow anaconda sphinx nbsphinx shapely numpy folium geopandas geojsonio rasterio descartes && \
41+
conda config --set unsatisfiable_hints True && \
42+
conda --debug update --channel conda-forge --all --yes --quiet && \
43+
conda install --yes --channel conda-forge --file $RF_LIB_LOC/requirements-nb.txt && \
4744
$RF_LIB_LOC/conda_cleanup.sh $NB_USER $CONDA_DIR
4845

46+
RUN conda list --export
47+
48+
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/conda/lib"
4949
COPY *.whl $RF_LIB_LOC/
50-
COPY jupyter_notebook_config.py $HOME/.jupyter
50+
COPY jupyter_notebook_config.py $HOME/.jupyter/
5151
COPY examples $HOME/examples
5252

5353
RUN ls -1 $RF_LIB_LOC/*.whl | xargs pip install --no-cache-dir
5454
RUN chmod -R +w $HOME/examples && chown -R $NB_UID:$NB_GID $HOME
5555

5656
USER $NB_UID
57+
58+
EXPOSE 4040 4041 4042 4043 4044
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pyspark=2.4.4
2+
gdal=2.4.3
3+
numpy>=1.17.3,<2.0
4+
pandas>=0.25.3,<1.0
5+
shapely>=1.6.4,<1.7
6+
rasterio>=1.1.1,<1.2
7+
folium>=0.10.1,<0.11
8+
geopandas>=0.6.2,<0.7
9+
descartes>=1.1.0,<1.2
10+
pyarrow

0 commit comments

Comments
 (0)