Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
update simple-statistics, fix #66
Browse files Browse the repository at this point in the history
also update license files for all JS libraries
fixes to test-max and test-min for new version
  • Loading branch information
sckott committed May 6, 2017
1 parent da79883 commit b702ada
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion inst/js/LICENSE-geojson-random
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2014, Tom MacWright
Copyright (c) 2017, Tom MacWright

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
29 changes: 3 additions & 26 deletions inst/js/LICENSE-geojsonhint
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
Copyright (c) 2014, Tom MacWright
Copyright 2017 Mapbox

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of geojsonhint nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2 changes: 1 addition & 1 deletion inst/js/LICENSE-turfjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 Morgan Herlocker
Copyright (c) 2017 TurfJS

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
6 changes: 4 additions & 2 deletions inst/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ cp turf-invariant.js lawn/inst/js/

## simple-statistics

Currently (as of 2016-10-12) using `simple-statistics` `v2.1.0`
Currently (as of 2017-05-06) using `simple-statistics` `v4.1.0`

To recreate `inst/js/simple-statistics.js`:

Download the minified file from <https://npmcdn.com/simple-statistics@2.0.1/dist/simple-statistics.min.js>
Download the minified file from <https://npmcdn.com/simple-statistics@4.1.0/dist/simple-statistics.min.js>
to `inst/js` directory in the `lawn` package



## geojsonhint

Currently (as of 2016-10-12) using `geojsonhint` `v2.0.0-beta2`
Expand Down
2 changes: 1 addition & 1 deletion inst/js/simple-statistics.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/testthat/test-max.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_that("lawn_max returns correct classes", {
})

test_that("in_field and out_field parameter works as expected", {
expect_equal(length(na.omit(lawn_max(poly, pt, 'population2')$features$properties$max)), 0)
expect_null(lawn_max(poly, pt, 'population2')$features$properties$max)
expect_named(lawn_max(poly, pt, 'population', 'bears')$features$properties,
c('values', 'bears'))
})
Expand All @@ -24,7 +24,7 @@ test_that("lawn_max fails correctly", {
# missing arguments
expect_error(lawn_max(), "argument \"polygons\" is missing, with no default")
# wrong in_field param leads to no ouput for max
expect_equal(length(na.omit(lawn_max(poly, pt, 'population2')$features$properties$max)), 0)
expect_null(lawn_max(poly, pt, 'population2')$features$properties$max)
# can't pass in a character string to cellWidth
expect_error(lawn_max(poly, "{}", 'population', 'max'), "Cannot call method")
# can't pass in a character string to cellWidth
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-min.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ test_that("lawn_average works", {

test_that("lawn_average fails correctly", {
expect_error(lawn_min(), "argument \"polygons\" is missing, with no default")
expect_equal(length(na.omit(lawn_min(poly, pt, 'population2', 'min')$features$properties$min)), 0)
expect_null(lawn_min(poly, pt, 'population2', 'min')$features$properties$min)
})

0 comments on commit b702ada

Please sign in to comment.