Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanded RasterRefSpec to ensure lazy tiles provide metadata without I/O #394

Merged
merged 2 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sudo: false
dist: xenial
language: python

Expand Down Expand Up @@ -28,11 +27,10 @@ install:
- pip install rasterio shapely pandas numpy pweave
- wget -O - https://piccolo.link/sbt-1.2.8.tgz | tar xzf -

script:
- sbt/bin/sbt -java-home $JAVA_HOME -batch test
- sbt/bin/sbt -java-home $JAVA_HOME -batch it:test
# - sbt -Dfile.encoding=UTF8 clean coverage test coverageReport
# Tricks to avoid unnecessary cache updates
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

jobs:
include:
- stage: "Unit Tests"
script: sbt/bin/sbt -java-home $JAVA_HOME -batch test
- stage: "Integration Tests"
script: sbt/bin/sbt -java-home $JAVA_HOME -batch it:test
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,18 @@ class RasterRefSpec extends TestEnvironment with TestData {
}
}

it("should construct a RasterRefTile without I/O") {
it("should construct and inspect a RasterRefTile without I/O") {
new Fixture {
// SimpleRasterInfo is a proxy for header data requests.
val start = SimpleRasterInfo.cacheStats.hitCount()
val startStats = SimpleRasterInfo.cacheStats
val t: ProjectedRasterTile = RasterRefTile(subRaster)
val result = Seq(t, subRaster.tile).toDF("tile").first()
val end = SimpleRasterInfo.cacheStats.hitCount()
end should be(start)
val df = Seq(t, subRaster.tile).toDF("tile")
val result = df.first()
SimpleRasterInfo.cacheStats.hitCount() should be(startStats.hitCount())
SimpleRasterInfo.cacheStats.missCount() should be(startStats.missCount())
val info = df.select(rf_dimensions($"tile"), rf_extent($"tile")).first()
SimpleRasterInfo.cacheStats.hitCount() should be(startStats.hitCount() + 2)
SimpleRasterInfo.cacheStats.missCount() should be(startStats.missCount())
}
}
}
Expand Down