File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ def output_formats_mapping(self) -> Dict[str, str]:
7171 "html" : "HTML" ,
7272 "stdout" : "Output" ,
7373 "stderr" : "Errors" ,
74+ "json" : "Results" ,
7475 }
7576
7677
@@ -100,6 +101,7 @@ def output_formats_mapping(self) -> Dict[str, str]:
100101 "html" : "HTML" ,
101102 "stdout" : "Output" ,
102103 "stderr" : "Errors" ,
104+ "json" : "Results" ,
103105 }
104106
105107
Original file line number Diff line number Diff line change @@ -309,9 +309,15 @@ async def post(self):
309309 payload ["backend" ] = backend .config .id
310310 scheduler = backend .scheduler
311311
312- # Set default output_formats for Python backend
313- if backend .config .id == "jupyter_server_py" and not payload .get ("output_formats" ):
314- payload ["output_formats" ] = ["stdout" , "stderr" ]
312+ # Set default output_formats based on file type
313+ if not payload .get ("output_formats" ):
314+ input_uri = payload .get ("input_uri" , "" )
315+ if input_uri .endswith (".py" ):
316+ payload ["output_formats" ] = ["stdout" , "stderr" ]
317+ elif input_uri .endswith (".qasm" ):
318+ payload ["output_formats" ] = ["json" ]
319+ elif input_uri .endswith (".ipynb" ):
320+ payload ["output_formats" ] = ["ipynb" , "html" ]
315321 else :
316322 # Fallback to default scheduler (backwards compatibility)
317323 scheduler = self .scheduler
You can’t perform that action at this time.
0 commit comments