Skip to content

Commit

Permalink
apply manual fix warned by ruff check
Browse files Browse the repository at this point in the history
  • Loading branch information
satos committed Sep 8, 2024
1 parent 348144e commit 28be297
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion misc/MV_python_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_time(self):
return self.number_of_steps

def eval(self, observation):
if self.current_output == None:
if self.current_output is None:
return 0
else:
# MDPの出力は次のような文字列 'agree__six__c1_tails__c2_tails'
Expand Down
4 changes: 2 additions & 2 deletions src/ProbBlackBoxChecking.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def find_cex(self, hypothesis):
if not self.only_classical_equivalence_testing:
logging.info(f"CEX from SMC: {cex}")

if cex != -1 and cex != None:
if cex != -1 and cex is not None:
# 具体的な反例が得られればそれを返す
return cex

Expand All @@ -407,7 +407,7 @@ def find_cex(self, hypothesis):
cex = compare_frequency_with_tail(
smc.exec_sample, mdp, self.statistical_test_bound
)
if cex != None:
if cex is not None:
logging.info(f"CEX from compare_frequency : {cex}")
return cex
logging.info("Could not find counterexample by compare_frequency.")
Expand Down
7 changes: 5 additions & 2 deletions src/prism_export_to_dot_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def main():

labels = {}
name_of_labels = {}
initial_state = None
# XXX: unused
# initial_state = None
label_name_line_regex = re.compile('(\d+="\w+" )*(\d+="\w+")')
label_name_regex = re.compile('(\d+)="(\w+)"')
label_regex = re.compile("(\d+): (.*)")
Expand All @@ -48,7 +49,9 @@ def main():
for idx in m_index:
name = name_of_labels[idx]
if name == "init":
initial_state = m[1]
# XXX: unused
# initial_state = m[1]
pass
if name not in except_names:
label_names.append(name)
labels[m[1]] = "__".join(label_names)
Expand Down
9 changes: 6 additions & 3 deletions src/tests/Smc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ def test_initialize(self):
custom_print(smc.spec_monitor)

smc.reset_sut()
ret = smc.one_step()
# XXX: unused
# ret = smc.one_step()
smc.step_monitor(smc.current_output)
ret = smc.one_step()
# XXX: unused
# ret = smc.one_step()
smc.step_monitor(smc.current_output)
ret = smc.one_step()
# XXX: unused
# ret = smc.one_step()
smc.step_monitor(smc.current_output)

0
Expand Down

0 comments on commit 28be297

Please sign in to comment.