Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 31, 2022
1 parent 595e9ed commit 789ffdd
Show file tree
Hide file tree
Showing 90 changed files with 65 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
data_file = /tmp/.coverage

[xml]
output = /tmp/coverage.xml
output = /tmp/coverage.xml
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
datacube_wms/wms_cfg_local.py
.pytest_cache
*/__pycache__
*/__pycache__
2 changes: 1 addition & 1 deletion .env_ows_root
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ FLASK_DEBUG=
prometheus_multiproc_dir=/tmp
PYTHONPATH=/env/config
DATACUBE_OWS_CFG=ows_refactored.ows_root_cfg.ows_cfg
SENTRY_DSN=
SENTRY_DSN=
2 changes: 1 addition & 1 deletion .env_simple
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ FLASK_DEBUG=
prometheus_multiproc_dir=/tmp
PYTHONPATH=/env
DATACUBE_OWS_CFG=config.ows_test_cfg.ows_cfg
SENTRY_DSN=
SENTRY_DSN=
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ assignees: ''
<!-- Porvide a link to config or paste the config code below -->

### datacube product metadata (datacube product show product_name)
<!-- If issue is related to a specific layer, run `datacube product show <product_name>` to get the product metadata and provide below -->
<!-- If issue is related to a specific layer, run `datacube product show <product_name>` to get the product metadata and provide below -->
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
# tag and push images
docker tag ${ORG}/${IMAGE}:latest ${ORG}/${IMAGE}:${tag}
docker push ${ORG}/${IMAGE}:latest
docker push ${ORG}/${IMAGE}:${tag}
docker push ${ORG}/${IMAGE}:${tag}
2 changes: 1 addition & 1 deletion .github/workflows/dockerfile-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
ignore: DL3008 DL3002 DL3013 DL3059 SC2102
ignore: DL3008 DL3002 DL3013 DL3059 SC2102
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pyspellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
# Spellcheck
- uses: actions/checkout@v2
- uses: igsekor/[email protected]
name: Spellcheck
name: Spellcheck
2 changes: 1 addition & 1 deletion .github/workflows/pyspy-profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: profile.json
path: ./artifacts/profile.json
path: ./artifacts/profile.json
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ jobs:
uses: codecov/codecov-action@v3
with:
directory: ./artifacts/
fail_ci_if_error: false
fail_ci_if_error: false
4 changes: 0 additions & 4 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ rules:
colons: disable
comments: disable
comments-indentation: disable




2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ COPY --from=builder /usr/local/bin/flask /usr/local/bin/flask
# gunicorn cli
COPY --from=builder /usr/local/bin/gunicorn /usr/local/bin/gunicorn
# pybabel cli
COPY --from=builder /usr/local/bin/pybabel /usr/local/bin/pybabel
COPY --from=builder /usr/local/bin/pybabel /usr/local/bin/pybabel
# make folders for testing and keep code in image
RUN mkdir -p /code
# Copy source code and install it
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ included in the normal release cycle.

## Reporting a Vulnerability

Security vulnerabilities can be reported as regular Github issues. If there
are concerns about early public disclosure, security vulnerabilities can be
Security vulnerabilities can be reported as regular Github issues. If there
are concerns about early public disclosure, security vulnerabilities can be
reported to Paul Haesler, either by direct message on the opendatacube Slack, or
by email to `paul (dot) haesler (at) ga (dot) gov (dot) au`.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ PYDEV_DEBUG=
FLASK_ENV=development
prometheus_multiproc_dir=/tmp
PYTHONPATH=/env/config
DATACUBE_OWS_CFG=ows_refactored.ows_root_cfg.ows_cfg
DATACUBE_OWS_CFG=ows_refactored.ows_root_cfg.ows_cfg
2 changes: 0 additions & 2 deletions datacube_ows/config_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ def deepupdate(target: MutableMapping[str, Any], src: MutableMapping[str, Any])
except TypeError:
# Non-iterable - Use child's version
target[k] = src[k]


