-
Notifications
You must be signed in to change notification settings - Fork 1.2k
%kata magic doesn't recognize C# tests #166
Comments
Is the magic command %kata specified in this repository(ie Quantum Katas) or some other repository? |
It's defined in |
Thanks @tcNickolas. |
@tcNickolas I would like to take up this issue. |
Sure, give it a try and let us know what design you come up with. It's a rather non-trivial issue, so we'll probably want to discuss it with @rmshaffer as well, who is familiar with IQ# internals. Thank you! |
Hi @tcNickolas @rmshaffer, do you have any idea about where to see the Logger messages defined in Some examples are |
@Manvi-Agrawal Yes, you should set the environment variable This logging is very noisy, but hopefully it is manageable. |
Hi @rmshaffer @tcNickolas, I am not able to see the modified error messages in the console window. For eg I tried to modify
I think I would need to create a new version of Microsoft.Quantum.Katas and update the project to see modified error messages. I looked up a few links: Any help would be greatly appreciated. |
Yes, you need to update the Microsoft.Quantum.Katas project, build a NuGet package with a custom version out of it and use that package instead of the published NuGets. Here's the sequence of steps that I use to build and use a private NuGet package:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Local Folder" value="." />
</packageSources>
</configuration>
That should allow the project to pick up the custom version of the package, rather than the published one. I only tried this path with Q# projects, not with IQ#, so there might be some additional hiccups on the way. Let me know if that path works! |
Hi @tcNickolas , seems that these steps aren't sufficient to see updated messages in IQ#. |
Hmm, then this might take a different path... I don't recall debugging these magics, but I'll try to set it up locally and ask around in the team to see how it's done. Meanwhile, it sounded like you were going to work on #557 - I'd suggest doing that one first, since it only involves plain Q# :-) |
Thats a nice suggestion. I would be doing #557 first. |
Hi @tcNickolas ,
I was thinking to update the contributing guide so that it would be easy for the new contributors to validate the changes in |
Hi @tcNickolas @rmshaffer, I think a good approach to solve this issue would be after the following issue is resolved microsoft/iqsharp#277. Because currently IQ# recognises all Q# files in the root folder of jupyter notebook and compiles them into a DLL file like this __ws__{assemblyVersion}{projectFilenamePart}__.dll where This dll unfortunately does not contain the compiled C# code, so we can't call C# code currently. As a workaround, we could try to invoke I would like to know your opinion on the above statement. |
A quick answer to the comment-before-last one: yes, documenting these steps in the contributor's guide would definitely be helpful! Let me try and think of a workaround for this - I feel like I had an idea a couple of weeks ago which involved calling a Python test instead of C# one, but I can't promise that I'll recall it or that it will actually make sense :-) |
We will be migrating the Katas to the new QDK that will use a different infrastructure (see https://devblogs.microsoft.com/qsharp/introducing-the-azure-quantum-development-kit-preview/ for the announcement), so we won't continue to improve the existing infrastructure of Q# notebooks magics. Closing this issue as "won't fix". |
PhaseEstimation kata has a test that covers Q# code but is written in C# due to the need to catch and process exceptions thrown by the task. When the kata is approached as Q# project, the test is recognized and executed together with Q# tests just fine. However, when the kata is converted to Jupyter Notebook format, the
%kata
magic command does not recognize the C# test. This is not unexpected, but ideally we need to come up with a way to execute C# tests from Q# notebooks.This is related to one of the work items in #138.
The text was updated successfully, but these errors were encountered: