This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Definitions for a set of informational views and useful procedures for working with compressed hypertables. | |
---------------------------------------------------------------------------------------------------- | |
---- VIEWS ------------------------------------------------------------------------------------------ | |
---------------------------------------------------------------------------------------------------- | |
drop view if exists chunks_ts, chunks_tstz, chunk_stats, jobs, job_stats, compression_stats; | |
---- chunks_tstz ----------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This query yields space count aggregates at 10 minute resolution for a given set of spaces over a three day period,, | |
where each 10 minute bucket is represented in the output, even if that bucket contains no data. The query first | |
selects data from a sparse 1 minute cagg and unions that data to a set of empty records, generated with the Postgres | |
generate_series function, then rolls up the unioned records into 10 minute aggregates. | |
The union against the set of empty records ensures that all 10 minute intervals are represented in the final results. | |
This step is necessary as the 1 minute data is sparse, meaning a given 10 minute interval could contain no data, and | |
the time_bucket_gapfill function does not register that a bucket needs to be injected if no records exist within | |
an interval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from enum import Enum | |
from typing import Dict, Optional, Union | |
import geoalchemy2.shape | |
from geoalchemy2 import WKBElement | |
from pydantic import BaseModel, Field, validator | |
from shapely.geometry import Point, asShape | |
from shapely.geometry.base import BaseGeometry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from typing import Dict, Optional | |
import tomlkit | |
def _get_project_meta(pyproj_path: str = "./pyproject.toml") -> Dict[str, str]: | |
if os.path.exists(pyproj_path): | |
with open(pyproj_path, "r") as pyproject: | |
file_contents = pyproject.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Dark theme for coverage.py HTML report | |
config reference: https://coverage.readthedocs.io/en/coverage-5.1/config.html#html | |
original: https://github.com/nedbat/coveragepy/blob/master/coverage/htmlfiles/style.css | |
*/ | |
@charset "UTF-8"; | |
/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ | |
/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from h3 import h3 | |
import geojson | |
from geojson import Feature, Polygon, FeatureCollection | |
from pathlib import Path | |
export_path = Path(".") | |
bbox = { | |
"type": "Polygon", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update SSM environment variables using a local dotenv file (.env.production by default) | |
# Note: `chamber import` doesn't convert keys to lowercase, so that is handled in Python | |
python3 -c 'import json, os, dotenv; values={k.lower():v for k,v in dotenv.dotenv_values(".env.production").items()}; print(json.dumps(values))' | jq | aws-vault exec ${ENV} -- chamber import ihs - | |
# more about chamber: https://github.com/segmentio/chamber |