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

Model redesign #30

Merged
merged 77 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f6ee54c
Reorganize model definitions (first pass)
annehaley Oct 9, 2023
1cde6c9
Use relative locations for docker volume mounts and fix tox
annehaley Oct 9, 2023
27ecae0
Start new migration history
annehaley Oct 9, 2023
a22b715
Udate admin.py for new models
annehaley Oct 9, 2023
3c74ab7
Format new models files
annehaley Oct 9, 2023
d894e77
Update rest viewsets for new models
annehaley Oct 9, 2023
acda2c3
Update model references in tasks
annehaley Oct 9, 2023
d28edfa
Various design changes
annehaley Oct 9, 2023
aaa1c7f
Another design iteration
annehaley Oct 11, 2023
3e6b67f
Small changes to some fields
annehaley Oct 12, 2023
1afb1f4
Separate Charts from DataSources
annehaley Oct 12, 2023
cd31d9e
Fix Chart-FileItem relationship
annehaley Oct 12, 2023
bdcece6
Update populate script and conversion tasks
annehaley Oct 12, 2023
87d8195
Rename DataSources to MapLayers
annehaley Oct 18, 2023
cfd6a07
Change Cities into Contexts
annehaley Oct 18, 2023
edb1ada
Rename "Original" to "Source"
annehaley Oct 19, 2023
08779f3
Use S3FileField for large geojson data
annehaley Oct 19, 2023
7597f1b
Add more print statements for object creations
annehaley Oct 19, 2023
384194e
Include population script successful output as txt file
annehaley Oct 19, 2023
d0faf2f
Call tox environments as separate CI steps
annehaley Oct 19, 2023
537153b
Fix linting
annehaley Oct 19, 2023
9efb8e3
Move env to run step for pytest & check-migrations
annehaley Oct 19, 2023
ea94851
More lint fixes
annehaley Oct 19, 2023
ba68040
Use native environment file for testing
annehaley Oct 19, 2023
a214b4f
Fix multi-container environment with compose action
annehaley Oct 19, 2023
48dfb09
Fix import of DerivedRegionCreationError (changed name for lint)
annehaley Oct 19, 2023
4c3917e
Use repository link to install django-configurations, latest version
annehaley Oct 20, 2023
f6789e2
Add populate test
annehaley Oct 20, 2023
1305b01
Ensure large-image-converter is installed prior to pytest
annehaley Oct 20, 2023
7fb50ea
City -> Context
annehaley Oct 23, 2023
c0b6a8d
Resolve import errors with consistent Vue setup structure
annehaley Oct 23, 2023
9f17c5f
Fix some rest endpoints
annehaley Oct 23, 2023
ad49ab1
Fix some typing
annehaley Oct 23, 2023
9f80c14
Add a test for client lint/type
annehaley Oct 23, 2023
432828b
Disable failure on warnings for lint-client
annehaley Oct 23, 2023
1ef509e
Other store typing changes
annehaley Oct 23, 2023
6128827
Merge changes from #32
annehaley Oct 23, 2023
43f85be
Fix CI syntax
annehaley Oct 23, 2023
159b5b7
Update conversion tasks for networks and regions
annehaley Oct 26, 2023
a574476
More API changes
annehaley Oct 26, 2023
8c13bd1
Enable GCC features
annehaley Oct 26, 2023
4b9a3b3
Lint fixes
annehaley Oct 26, 2023
085d830
Fix web client build warnings related to versions
annehaley Oct 26, 2023
03ae6c3
Fix population of GCC chart
annehaley Oct 26, 2023
04966ab
Create slider for current map layer (shown for datasets where more th…
annehaley Oct 26, 2023
e6bd902
More fixes for layer behavior
annehaley Oct 27, 2023
632236a
Esure context switching clears state and fetches new objects
annehaley Oct 27, 2023
f7bb553
Enable Simulations features
annehaley Oct 27, 2023
eb1fe01
Improve vector map layer styling to highlight GCC
annehaley Oct 27, 2023
5431478
Enable Derived Regions features
annehaley Oct 30, 2023
c20c94e
Lint fixes
annehaley Oct 30, 2023
9d3f8c7
Switch order of populate script function calls (Datasets come first)
annehaley Oct 30, 2023
fb93dfd
Allow user to apply style changes to all layers in Dataset
annehaley Oct 31, 2023
34b79f3
Add label to Context dropdown
annehaley Oct 31, 2023
790e6df
Fix applying zIndex when switching layers on the same Dataset
annehaley Oct 31, 2023
6acaaf6
Add indexes and constraints to VectorTile
jjnesbitt Nov 2, 2023
a088c52
Remove geojson_data JSONField, reorg geojson funcs
jjnesbitt Nov 2, 2023
cef6f5e
Add dataset classification
jjnesbitt Nov 7, 2023
a3df988
Use tile extents instead of tile coords
jjnesbitt Nov 9, 2023
0efeab8
Fix type errors for AbstractLayer
jjnesbitt Nov 9, 2023
c96ff90
Don't create local paths for service volumes
jjnesbitt Nov 14, 2023
f987749
Retrieve map layers from dataset detail endpoint
jjnesbitt Nov 14, 2023
4e19483
Fix linting
jjnesbitt Nov 15, 2023
4ab6137
Squash migrations into initial
jjnesbitt Nov 15, 2023
4b62b03
Add TODO
jjnesbitt Nov 17, 2023
55fbff5
Exclude "Extended" serializers from serializer matches in `get_availa…
annehaley Nov 17, 2023
3d4287f
Use already-fetched map layers, consistent use of caching and types
annehaley Nov 17, 2023
1175a1b
Fix reference to "dataset" object (instead of "Dataset" class)
annehaley Nov 17, 2023
334b445
Add TODO
jjnesbitt Nov 21, 2023
52d8d4d
Merge pull request #35 from OpenGeoscience/web-updates-updates
jjnesbitt Nov 22, 2023
93ae876
Fix bug in getOrCreateLayerFromID
jjnesbitt Nov 22, 2023
56eab4a
Merge pull request #34 from OpenGeoscience/web-updates
annehaley Nov 22, 2023
a2026de
Merge pull request #33 from OpenGeoscience/ci-testing
annehaley Nov 27, 2023
6459e75
Merge remote-tracking branch 'origin/master' into model-redesign
annehaley Nov 27, 2023
dfe4c74
Use `selectedDerivedRegions` storage instead of `isDerivedRegionSelec…
annehaley Nov 27, 2023
0a2c9ca
Update behavior around availableDerivedRegions
jjnesbitt Nov 27, 2023
361ec2f
Fix layers edge case bugs
annehaley Nov 27, 2023
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
84 changes: 49 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,56 @@ on:
push:
branches:
- master

jobs:
test:

lint:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: django
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
minio:
# This image does not require any command arguments (which GitHub Actions don't support)
image: bitnami/minio:latest
env:
MINIO_ROOT_USER: minioAccessKey
MINIO_ROOT_PASSWORD: minioSecretKey
ports:
- 9000:9000
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- run: pip install tox
- name: Lint
run: tox -e lint

lint-client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: cd web && npm i && npm run lint

pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: adambirds/[email protected]
with:
compose-file: |
docker-compose.yml
docker-compose.override.yml
services: |
django
celery
postgres
minio
rabbitmq
test-container: django
test-command: "tox -e test"

check-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: adambirds/[email protected]
with:
python-version: "3.10"
- name: Build docker image
run: docker build -t test -f dev/django.Dockerfile .
- name: Run tests
run: |
docker run test tox
env:
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django
DJANGO_MINIO_STORAGE_ENDPOINT: localhost:9000
DJANGO_MINIO_STORAGE_ACCESS_KEY: minioAccessKey
DJANGO_MINIO_STORAGE_SECRET_KEY: minioSecretKey
compose-file: |
docker-compose.yml
docker-compose.override.yml
services: |
django
celery
postgres
minio
rabbitmq
test-container: django
test-command: "tox -e check-migrations"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.terraform/
postgres/*
minio/*
rabbitmq/*
.vscode/
staticfiles/
sample_data/**/*
sample_data/*/*

# Created by https://www.gitignore.io/api/django
# Edit at https://www.gitignore.io/?templates=django
Expand Down
2 changes: 1 addition & 1 deletion dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.10-slim
# * psycopg2
RUN apt-get update && \
apt-get install --no-install-recommends --yes \
libpq-dev libvips-dev gcc libc6-dev gdal-bin && \
libpq-dev libvips-dev gcc libc6-dev gdal-bin git && \
rm -rf /var/lib/apt/lists/*

ENV PYTHONDONTWRITEBYTECODE 1
Expand Down
43 changes: 21 additions & 22 deletions sample_data/charts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
{
"name": "Boston Harbor Daily Tide Levels",
"description": "Raw data was obtained using the NOAA CO-OPS API for Data Retrieval and reformatted in tabular form",
"category": "ocean",
"city": "Boston, MA",
"raw_data_type": "csv",
"url": "https://data.kitware.com/api/v1/item/64beb508b4d956782eee8cb1/download",
"path": "boston/tide_level_data.csv",
"context": "Boston Transportation",
"files": [
{
"url": "https://data.kitware.com/api/v1/item/64beb508b4d956782eee8cb1/download",
"path": "boston/tide_level_data.csv"
}
],
"editable": false,
"metadata": {
"columns": {
"Date": "YYYY-MM-DD",
Expand Down Expand Up @@ -36,23 +39,19 @@
"x_title": "Date Recorded",
"y_title": "Distance from Sensor (m)"
},
"style": {
"options": {
"chart": {
"labels": "Date",
"datasets": [
"HH",
"H",
"L",
"LL"
]
},
"palette": {
"HH": "red",
"H": "pink",
"L": "lightblue",
"LL": "blue"
}
"conversion_options": {
"labels": "Date",
"datasets": [
"HH",
"H",
"L",
"LL"
],
"palette": {
"HH": "red",
"H": "pink",
"L": "lightblue",
"LL": "blue"
}
}
}
Expand Down
56 changes: 56 additions & 0 deletions sample_data/contexts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"name": "Boston Transportation",
"default_map_center": [
42.4,
-71.1
],
"default_map_zoom": 11,
"datasets": [
"MBTA Rapid Transit",
"MBTA Commuter Rail",
"Massachusetts Elevation Data",
"Boston Hurricane Surge Inundation Zones",
"Bsoton FEMA National Flood Hazard",
"Boston Neighborhoods",
"Boston Census 2020 Block Groups",
"Boston Zip Codes",
"Boston Sea Level Rises",
"Boston 10-Year Flood Events",
"Boston 100-Year Flood Events"
]
},
{
"name": "DC Transportation",
"default_map_center": [
38.9,
-77.1
],
"default_map_zoom": 11,
"datasets": [
"DC Metro"
]
},
{
"name": "Boston-Washington Transportation",
"default_map_center": [
40.5,
-74.5
],
"default_map_zoom": 8,
"datasets": [
"MBTA Rapid Transit",
"MBTA Commuter Rail",
"Massachusetts Elevation Data",
"Boston Hurricane Surge Inundation Zones",
"Bsoton FEMA National Flood Hazard",
"Boston Neighborhoods",
"Boston Census 2020 Block Groups",
"Boston Zip Codes",
"Boston Sea Level Rises",
"Boston 10-Year Flood Events",
"Boston 100-Year Flood Events",
"DC Metro"
]
}
]
Loading