add NotImplemented warning for openQCD filter
This commit is contained in:
parent
e95edcb093
commit
6d1f8f7f1b
2 changed files with 31 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ from typing import Any, Optional, Union
|
|||
from pathlib import Path
|
||||
import datetime as dt
|
||||
from collections.abc import Callable
|
||||
import warnings
|
||||
|
||||
|
||||
def _project_lookup_by_alias(db: Path, alias: str) -> str:
|
||||
|
|
@ -162,7 +163,7 @@ def _db_lookup(db: Path, ensemble: str, correlator_name: str, code: str, project
|
|||
return results
|
||||
|
||||
|
||||
def _sfcf_drop(param, **kwargs):
|
||||
def _sfcf_drop(param: dict[str, Any], **kwargs: Any) -> bool:
|
||||
if 'offset' in kwargs:
|
||||
if kwargs.get('offset') != param['offset']:
|
||||
return True
|
||||
|
|
@ -288,6 +289,8 @@ def openQCD_filter(results:pd.DataFrame, **kwargs: Any) -> pd.DataFrame:
|
|||
The filtered results.
|
||||
|
||||
"""
|
||||
warnings.warn("A filter for openQCD parameters is no implemented yet.", Warning)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,33 @@ def test_sfcf_drop() -> None:
|
|||
|
||||
|
||||
def test_openQCD_filter() -> None:
|
||||
assert True
|
||||
record_0 = ["f_A", "ensA", "sfcf", "archive/SF_A/f_A/Project_A.json.gz::asdfasdfasdf", "SF_A", '{"par_A": 5.0, "par_B": 5.0}', "projects/SF_A/input.in",
|
||||
'2025-03-26 12:55:18.229966', '2025-03-26 12:55:18.229966']
|
||||
record_1 = ["f_A", "ensA", "sfcf", "archive/SF_A/f_A/Project_A.json.gz::asdfasdfasdf", "SF_A", '{"par_A": 5.0, "par_B": 5.0}', "projects/SF_A/input.in",
|
||||
'2025-03-26 12:55:18.229966', '2025-03-26 12:55:18.229966']
|
||||
record_2 = ["f_P", "ensA", "sfcf", "archive/SF_A/f_A/Project_A.json.gz::asdfasdfasdf", "SF_A", '{"par_A": 5.0, "par_B": 5.0}', "projects/SF_A/input.in",
|
||||
'2025-03-26 12:55:18.229966', '2025-03-26 12:55:18.229966']
|
||||
record_3 = ["f_P", "ensA", "sfcf", "archive/SF_A/f_A/Project_A.json.gz::asdfasdfasdf", "SF_A", '{"par_A": 5.0, "par_B": 5.0}', "projects/SF_A/input.in",
|
||||
'2025-03-26 12:55:18.229966', '2025-03-26 12:55:18.229966']
|
||||
data = [
|
||||
record_0,
|
||||
record_1,
|
||||
record_2,
|
||||
record_3,
|
||||
]
|
||||
cols = ["name",
|
||||
"ensemble",
|
||||
"code",
|
||||
"path",
|
||||
"project",
|
||||
"parameters",
|
||||
"parameter_file",
|
||||
"created_at",
|
||||
"updated_at"]
|
||||
df = pd.DataFrame(data,columns=cols)
|
||||
|
||||
with pytest.warns(Warning):
|
||||
find.openQCD_filter(df, a = "asdf")
|
||||
|
||||
|
||||
def test_code_filter() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue