File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ dev-dependencies = [
39
39
" python-type-stubs @ git+https://github.com/wearepal/python-type-stubs@95a26e5" ,
40
40
]
41
41
42
+ [tool .rye .scripts ]
43
+ rrm = {cmd =" python run/rrm_credit_lr.py" }
44
+
42
45
[tool .hatch .metadata ]
43
46
allow-direct-references = true
44
47
@@ -136,3 +139,15 @@ reportUnknownArgumentType = "none"
136
139
reportUnknownLambdaType = " none"
137
140
venvPath = " ."
138
141
venv = " .venv"
142
+
143
+ [tool .pytest .ini_options ]
144
+ python_files = " *.py"
145
+ python_classes = " Test"
146
+ python_functions = " test_*"
147
+ addopts = [" --import-mode=importlib" ]
148
+ # Ignore deprecation warnings coming from pytest/pkg_resources
149
+ # that pollute the console output when testing.
150
+ filterwarnings = [
151
+ " ignore::DeprecationWarning:_pytest.*:" ,
152
+ " ignore::DeprecationWarning:pkg_resources.*:"
153
+ ]
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def respond(
32
32
"'action' should correspond to the feature weights and thus must have entries "
33
33
"numbering the number of columns in 'features'"
34
34
)
35
- changeable_features = unwrap_or (self .changeable_features , default = slice ( None ) )
35
+ changeable_features = unwrap_or (self .changeable_features , default = [] )
36
36
new_features = np .copy (features )
37
37
38
38
neg_item_mask = np .dot (action [None , :], features [...].T )[0 ] < 0
@@ -164,7 +164,8 @@ def test_rir_response():
164
164
165
165
response_fn = RIRResponse (epsilon = 1.0 , changeable_features = None )
166
166
new_features = response_fn (features = features , action = action )
167
- assert not np .testing .assert_array_equal (features , new_features )
167
+ with pytest .raises (AssertionError ):
168
+ assert np .testing .assert_array_equal (features , new_features )
168
169
169
170
changeable_features = np .array ([0 , 2 ])
170
171
response_fn = RIRResponse (epsilon = 1.0 , changeable_features = changeable_features )
You can’t perform that action at this time.
0 commit comments