Skip to content

Commit

Permalink
Vectorize dc and dmc (#3764)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss authored Jul 5, 2024
1 parent 158fbe0 commit f08acb8
Show file tree
Hide file tree
Showing 6 changed files with 3,664 additions and 8 deletions.
6 changes: 4 additions & 2 deletions api/app/auto_spatial_advisory/sfms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from cffdrs import bui
from cffdrs import bui, dc, dmc
from numba import vectorize

vectorized_bui = vectorize(bui)
vectorized_bui = vectorize(bui)
vectorized_dc = vectorize(dc)
vectorized_dmc = vectorize(dmc)
1,819 changes: 1,819 additions & 0 deletions api/app/tests/sfms/test_sfms_dc_vectorized.py

Large diffs are not rendered by default.

1,819 changes: 1,819 additions & 0 deletions api/app/tests/sfms/test_sfms_dmc_vectorized.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions api/app/tests/utils/numpy_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import numpy as np


def create_numpy_array(value) -> np.ndarray:
return np.array([[value, value, value], [value, value, value], [value, value, value]])
18 changes: 14 additions & 4 deletions api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ httpx = "^0.27.0"
orjson = "^3.9.0"
greenlet = "^3.0.0"
sentry-sdk = {extras = ["fastapi"], version = "^2.0.1"}
cffdrs = {version = "^0.1.0", source = "psu"}
numba = "^0.59.1"
cffdrs = {version = "^0.1.1", source = "psu"}

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.1"
Expand Down Expand Up @@ -103,4 +103,5 @@ per-file-ignores = { "alembic/versions/00df3c7b5cba_rethink_classification.py" =
"F811",
] }
line-length = 185
ignore = ["E712"]
ignore = ["E712", "F401"]

0 comments on commit f08acb8

Please sign in to comment.