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

V1.0.2 #295

Merged
merged 7 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ COPY ./stormpiper/requirements.txt /requirements.txt
RUN mkdir /core \
&& pip wheel \
--wheel-dir=/core \
-r /requirements.txt
-r /requirements.txt \
hatchling
RUN mkdir /gunicorn \
&& pip wheel \
--wheel-dir=/gunicorn \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add ddt to tmnt attr

Revision ID: 4c54e753599b
Revises: 452744bc099f
Create Date: 2023-08-18 22:57:02.394645

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "4c54e753599b"
down_revision = "452744bc099f"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"tmnt_facility_attribute",
sa.Column("treatment_drawdown_time_hr", sa.Float(), nullable=True),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("tmnt_facility_attribute", "treatment_drawdown_time_hr")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion stormpiper/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Mako==1.2.4
MarkupSafe==2.1.3
matplotlib==3.7.2
multidict==6.0.4
nereid @ https://github.com/Geosyntec/nereid/archive/v0.8.0.zip
nereid-engine @ https://github.com/Geosyntec/nereid/archive/v0.9.1.zip
networkx==3.1
numpy==1.25.1
orjson==3.9.2
Expand Down
2 changes: 1 addition & 1 deletion stormpiper/requirements_unpinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ watchfiles
asgi-ratelimit

pint
nereid @ https://github.com/Geosyntec/nereid/archive/v0.8.0.zip
nereid-engine @ https://github.com/Geosyntec/nereid/archive/v0.9.1.zip
setuptools
wheel

Expand Down
1 change: 1 addition & 0 deletions stormpiper/stormpiper/database/schemas/tmnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class TMNTFacilityAttr(Base, MutableTrackedTable):
minimum_retention_pct_override = Column(Float)
treatment_rate_cfs = Column(Float)
depth_ft = Column(Float)
treatment_drawdown_time_hr = Column(Float)

# simplified attrs
captured_pct = Column(Float)
Expand Down
1 change: 1 addition & 0 deletions stormpiper/stormpiper/models/tmnt_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TMNTFacilityAttrBase(BaseModel):
minimum_retention_pct_override: None | float = None
treatment_rate_cfs: None | float = None
depth_ft: None | float = None
treatment_drawdown_time_hr: None | float = None

# simplified attrs
captured_pct: None | float = None
Expand Down
48 changes: 40 additions & 8 deletions stormpiper/stormpiper/spa/src/assets/geojson/coreLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const swInlet = {
},
};

