Skip to content

Commit

Permalink
Merge pull request #332 from CartoDB/develop
Browse files Browse the repository at this point in the history
Release 1.9.0
  • Loading branch information
Mario de Frutos committed Apr 20, 2018
2 parents ff0989f + 198ac90 commit a0535a6
Show file tree
Hide file tree
Showing 25 changed files with 189,464 additions and 187,232 deletions.
9 changes: 7 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

I'd like to request a new data observatory extension deploy: dump + extension

**VERY IMPORTANT!!!**

PLEASE USE `python scripts/generate_fixtures.py` TO GENERATE NEW FIXTURES FOR
THE NEW DUMP AND OVERRIDE IT IN THIS PROJECT BEFORE PASS THE TESTS

## Performance comparison to last deployment

Please include link here to comparison perftests:
Expand All @@ -18,6 +23,6 @@ Please put here the dump id to be deployed: <dump_id>

Add down here the PR links to be added and deployed:

-
-

// @CartoDB/dataservices
// @CartoDB/datateam
40 changes: 10 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
language: c
dist: precise
group: travis_stable
sudo: required

env:
global:
- PAGER=cat

before_install:
- sudo add-apt-repository -y ppa:cartodb/postgresql-9.5
- sudo add-apt-repository -y ppa:cartodb/gis
- sudo add-apt-repository -y ppa:cartodb/gis-testing
- sudo apt-get update

# Install postgres db and build deps
- sudo /etc/init.d/postgresql stop # stop travis default instance
- sudo apt-get -y remove --purge postgresql-9.1
- sudo apt-get -y remove --purge postgresql-9.2
- sudo apt-get -y remove --purge postgresql-9.3
- sudo apt-get -y remove --purge postgresql-9.4
- sudo apt-get -y remove --purge postgresql-9.5
- sudo rm -rf /var/lib/postgresql/
- sudo rm -rf /var/log/postgresql/
- sudo rm -rf /etc/postgresql/
- sudo apt-get -y remove --purge postgis-2.2
- sudo apt-get -y autoremove
matrix:
include:
- env: PGSQL_VERSION=9.5 POSTGIS_VERSION=2.2
- env: PGSQL_VERSION=9.6 POSTGIS_VERSION=2.3
- env: PGSQL_VERSION=10 POSTGIS_VERSION=2.4

- sudo apt-get -y install postgresql-9.5=9.5.2-3cdb3
- sudo apt-get -y install postgresql-server-dev-9.5=9.5.2-3cdb3
- sudo apt-get -y install postgresql-plpython-9.5=9.5.2-3cdb3
- sudo apt-get -y install postgresql-9.5-postgis-scripts=2.2.2.0-cdb2
- sudo apt-get -y install postgresql-9.5-postgis-2.2=2.2.2.0-cdb2

# configure it to accept local connections from postgres
- echo -e "# TYPE DATABASE USER ADDRESS METHOD \nlocal all postgres trust\nlocal all all trust\nhost all all 127.0.0.1/32 trust" \
| sudo tee /etc/postgresql/9.5/main/pg_hba.conf
- sudo /etc/init.d/postgresql restart 9.5
before_install:
- sudo bash $TRAVIS_BUILD_DIR/scripts/ci/install_postgres.sh

install:
- sudo make install

script:
- cd src/pg
- make test || { cat src/pg/test/regression.diffs; false; }
- make test || { cat $TRAVIS_BUILD_DIR/src/pg/test/regression.diffs; false; }
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Run the tests with `make test`.

Update extension in a working database with:
```
ALTER EXTENSION observatory VERSION TO 'current';
ALTER EXTENSION observatory VERSION TO 'dev';
ALTER EXTENSION observatory UPDATE TO 'current';
ALTER EXTENSION observatory UPDATE TO 'dev';
```

Note: we keep the current development version install as 'dev' always;
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
1.9.0 (2018-04-20)
------------------

__Improvements__

