Skip to content
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: 3 additions & 0 deletions caterva2/services/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import nbformat
import PIL.Image
import uvicorn
from blosc2 import linalg_funcs_list as linalg_funcs

# FastAPI
from fastapi import Depends, FastAPI, Form, Request, UploadFile, responses
Expand Down Expand Up @@ -706,6 +707,8 @@ def make_expr(name: str, expr: str, operands: dict[str, str], user: db.User, com
path = settings.personal / str(user.id)
path.mkdir(exist_ok=True, parents=True)
urlpath = f"{path / name}.b2nd"
if any(method in expr for method in linalg_funcs):
compute = True
if compute:
arr.compute(urlpath=urlpath, mode="w")
else:
Expand Down
2 changes: 2 additions & 0 deletions caterva2/tests/test_hdf5_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ def test_expression(expression, examples_dir, tmp_path, auth_client):
operands = {"a": str(remote_root) + "/" + str(remote_a), "b": str(remote_root) + "/" + str(remote_b)}
lxpath = auth_client.lazyexpr("myexpr", expression, operands)
assert lxpath == pathlib.Path("@personal/myexpr.b2nd")
if expression == "matmul(a, b)": # check evaluated eagerly for linalg
assert "expression" not in auth_client.get_info(lxpath)

# Compute the expression
result = auth_client.get_slice(lxpath)
Expand Down