export const swManHole = {
export const swManHoleModel = {
layer: GeoJsonLayer,
props: {
data: collatePaginatedQuery({
Expand All @@ -231,13 +231,12 @@ export const swManHole = {
},
},
},
id: "swManHole",
id: "swManHoleModel",
featurePKField: "OBJECTID",
label: "Regional Facility Model: Manholes",
featureType: "points",
minZoom: 14,
zorder: 10,

pointType: "circle",
pointRadiusUnits: "pixels",
defaultFillColor: colorToList("grey"),
Expand All @@ -253,6 +252,38 @@ export const swManHole = {
},
};

export const swManHole = {
layer: GeoJsonLayer,
props: {
data: collatePaginatedQuery({
url: "https://gis.cityoftacoma.org/arcgis/rest/services/ES/SurfacewaterNetwork/MapServer/23",
fields: ["FACILITYID", "ALTID"],
}),
loadOptions: {
fetch: {
headers: {
Authorization: Authorization,
},
},
},
id: "swManHole",
featurePKField: "OBJECTID",
label: "Manholes",
featureType: "points",
minZoom: 14,
zorder: 10,
pointType: "circle",
pointRadiusUnits: "pixels",
defaultFillColor: colorToList("grey"),
getFillColor: colorToList("grey"),
getPointRadius: 3,
getLineWidth: 1,
lineWidthUnits: "pixels",
pickable: true,
onByDefault: false,
},
};

export const delineations = {
layer: GeoJsonLayer,
props: {
Expand Down Expand Up @@ -407,10 +438,11 @@ export const subbasins = {
"polygons-stroke": {
type: StrokedPathLayer,
getPath: (d) => d,
getWidth: 4,
getColor: colorToList("black", 1),
getOutlineWidth: 12,
getOutlineColor: colorToList("orange", 1),
getWidth: 0.5,
widthUnits: "pixels",
getColor: colorToList("midgrey", 1),
getOutlineWidth: 2,
getOutlineColor: colorToList("orange", 0.25),
},
},
},
Expand Down Expand Up @@ -658,7 +690,7 @@ export const layerDict = {
Delineations: [delineations, subbasins],
},
"Base Layers": {
Conveyance: [swTrunk, swMain, swCBLead, swInlet, swManHole],
Conveyance: [swTrunk, swMain, swCBLead, swInlet, swManHole, swManHoleModel],
Landuse: [
landCoverRaster,
imperviousnessRaster,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export function BMPDetailForm() {
msg = msg.replaceAll(beginningText, "");

let err = msg.match(/([\w\s.;=_]*)\([\w.=;\s]+\)/g);
console.log("Found errors:", err);
if (err) {
err.map((e) => {
errorList.push(e.replace(/\([\w.=;\s]+\)/g, "")); //remove the error type in parantheses
Expand Down Expand Up @@ -208,9 +207,9 @@ export function BMPDetailForm() {
{errorMsg && _renderErrorHeader(errorMsg)}
</Typography>
<List sx={{ mt: 0, pr: 1 }}>
{_getErrorList(errorMsg).map((msg) => {
{_getErrorList(errorMsg).map((msg, i) => {
return (
<ListItem>
<ListItem key={i}>
<Typography variant="caption">{msg}</Typography>
</ListItem>
);
Expand Down
4 changes: 4 additions & 0 deletions stormpiper/stormpiper/spa/src/components/map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const tooltipFieldDict = {
swCBLead: [{ id: "ALTID", label: "Lead ID" }],
swInlet: [{ id: "ALTID", label: "Inlet ID" }],
swManHole: [
{ id: "FACILITYID", label: "Facility ID" },
{ id: "ALTID", label: "ALTID" },
],
swManHoleModel: [
{ id: "MH_DrainageArea_ALTID", label: "Manhole ID" },
{ id: "MH_DrainageArea_UPST_IMPVS", label: "Upstream Impervious Acres" },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function AllScenariosMap({
<Box
sx={{
width: "100%",
height: "300px",
height: "400px",
position: "relative",
overflowY: "hidden",
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import {
} from "react";
import { api_fetch } from "../../utils/utils";
import { BMPForm } from "../bmpForm";
import { Box, Dialog, DialogActions, Typography, Button } from "@mui/material";
import {
Box,
Dialog,
DialogActions,
Typography,
Button,
List,
} from "@mui/material";

export const ScenarioBMPForm = forwardRef(function ScenarioBMPForm(
{ facilitySetter, facility, formDisabled, showHelperText },
Expand Down Expand Up @@ -120,7 +127,7 @@ export const ScenarioBMPForm = forwardRef(function ScenarioBMPForm(
if (header) {
return header[0];
} else {
return header;
return msg;
}
}

Expand Down Expand Up @@ -216,20 +223,23 @@ export const ScenarioBMPForm = forwardRef(function ScenarioBMPForm(
</DialogActions>
</Dialog>
<Dialog open={resultError} onClose={() => setResultError(false)}>
<Box sx={{ padding: "15px" }}>
<Box sx={{ p: 2 }}>
<Typography>
<strong>Error Saving Scenario</strong>
</Typography>
<Typography variant="caption">Please try again</Typography>
</Box>
<Typography variant="caption" sx={{ padding: "0em 1em" }}>
{_renderErrorHeader(errorMsg)}
<Typography variant="caption" sx={{ py: 0, px: 2 }}>
{errorMsg && _renderErrorHeader(errorMsg)}
</Typography>
<ul style={{ "margin-top": "none", "padding-right": "1em" }}>
{_getErrorList(errorMsg).map((msg) => {
return <li>{msg}</li>;
<List sx={{ mt: 0, pr: 1 }}>
{_getErrorList(errorMsg).map((msg, i) => {
return (
<ListItem key={i}>
<Typography variant="caption">{msg}</Typography>
</ListItem>
);
})}
</ul>
</List>
</Dialog>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ export default function ScenarioCreateMap({
position: "relative",
display: "flex",
flexDirection: "column",
pointerEvents: "none",
}}
>
<Box
Expand Down
Loading