* Improved `OBS_GetAvailableGeometries` for the DO Timespans project ([#325](https://github.com/CartoDB/observatory-extension/pull/325))
* Improved `OBS_GetAvailableTimespans` for the DO Timespans project ([#324](https://github.com/CartoDB/bigmetadata/issues/324))
* Modified the denominated suggested_name to mitigate collisions ([#327](https://github.com/CartoDB/observatory-extension/pull/327))
* Fixed some errors so now the extension supports PostgreSQL 10 ([#329](https://github.com/CartoDB/observatory-extension/pull/329))
* Fixed documentation
* Add support for multiple PostgreSQL and Postgis versions in our travis script for test purposes

1.8.0 (2017-10-18)
------------------

Expand Down
40 changes: 20 additions & 20 deletions doc/discovery_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,39 +97,39 @@ valid_timespan | Boolean | True if the `timespan` argument is a valid timespan f
Obtain all numerators that are available within a small rectangle.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326))
```

Obtain all numerators that are available within a small rectangle and are for
the United States only.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
```

Obtain all numerators that are available within a small rectangle and are
employment related for the United States only.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment}');
```

Obtain all numerators that are available within a small rectangle and are
related to both employment and age & gender for the United States only.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment, subsection/tags.age_gender}');
```

Obtain all numerators that work with US population (`us.census.acs.B01003001`)
as a denominator.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
WHERE valid_denom IS True;
```
Expand All @@ -138,15 +138,15 @@ Obtain all numerators that work with US states (`us.census.tiger.state`)
as a geometry.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
WHERE valid_geom IS True;
```

Obtain all numerators available in the timespan `2011 - 2015`.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableNumerators(
SELECT * FROM OBS_GetAvailableNumerators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
WHERE valid_timespan IS True;
```
Expand Down Expand Up @@ -191,22 +191,22 @@ valid_timespan | Boolean | True if the `timespan` argument is a valid timespan f
Obtain all denominators that are available within a small rectangle.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableDenominators(
SELECT * FROM OBS_GetAvailableDenominators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
```

Obtain all denominators that are available within a small rectangle and are for
the United States only.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableDenominators(
SELECT * FROM OBS_GetAvailableDenominators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
```

Obtain all denominators for male population (`us.census.acs.B01001002`).

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableDenominators(
SELECT * FROM OBS_GetAvailableDenominators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01001002')
WHERE valid_numer IS True;
```
Expand All @@ -215,15 +215,15 @@ Obtain all denominators that work with US states (`us.census.tiger.state`)
as a geometry.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableDenominators(
SELECT * FROM OBS_GetAvailableDenominators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
WHERE valid_geom IS True;
```

Obtain all denominators available in the timespan `2011 - 2015`.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableDenominators(
SELECT * FROM OBS_GetAvailableDenominators(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
WHERE valid_timespan IS True;
```
Expand All @@ -242,7 +242,7 @@ filter_tags | Text[] | a list of filters. Only geometries for which all of thes
numer_id | Text | the ID of a numerator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
denom_id | Text | the ID of a denominator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
timespan | Text | the ID of a timespan to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
number_geometries | Integer | Number of geometries of the source data in order to calculate more accurately the score value to know which geometry fits better with the provided extent. (optional)
number_geometries | Integer | an additional variable that is used to adjust the calculation of the [score](https://carto.com/docs/carto-engine/data/discovery-functions/#returns-4) (optional)

#### Returns

Expand Down Expand Up @@ -275,30 +275,30 @@ meanmediansize | Numeric | Ignored
Obtain all geometries that are available within a small rectangle.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableGeometries(
SELECT * FROM OBS_GetAvailableGeometries(
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
```

Obtain all geometries that are available within a small rectangle and are for
the United States only.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableGeometries(
SELECT * FROM OBS_GetAvailableGeometries(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
```

Obtain all geometries that work with total population (`us.census.acs.B01003001`).

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableGeometries(
SELECT * FROM OBS_GetAvailableGeometries(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
WHERE valid_numer IS True;
```

Obtain all geometries with timespan `2015`.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableGeometries(
SELECT * FROM OBS_GetAvailableGeometries(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2015')
WHERE valid_timespan IS True;
```
Expand Down Expand Up @@ -343,14 +343,14 @@ valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for th
Obtain all timespans that are available within a small rectangle.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableTimespans(
SELECT * FROM OBS_GetAvailableTimespans(
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
```

Obtain all timespans for total population (`us.census.acs.B01003001`).

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableTimespans(
SELECT * FROM OBS_GetAvailableTimespans(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
WHERE valid_numer IS True;
```
Expand All @@ -359,7 +359,7 @@ Obtain all timespans that work with US states (`us.census.tiger.state`)
as a geometry.

```SQL
SELECT * FROM cdb_observatory.OBS_GetAvailableTimespans(
SELECT * FROM OBS_GetAvailableTimespans(
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, 'us.census.tiger.state')
WHERE valid_geom IS True;
```
Loading

0 comments on commit a0535a6

Please sign in to comment.