File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ def generate_training_sample(
297297 if num_not_empty_entries == 0 :
298298 return False
299299
300- feature_vec = utils .create_feature_dict (Path (source_path ) / file )
300+ feature_vec = utils .create_feature_dict (str ( Path (source_path ) / file ) )
301301 training_sample = (list (feature_vec .values ()), np .argmax (scores ))
302302 circuit_name = file .split ("." )[0 ]
303303
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ def init_all_config_files():
302302
303303def create_feature_dict (qasm_str_or_path : str ):
304304
305- if Path (qasm_str_or_path ).exists ():
305+ if len ( qasm_str_or_path ) < 260 and Path (qasm_str_or_path ).exists ():
306306 qc = QuantumCircuit .from_qasm_file (qasm_str_or_path )
307307 elif "OPENQASM" in qasm_str_or_path :
308308 qc = QuantumCircuit .from_qasm_str (qasm_str_or_path )
Original file line number Diff line number Diff line change @@ -20,10 +20,13 @@ def test_predict(mock_show):
2020 path = resources .files ("mqt.predictor" ) / "trained_clf.joblib"
2121 assert path .is_file ()
2222 filename = "test_qasm.qasm"
23- benchmark_generator .get_one_benchmark ("dj" , 1 , 8 ).qasm (filename = filename )
23+ qc = benchmark_generator .get_one_benchmark ("dj" , 1 , 8 )
24+ qc .qasm (filename = filename )
2425 predictor = Predictor ()
2526 prediction = predictor .predict (filename )
2627 assert prediction >= 0 and prediction < len (utils .get_index_to_comppath_LUT ())
28+ prediction = predictor .predict (qc .qasm ())
29+ assert prediction >= 0 and prediction < len (utils .get_index_to_comppath_LUT ())
2730 prediction = predictor .predict ("fail test" )
2831 assert not prediction
2932
You can’t perform that action at this time.
0 commit comments