2 changes: 1 addition & 1 deletion datacube_ows/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def get_s3_browser_uris(datasets, pt=None, s3url="", s3bucket=""):
def convert(uri):
uri_format = "http://{bucket}.s3-website-ap-southeast-2.amazonaws.com/?prefix={prefix}"
uri_format_prod = str(s3url) + "/?prefix={prefix}"
result = regex.match(uri)
result = regex.match(uri)
if result is not None:
if result.group("bucket") == str(s3bucket):
new_uri = uri_format_prod.format(prefix=result.group("prefix"))
Expand Down
1 change: 0 additions & 1 deletion datacube_ows/ogc.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,3 @@ def log_time_and_request_response(response):
ip = 'Not found'
_LOG.info("ip: %s request: %s returned status: %d and took: %d ms", ip, request.url, response.status_code, time_taken)
return response

4 changes: 2 additions & 2 deletions datacube_ows/ogc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def xarray_image_as_png(img_data, loop_over=None, animate=False, frame_duration=
for coord in img_data.coords[loop_over].values
]
images = []

for t_slice in time_slices_array:
im = Image.fromarray(t_slice, "RGBA")
images.append(im)
Expand All @@ -568,7 +568,7 @@ def xarray_image_as_png(img_data, loop_over=None, animate=False, frame_duration=
pillow_data = render_frame(img_data.transpose(xcoord, ycoord), width, height)
if not loop_over and animate:
return pillow_data

# Change PNG rendering to Pillow
im_final = Image.fromarray(pillow_data, "RGBA")
im_final.save(img_io, "PNG")
Expand Down
3 changes: 1 addition & 2 deletions datacube_ows/ows_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def export_metadata(self):
header_comment=f"""# Translations for datacube-ows metadata instance:
# {self.title}
#
# {self.contact_info.organisation} {now.isoformat()}
# {self.contact_info.organisation} {now.isoformat()}
#""",
project=self.title,
version=f"{now.isoformat()}",
Expand Down Expand Up @@ -1417,4 +1417,3 @@ def get_config(refresh=False, called_from_update_ranges=False):
except ODCInitException:
pass
return cfg

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Renaming old spacetime view (OWS down)

ALTER MATERIALIZED VIEW IF EXISTS space_time_view
RENAME TO space_time_view_old
RENAME TO space_time_view_old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-- Dropping OLD spacetime view (and indexes)

DROP MATERIALIZED VIEW IF EXISTS space_time_view_old
DROP MATERIALIZED VIEW IF EXISTS space_time_view_old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-- Dropping OLD time view

DROP MATERIALIZED VIEW IF EXISTS time_view
DROP MATERIALIZED VIEW IF EXISTS time_view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-- Dropping OLD space view

DROP MATERIALIZED VIEW IF EXISTS space_view
DROP MATERIALIZED VIEW IF EXISTS space_view
1 change: 0 additions & 1 deletion datacube_ows/sql/extent_views/create/060_grant.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- Granting read permission to public

GRANT SELECT ON space_time_view TO public;

4 changes: 2 additions & 2 deletions datacube_ows/sql/use_space_time.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
--- from indexed materialized views
select dataset_type_ref, ST_Extent(spatial_extent) as bbox, array_agg(temporal_extent) from space_time_view group by dataset_type_ref;
-------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------QUERY PLAN----------------------------------------------------------------
-----------------------------------------------------------QUERY PLAN----------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
--HashAggregate (cost=316452.75..316453.50 rows=50 width=99) (actual time=9850.712..10340.107 rows=74 loops=1)
-- Group Key: dataset_type_ref
-- -> Seq Scan on space_time_view (cost=0.00..255246.00 rows=8160900 width=128) (actual time=0.009..2750.915 rows=8160900 loops=1)
-- Planning Time: 0.502 ms
-- Execution Time: 10364.716 ms
-- Execution Time: 10364.716 ms
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ create table if not exists wms.sub_product_ranges (
bboxes jsonb not null,
constraint pk_sub_product_ranges primary key (product_id, sub_product_id)
);

1 change: 0 additions & 1 deletion datacube_ows/styles/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,3 @@ def plot_image_with_style_cfg(cfg, data, x="x", y="y", size=10, aspect=None, val
:param valid_data_mask: (optional) An xarray DataArray mask, with dimensions and coordinates matching data.
"""
plot_image(apply_ows_style_cfg(cfg, data, valid_data_mask=valid_data_mask), x=x, y=y, size=size, aspect=aspect)

1 change: 0 additions & 1 deletion datacube_ows/styles/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,3 @@ def var_name(self, key):
def __call__(self, data: "xarray.Dataset") -> Any:
evaluator: ExpressionEvaluator = self.eval_cls(data)
return evaluator.transform(self.tree)

2 changes: 1 addition & 1 deletion datacube_ows/templates/html_feature_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ <h4>Data Sources</h4>
<p>No Data</p>
{% endif %}
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion datacube_ows/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ <h5 class="card-title">WCS (OGC Web Coverage Service)</h5>
</div>
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion datacube_ows/templates/ping.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<h1>PONG!!</h1>
<p>Database: {{ status }}</p>
</body>
</html>
</html>
3 changes: 1 addition & 2 deletions datacube_ows/templates/test_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
var end = new Date(2006, 3, 1);

var mymap = L.map('mapid').setView([-35.0, 148.75], 12);
mbUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';
mbUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';
osm = L.tileLayer(mbUrl, {id: 'mapbox.light', attribution: ""});
cube = L.tileLayer.wms(
"{{ url_for('wms_impl') }}",
Expand Down Expand Up @@ -86,4 +86,3 @@
</script>
</body>
</html>

2 changes: 1 addition & 1 deletion datacube_ows/templates/wcs_desc_coverage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@
</supportedInterpolations>
</CoverageOffering>
{% endfor %}
</CoverageDescription>
</CoverageDescription>
1 change: 0 additions & 1 deletion datacube_ows/tile_matrix_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,3 @@ def wms_bbox_coords(self, tile_matrix, row, col):
return (
mins[0], maxs[1], maxs[0], mins[1]
)

2 changes: 0 additions & 2 deletions datacube_ows/update_ranges_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,3 @@ def run_sql(dc, path, **params):
else:
conn.execute(sql)
conn.close()


2 changes: 1 addition & 1 deletion docker-compose.cleandb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ services:
ports:
- 8000:8000
environment:
DB_PORT: 5432
DB_PORT: 5432
2 changes: 1 addition & 1 deletion docker/database/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM kartoza/postgis:13-3.1
COPY s2_dump.sql /docker-entrypoint-initdb.d/
COPY s2_dump.sql /docker-entrypoint-initdb.d/
1 change: 0 additions & 1 deletion docker/database/dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1462,4 +1462,3 @@ REFRESH MATERIALIZED VIEW public.space_time_view;
--
-- PostgreSQL database dump complete
--

13 changes: 6 additions & 7 deletions docker/database/eo3_sentinel2_ard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CREATE EXTENSION IF NOT EXISTS pg_cron WITH SCHEMA public;


--
-- Name: EXTENSION pg_cron; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION pg_cron; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION pg_cron IS 'Job scheduler for PostgreSQL';
Expand Down Expand Up @@ -63,7 +63,7 @@ CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;


--
-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
Expand All @@ -77,7 +77,7 @@ CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;


--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
Expand All @@ -91,7 +91,7 @@ CREATE EXTENSION IF NOT EXISTS pgrouting WITH SCHEMA public;


--
-- Name: EXTENSION pgrouting; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION pgrouting; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION pgrouting IS 'pgRouting Extension';
Expand All @@ -105,7 +105,7 @@ CREATE EXTENSION IF NOT EXISTS postgis_raster WITH SCHEMA public;


--
-- Name: EXTENSION postgis_raster; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis_raster; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis_raster IS 'PostGIS raster types and functions';
Expand All @@ -119,7 +119,7 @@ CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;


--
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';
Expand Down Expand Up @@ -6669,4 +6669,3 @@ ALTER DEFAULT PRIVILEGES FOR ROLE opendatacubeusername IN SCHEMA public GRANT SE
--
-- PostgreSQL database dump complete
--

9 changes: 4 additions & 5 deletions docker/database/s2_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public;


--
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION fuzzystrmatch IS 'determine similarities and distance between strings';
Expand All @@ -90,7 +90,7 @@ CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;


--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
Expand All @@ -104,7 +104,7 @@ CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder WITH SCHEMA tiger;


--
-- Name: EXTENSION postgis_tiger_geocoder; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis_tiger_geocoder; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis_tiger_geocoder IS 'PostGIS tiger geocoder and reverse geocoder';
Expand All @@ -118,7 +118,7 @@ CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;


--
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';
Expand Down Expand Up @@ -1247,4 +1247,3 @@ REFRESH MATERIALIZED VIEW public.space_time_view;
--
-- PostgreSQL database dump complete
--

Loading

0 comments on commit 789ffdd

Please sign in to comment.