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

Feature/diagnostics list #27

Merged
merged 22 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ccbc601
added schema testing with django models
brandonzhu09 Mar 28, 2024
b4aab6c
added back env variables in actions
brandonzhu09 Mar 28, 2024
ec19211
fixed actions
brandonzhu09 Mar 28, 2024
6d5fb3c
migrated input tool tests
brandonzhu09 Apr 18, 2024
f4d7922
created django input app
brandonzhu09 Apr 19, 2024
0c65a3a
fixed input tool testing
brandonzhu09 Apr 19, 2024
2c3618c
added actions for evagram input
brandonzhu09 Apr 19, 2024
96e4e8d
Created PlotList component to render multiple diagnostics
brandonzhu09 May 9, 2024
968e179
Created dynamic channel dropdown menu
brandonzhu09 May 17, 2024
6580924
Simplified channel toggling logic
brandonzhu09 May 17, 2024
c509ec9
Fixed behavior for updating options
brandonzhu09 May 20, 2024
d25c9a4
Added mapplots in diagnostics list
brandonzhu09 Jun 1, 2024
4dd3f3d
Added support for latest version bokeh plots
brandonzhu09 Jun 18, 2024
d15ab27
Merge branch 'develop' into feature/diagnostics_list
brandonzhu09 Jun 18, 2024
e5941ff
Fixed whitespace
brandonzhu09 Jun 18, 2024
364aaf8
Fixed production dbname in django
brandonzhu09 Jun 18, 2024
501ec57
Setting to localhost env variable
brandonzhu09 Jun 18, 2024
2d6ef7f
Rewrote unit tests for variable endpoint and more error checking
brandonzhu09 Jun 20, 2024
5df3bec
Update README.md with evagram instructions
brandonzhu09 Jun 28, 2024
4453107
Wrote comments to describe React plot components
brandonzhu09 Jul 4, 2024
8b9f2ae
Merge branch 'feature/diagnostics_list' of https://github.com/JCSDA-i…
brandonzhu09 Jul 4, 2024
85e302c
Update readme
brandonzhu09 Jul 4, 2024
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
41 changes: 0 additions & 41 deletions .github/workflows/test_django_api.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/test_evagram_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ jobs:
- name: Run Django API Tests
run: python src/evagram/website/backend/manage.py test api
env:
DB_HOST: 127.0.0.1
DB_PASSWORD: ${{secrets.DB_PASSWORD}}
8 changes: 7 additions & 1 deletion .github/workflows/test_evagram_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ jobs:
- name: Install Evagram Input Module
run: |
python -m pip install --upgrade pip
pip install evagram_input@git+https://github.com/GEOS-ESM/evagram_input@feature/input_tool --upgrade
pip install evagram_input@git+https://github.com/GEOS-ESM/evagram_input --upgrade

- name: Install Dependencies
run: pip install . -r requirements.txt

- name: Create PGPASS File
run: |
echo 127.0.0.1:5432:test_evagram:postgres:${{secrets.DB_PASSWORD}} >> ~/.pgpass
chmod 600 ~/.pgpass
export PGPASSFILE='/home/runner/.pgpass'

- name: Run Evagram Input Tests
run: python src/evagram/website/backend/manage.py test input_app.test_input_tool
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ __pycache__/
# C extensions
*.so

.prettierrc

# Distribution / packaging
.Python
build/
Expand Down
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3.8"
brandonzhu09 marked this conversation as resolved.
Show resolved Hide resolved
services:
database:
platform: 'linux/amd64'
image: postgres:latest
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: evagram
volumes:
- evagram:/var/lib/postgresql/data/

backend:
restart: always
platform: 'linux/amd64'
build: src/evagram/website/backend
command: >
sh -c "python manage.py migrate &&
python manage.py loaddata api/fixtures/test_data.json
python manage.py runserver 0.0.0.0:8000"
ports:
- 8000:8000
environment:
DB_HOST: database
DB_PASSWORD: $DB_PASSWORD
depends_on:
- database

