Skip to content

Commit 19191ba

Browse files
authored
Merge pull request #514 from s22s/feature/ipy-display
DataFrame.display injection
2 parents 8bbed00 + 88f9af5 commit 19191ba

File tree

29 files changed

+423
-709
lines changed

29 files changed

+423
-709
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ orbs:
4242
steps:
4343
- run:
4444
name: Install requirements
45-
command: python -m pip install --progress-bar=off --user -r pyrasterframes/src/main/python/requirements.txt
45+
command: /opt/conda/bin/conda install -c conda-forge --yes --file pyrasterframes/src/main/python/requirements-condaforge.txt
46+
4647

4748
rasterframes:
4849
commands:
@@ -117,6 +118,7 @@ jobs:
117118
- checkout
118119
- sbt/setup
119120
- python/setup
121+
- python/requirements
120122
- rasterframes/setup
121123
- rasterframes/restore-cache
122124
- sbt/compile

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ tour/*.tiff
2727
scoverage-report*
2828

2929
zz-*
30+
rf-notebook/src/main/notebooks/.ipython

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ Additional, Python sepcific build instruction may be found at [pyrasterframes/sr
6262

6363
## Copyright and License
6464

65-
RasterFrames is released under the Apache 2.0 License, copyright Astraea, Inc. 2017-2019.
65+
RasterFrames is released under the Apache 2.0 License, copyright Astraea, Inc. 2017-2020.
6666

6767

core/src/main/resources/reference.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rasterframes {
22
nominal-tile-size = 256
3-
prefer-gdal = true
3+
prefer-gdal = false
44
showable-tiles = false
55
showable-max-cells = 20
66
max-truncate-row-element-length = 40

core/src/main/scala/org/locationtech/rasterframes/util/debug/package.scala

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,46 @@
2121

2222
package org.locationtech.rasterframes.util
2323

24+
import java.lang.reflect.{AccessibleObject, Modifier}
25+
26+
import org.apache.spark.Partition
27+
import org.apache.spark.rdd.RDD
28+
29+
import scala.util.Try
30+
2431
/**
2532
* Additional debugging routines. No guarantees these are or will remain stable.
2633
*
2734
* @since 4/6/18
2835
*/
2936
package object debug {
37+
38+
implicit class DescribeablePartition(val p: Partition) extends AnyVal {
39+
def describe: String = Try {
40+
def acc[A <: AccessibleObject](a: A): A = {
41+
a.setAccessible(true); a
42+
}
43+
44+
val getters = p.getClass.getDeclaredMethods
45+
.filter(_.getParameterCount == 0)
46+
.filter(m (m.getModifiers & Modifier.PUBLIC) > 0)
47+
.filterNot(_.getName == "hashCode")
48+
.map(acc)
49+
.map(m m.getName + "=" + String.valueOf(m.invoke(p)))
50+
51+
val fields = p.getClass.getDeclaredFields
52+
.filter(f (f.getModifiers & Modifier.PUBLIC) > 0)
53+
.map(acc)
54+
.map(m m.getName + "=" + String.valueOf(m.get(p)))
55+
56+
p.getClass.getSimpleName + "(" + (fields ++ getters).mkString(", ") + ")"
57+
58+
}.getOrElse(p.toString)
59+
}
60+
61+
implicit class RDDWithPartitionDescribe(val r: RDD[_]) extends AnyVal {
62+
def describePartitions: String = r.partitions.map(p ("Partition " + p.index) -> p.describe).mkString("\n")
63+
}
64+
3065
}
66+

