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

Critical Hours #3849

Merged
merged 48 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
68f3b8f
Critical hours job
dgboss Aug 13, 2024
4e97f4e
Critical hours with nats
dgboss Aug 13, 2024
01bb18b
Merge branch 'main' into task/critical-hours/3746
dgboss Aug 13, 2024
d06a999
Remove critical hours as a job
dgboss Aug 14, 2024
b81180e
Fix geospatial
dgboss Aug 14, 2024
85aea32
Add migration file
dgboss Aug 14, 2024
2a5d536
Fix type
dgboss Aug 14, 2024
d4e4186
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 15, 2024
4c64b5e
Fix import reference, bump memory for consumer
conbrad Aug 15, 2024
195bab8
Trigger Build
conbrad Aug 16, 2024
000a43b
Fix migration head
conbrad Aug 19, 2024
dd516ef
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 19, 2024
d080b49
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 19, 2024
02ec91f
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 19, 2024
44b5b2e
Add WFWX secrets to consumer
conbrad Aug 20, 2024
4ab9b5e
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 20, 2024
6f85567
Add base URL
conbrad Aug 20, 2024
c43a3ce
Add redis config
conbrad Aug 20, 2024
6394cd7
Add some types and logging
conbrad Aug 20, 2024
6531708
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 20, 2024
733c71a
Merge branch 'main' into task/critical-hours/3746
conbrad Aug 21, 2024
6af3d92
Add some tests for valid station
conbrad Aug 22, 2024
eff84c2
Tests for critical hours
conbrad Aug 22, 2024
3860ca3
Add typings
conbrad Aug 22, 2024
4d41932
Pull out and simplify input retrieval
conbrad Aug 22, 2024
d70967a
Remove unnecessary async
conbrad Aug 22, 2024
0a901e4
Encapsulate critical hours inputs to simplify
conbrad Aug 23, 2024
126d63f
Add todo
conbrad Aug 23, 2024
8a7946c
Fix tests, add comment
conbrad Sep 3, 2024
4a2dcb8
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 3, 2024
fe8e345
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 3, 2024
cffde1d
Add test
conbrad Sep 3, 2024
03dac50
Remove todo
conbrad Sep 3, 2024
d11de5e
Update comment
conbrad Sep 3, 2024
a73d697
Rename
conbrad Sep 3, 2024
b287211
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 3, 2024
c73053d
Adjust rel tol
conbrad Sep 3, 2024
9a768b9
try again
conbrad Sep 3, 2024
3046b4f
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 3, 2024
c23ccb5
Undo test
conbrad Sep 3, 2024
698d608
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 4, 2024
af4bd2a
Code review feedback
conbrad Sep 4, 2024
66896a9
Update api/app/tests/auto_spatial_advisory/test_critical_hours.py
conbrad Sep 4, 2024
62a1b6b
Code feedback
conbrad Sep 4, 2024
0f6809a
No return
conbrad Sep 4, 2024
45b76c3
Shrink memory resources for nats consumer back down
conbrad Sep 5, 2024
967c9aa
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 5, 2024
cfd4872
Merge branch 'main' into task/critical-hours/3746
conbrad Sep 5, 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
9 changes: 8 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@
"console": "integratedTerminal",
},
{
"name": "app.jobs.rdps_sfms ",
"name": "app.jobs.rdps_sfms",
"type": "python",
"request": "launch",
"module": "app.jobs.rdps_sfms",
"console": "integratedTerminal"
},
{
"name": "local critical hours",
"type": "python",
"request": "launch",
"module": "app.auto_spatial_advisory.critical_hours",
"console": "integratedTerminal"
},
{
"name": "Chrome",
"type": "pwa-chrome",
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"excinfo",
"fastapi",
"FBAN",
"ffmc",
"fireweather",
"firezone",
"GDPS",
Expand Down Expand Up @@ -110,6 +111,7 @@
"reproject",
"rocketchat",
"rollup",
"rtol",
"sessionmaker",
"sfms",
"sqlalchemy",
Expand Down
57 changes: 57 additions & 0 deletions api/alembic/versions/c9e46d098c73_critical_hours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""Critical hours

Revision ID: c9e46d098c73
Revises: 6910d017b626
Create Date: 2024-08-12 16:24:00.489375

"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "c9e46d098c73"
down_revision = "6910d017b626"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
conbrad marked this conversation as resolved.
Show resolved Hide resolved
op.create_table(
"critical_hours",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("advisory_shape_id", sa.Integer(), nullable=False),
sa.Column("threshold", sa.Enum("advisory", "warning", name="hficlassificationthresholdenum"), nullable=False),
sa.Column("run_parameters", sa.Integer(), nullable=False),
sa.Column("fuel_type", sa.Integer(), nullable=False),
sa.Column("start_hour", sa.Integer(), nullable=False),
sa.Column("end_hour", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["advisory_shape_id"],
["advisory_shapes.id"],
),
sa.ForeignKeyConstraint(
["fuel_type"],
["sfms_fuel_types.id"],
),
sa.ForeignKeyConstraint(
["run_parameters"],
["run_parameters.id"],
),
sa.PrimaryKeyConstraint("id"),
comment="Critical hours by firezone unit, fuel type and sfms run parameters.",
)
op.create_index(op.f("ix_critical_hours_advisory_shape_id"), "critical_hours", ["advisory_shape_id"], unique=False)
op.create_index(op.f("ix_critical_hours_fuel_type"), "critical_hours", ["fuel_type"], unique=False)
op.create_index(op.f("ix_critical_hours_id"), "critical_hours", ["id"], unique=False)
op.create_index(op.f("ix_critical_hours_run_parameters"), "critical_hours", ["run_parameters"], unique=False)


def downgrade():
op.drop_index(op.f("ix_critical_hours_run_parameters"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_id"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_fuel_type"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_advisory_shape_id"), table_name="critical_hours")
op.drop_table("critical_hours")
Loading
Loading