frontend:
build: src/evagram/website/frontend
ports:
- 3000:3000

volumes:
evagram:
2 changes: 1 addition & 1 deletion pycodestyle.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ max-line-length = 100
indent-size = 4
statistics = True
ignore = W503, W504
exclude = __pycache__, src/evagram/website/backend/api/migrations
exclude = __pycache__, src/evagram/website/backend/api/migrations, src/evagram/website/frontend/node_modules
1 change: 1 addition & 0 deletions src/evagram/website/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
12 changes: 12 additions & 0 deletions src/evagram/website/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:latest

WORKDIR /backend

COPY requirements.txt .
COPY loaddata.py .

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

COPY . .
EXPOSE 8000
2 changes: 0 additions & 2 deletions src/evagram/website/backend/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated by Django 4.2.10 on 2024-03-24 02:17

from django.db import migrations, models
import django.db.models.deletion

Expand Down
37 changes: 32 additions & 5 deletions src/evagram/website/backend/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,62 @@
from rest_framework import serializers
from api.models import *
from django.db import models


class OwnerSerializer(serializers.ModelSerializer):
key = serializers.ModelField(model_field=Owners()._meta.get_field('owner_id'))
value = serializers.ModelField(model_field=Owners()._meta.get_field('owner_id'))
content = serializers.ModelField(model_field=Owners()._meta.get_field('username'))
type = models.CharField(default='owner')

class Meta:
model = Owners
fields = ['owner_id', 'first_name', 'last_name', 'username']
# fields = ['owner_id', 'first_name', 'last_name', 'username']
fields = ['key', 'value', 'content', 'owner_id', 'username']


class ExperimentSerializer(serializers.ModelSerializer):
key = serializers.ModelField(model_field=Experiments()._meta.get_field('experiment_id'))
value = serializers.ModelField(model_field=Experiments()._meta.get_field('experiment_id'))
content = serializers.ModelField(model_field=Experiments()._meta.get_field('experiment_name'))
type = models.CharField(default='experiment')

class Meta:
model = Experiments
fields = ['experiment_id', 'experiment_name']
fields = ['key', 'value', 'content', 'experiment_id', 'experiment_name']


class ObservationSerializer(serializers.ModelSerializer):
key = serializers.ModelField(model_field=Observations()._meta.get_field('observation_id'))
value = serializers.ModelField(model_field=Observations()._meta.get_field('observation_id'))
content = serializers.ModelField(model_field=Observations()._meta.get_field('observation_name'))
type = models.CharField(default='observation')

class Meta:
model = Observations
fields = ['observation_id', 'observation_name']
fields = ['key', 'value', 'content', 'observation_id', 'observation_name']


class VariableSerializer(serializers.ModelSerializer):
key = serializers.ModelField(model_field=Variables()._meta.get_field('variable_id'))
value = serializers.ModelField(model_field=Variables()._meta.get_field('variable_id'))
content = serializers.ModelField(model_field=Variables()._meta.get_field('variable_name'))
type = models.CharField(default='variable')

class Meta:
model = Variables
fields = ['variable_id', 'variable_name', 'channel']
fields = ['key', 'value', 'content', 'variable_id', 'variable_name', 'channel']


class GroupSerializer(serializers.ModelSerializer):
key = serializers.ModelField(model_field=Groups()._meta.get_field('group_id'))
value = serializers.ModelField(model_field=Groups()._meta.get_field('group_id'))
content = serializers.ModelField(model_field=Groups()._meta.get_field('group_name'))
type = models.CharField(default='group')

class Meta:
model = Groups
fields = ['group_id', 'group_name']
fields = ['key', 'value', 'content', 'group_id', 'group_name']


class PlotSerializer(serializers.ModelSerializer):
Expand Down
Loading
Loading