datasource/src/it/scala/org/locationtech/rasterframes/datasource/raster/RaterSourceDataSourceIT.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RaterSourceDataSourceIT extends TestEnvironment with TestData {
3131
// A regression test.
3232
val rf = spark.read.raster
3333
.withSpatialIndex()
34-
.load("https://s22s-test-geotiffs.s3.amazonaws.com/water_class/seasonality_90W_50N.tif")
34+
.load("https://rasterframes.s3.amazonaws.com/samples/water_class/seasonality_90W_50N.tif")
3535

3636
val target_rf =
3737
rf.select(rf_extent($"proj_raster").alias("extent"), rf_crs($"proj_raster").alias("crs"), rf_tile($"proj_raster").alias("target"))

datasource/src/main/scala/org/locationtech/rasterframes/datasource/raster/RasterSourceRelation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ case class RasterSourceRelation(
153153
.repartitionByRange(numParts,$"spatial_index")
154154
indexed.rdd
155155
}
156-
else df.rdd
156+
else df.repartition(numParts).rdd
157157
}
158158
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Set everything to be logged to the console
19+
log4j.rootCategory=INFO, console
20+
log4j.appender.console=org.apache.log4j.ConsoleAppender
21+
log4j.appender.console.target=System.err
22+
log4j.appender.console.layout=org.apache.log4j.PatternLayout
23+
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
24+
25+
# Set the default spark-shell log level to WARN. When running the spark-shell, the
26+
# log level for this class is used to overwrite the root logger's log level, so that
27+
# the user can have different defaults for the shell and regular Spark apps.
28+
log4j.logger.org.apache.spark.repl.Main=WARN
29+
30+
31+
log4j.logger.org.apache=ERROR
32+
log4j.logger.com.amazonaws=WARN
33+
log4j.logger.geotrellis=WARN
34+
35+
# Settings to quiet third party logs that are too verbose
36+
log4j.logger.org.spark_project.jetty=WARN
37+
log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR
38+
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
39+
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
40+
log4j.logger.org.locationtech.rasterframes=DEBUG
41+
log4j.logger.org.locationtech.rasterframes.ref=DEBUG
42+
log4j.logger.org.apache.parquet.hadoop.ParquetRecordReader=OFF
43+
44+
# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support
45+
log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL
46+
log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR
47+
48+
log4j.logger.org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator=ERROR
49+
log4j.logger.org.apache.spark.sql.execution.WholeStageCodegenExec=ERROR
50+
log4j.logger.geotrellis.raster.gdal=ERROR

docs/src/main/paradox/index.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ The source code can be found on GitHub at [locationtech/rasterframes](https://gi
2929

3030
## Detailed Contents
3131

32-
@@ toc { depth=4 }
32+
@@ toc { depth=3 }
3333

3434
@@@ index
35-
* [Overview](description.md)
36-
* [Getting Started](getting-started.md)
37-
* [Concepts](concepts.md)
38-
* [Raster Data I/O](raster-io.md)
39-
* [Vector Data](vector-data.md)
40-
* [Raster Processing](raster-processing.md)
41-
* [Numpy and Pandas](numpy-pandas.md)
42-
* [Scala and SQL](languages.md)
43-
* [Function Reference](reference.md)
44-
* [Release Notes](release-notes.md)
35+
* @ref:[Overview](description.md)
36+
* @ref:[Getting Started](getting-started.md)
37+
* @ref:[Concepts](concepts.md)
38+
* @ref:[Raster Data I/O](raster-io.md)
39+
* @ref:[Vector Data](vector-data.md)
40+
* @ref:[Raster Processing](raster-processing.md)
41+
* @ref:[Machine Learning](machine-learning.md)
42+
* @ref:[Numpy and Pandas](numpy-pandas.md)
43+
* @ref:[IPython Extensions](ipython.md)
44+
* @ref:[Scala and SQL](languages.md)
45+
* @ref:[Function Reference](reference.md)
46+
* @ref:[Release Notes](release-notes.md)
4547
@@@
4648

docs/src/main/paradox/raster-processing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @ref:[Aggregation](aggregation.md)
1010
* @ref:[Time Series](time-series.md)
1111
* @ref:[Raster Join](raster-join.md)
12-
* @ref:[Machine Learning](machine-learning.md)
1312

1413
@@@
1514

0 commit comments

Comments
 (0)