This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Handle Azure quantum known exceptions #218
Merged
cesarzc
merged 10 commits into
feature/azure-quantum-preview
from
cesarzc/azure-quantum-exception-handling
May 27, 2020
Merged
Handle Azure quantum known exceptions #218
cesarzc
merged 10 commits into
feature/azure-quantum-preview
from
cesarzc/azure-quantum-exception-handling
May 27, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…um-exception-handling
…exceptions) into the standalone logic.
bamarsha
approved these changes
May 27, 2020
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
This was referenced May 27, 2020
…um-exception-handling
bamarsha
added a commit
that referenced
this pull request
May 28, 2020
) * Create new project for entry point driver * Fix entry point option values * Add missing dashes to simulator options * Update root namespace * Add driver to nuget package * Manually add EntryPointDriver's dependencies to package * Add doc comments to Validation * Rewrite FindNuspecReferences.ps1 * Type parameterize IEntryPoint * Add reference to EntryPointDriver from tests * Remove entry point driver resources * Rename EntryPointDriver assembly * Remove unneeded generated code * Add documentation to IEntryPoint * Update Driver documentation * Enable C# nullable feature * Avoid multiple enumeration * Remove unnecessary identifier quotations * Remove "Get" prefix * Update variable name/comment * Make Validation and value parsers private/internal * Support IQArray types directly * Remove single-class namespace * Use type parameter in CreateOption * Combine some excessively separated functions * Use WithSuggestions instead of AddSuggestions * Add entry point argument tuple to interface * Fix nested tuples in arguments * Add entry point info to IEntryPoint * Add submit command * Fix typo Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> * Use only one line for shadowing warning * Removed type parameters from IQuantumMachine interface. (#185) * Removed type parameters from IQuantumMachine interface. * Addressed Sarah's feedback. * Update src/Simulation/Core/IQuantumMachineOutput.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Use the new IQuantumMachine interface * Add TODO for histogram output * Add command-line options for Azure submission * Small code style fixes * Use real provider for Azure submission * Remove TODO from the wrong place * Use SimulatorMachine based on target name * Add option for number of shots * Validate that shots is positive * Use DefaultIfShadowed for Azure settings * Simplify adding/defaulting options * Make SimulatorOption non-static * Add AddOptionsIfAvailable method * Fix option aliases missing dashes * Disable command if required options are shadowed * Add copyright headers * Add histogram option * Make histogram pretty * Fix shadowing * Update histogram divider dash * Preserve required state of options * Simulator option is not required * Use SubmitAsync instead of ExecuteAsync * Add access token option * Rename ToWorkspace to CreateWorkspace * Remove "Azure" from option descriptions * Print job ID instead of URI for now * Add --base-uri option * Rename --access to --aad-token * Rename --id-only to --output * Add OptionInfo class * Update --shots validator message * Update --base-uri description * Add TODO for "submit" tests * Replace NotImplementedExceptions with NotSupportedExceptions * More specific TODO for number of shots * Don't include default value for required options * Hide "submit" command * Update help test * Add manifest with qsharp-runtime assemblies requiring signing (#200) (#202) * Add manifest with assemblies requiring signing * Add manifest.ps1 to build steps * Run manifest after build completes * Fix manifest.ps1 script error * Fix to manifest.ps1 * Revert unnecessary commit 466dc8c * Update TODO comments * Add test for submit help text * Add more tests for submit command * Add Microsoft.Azure.Quantum.Client sources and QuantumMachineFactory (#203) * Add Microsoft.Azure.Quantum.Client sources * Add project reference to Microsoft.Quantum.Runtime.Core * Add reference to Microsoft.Azure.Quantum.Client * Re-add missing summary start tag * Add Honeywell to QuantumMachineFactory * Allow reflection to find type in loaded assembly (#205) * Update reflection to look for signed assembly first * Use IWorkspace instead of Workspace * Catch exceptions from GetType call * Use package references to runtime components in EntryPointDriver * Revert package references to project references * Add Microsoft.Azure.Quantum.Client as NuGet dependency * Add stubs for new methods in NothingMachine * Add --dry-run option * Set shots in submission context * Add blank line before validation message * Created AzzureQuantumException. (#216) This change adds AzureQuantumException which is the base exception to throw or create new exceptions related to the Azure quantum service or storage. * Merge latest master to have access to QuantumProcessorTranslationException (#217) * Created QuantumProcessorException (#212) * Created QuantumProcessorException. * Provided a default message but added the option to supply a custom one. * Renamed to QuantumProcessorTranslationException. * Improved the default message. * Updating placeholder names to provider names (#215) Co-authored-by: Stefan J. Wernli <swernli@microsoft.com> * Show warning message for OutputFormat.FriendlyUri * Fix tests * Rename test project * Add test for unknown target * Add test project to test.ps1 * Handle Azure quantum known exceptions (#218) * Add the three standard constructors for the newly created exceptions. * Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic. * Removed exception that is not needed. * Improved error message. * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update copyright headers in Azure Quantum client * Remove TODO for audience URI Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Co-authored-by: César Zaragoza Cortés <cesar.zaragoza@outlook.com> Co-authored-by: Ryan Shaffer <ryan.shaffer@microsoft.com> Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
bamarsha
added a commit
that referenced
this pull request
May 28, 2020
* Add the three standard constructors for the newly created exceptions. * Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic. * Removed exception that is not needed. * Improved error message. * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
AniketDalvi
pushed a commit
that referenced
this pull request
Jul 1, 2020
) * Create new project for entry point driver * Fix entry point option values * Add missing dashes to simulator options * Update root namespace * Add driver to nuget package * Manually add EntryPointDriver's dependencies to package * Add doc comments to Validation * Rewrite FindNuspecReferences.ps1 * Type parameterize IEntryPoint * Add reference to EntryPointDriver from tests * Remove entry point driver resources * Rename EntryPointDriver assembly * Remove unneeded generated code * Add documentation to IEntryPoint * Update Driver documentation * Enable C# nullable feature * Avoid multiple enumeration * Remove unnecessary identifier quotations * Remove "Get" prefix * Update variable name/comment * Make Validation and value parsers private/internal * Support IQArray types directly * Remove single-class namespace * Use type parameter in CreateOption * Combine some excessively separated functions * Use WithSuggestions instead of AddSuggestions * Add entry point argument tuple to interface * Fix nested tuples in arguments * Add entry point info to IEntryPoint * Add submit command * Fix typo Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> * Use only one line for shadowing warning * Removed type parameters from IQuantumMachine interface. (#185) * Removed type parameters from IQuantumMachine interface. * Addressed Sarah's feedback. * Update src/Simulation/Core/IQuantumMachineOutput.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Use the new IQuantumMachine interface * Add TODO for histogram output * Add command-line options for Azure submission * Small code style fixes * Use real provider for Azure submission * Remove TODO from the wrong place * Use SimulatorMachine based on target name * Add option for number of shots * Validate that shots is positive * Use DefaultIfShadowed for Azure settings * Simplify adding/defaulting options * Make SimulatorOption non-static * Add AddOptionsIfAvailable method * Fix option aliases missing dashes * Disable command if required options are shadowed * Add copyright headers * Add histogram option * Make histogram pretty * Fix shadowing * Update histogram divider dash * Preserve required state of options * Simulator option is not required * Use SubmitAsync instead of ExecuteAsync * Add access token option * Rename ToWorkspace to CreateWorkspace * Remove "Azure" from option descriptions * Print job ID instead of URI for now * Add --base-uri option * Rename --access to --aad-token * Rename --id-only to --output * Add OptionInfo class * Update --shots validator message * Update --base-uri description * Add TODO for "submit" tests * Replace NotImplementedExceptions with NotSupportedExceptions * More specific TODO for number of shots * Don't include default value for required options * Hide "submit" command * Update help test * Add manifest with qsharp-runtime assemblies requiring signing (#200) (#202) * Add manifest with assemblies requiring signing * Add manifest.ps1 to build steps * Run manifest after build completes * Fix manifest.ps1 script error * Fix to manifest.ps1 * Revert unnecessary commit 466dc8c * Update TODO comments * Add test for submit help text * Add more tests for submit command * Add Microsoft.Azure.Quantum.Client sources and QuantumMachineFactory (#203) * Add Microsoft.Azure.Quantum.Client sources * Add project reference to Microsoft.Quantum.Runtime.Core * Add reference to Microsoft.Azure.Quantum.Client * Re-add missing summary start tag * Add Honeywell to QuantumMachineFactory * Allow reflection to find type in loaded assembly (#205) * Update reflection to look for signed assembly first * Use IWorkspace instead of Workspace * Catch exceptions from GetType call * Use package references to runtime components in EntryPointDriver * Revert package references to project references * Add Microsoft.Azure.Quantum.Client as NuGet dependency * Add stubs for new methods in NothingMachine * Add --dry-run option * Set shots in submission context * Add blank line before validation message * Created AzzureQuantumException. (#216) This change adds AzureQuantumException which is the base exception to throw or create new exceptions related to the Azure quantum service or storage. * Merge latest master to have access to QuantumProcessorTranslationException (#217) * Created QuantumProcessorException (#212) * Created QuantumProcessorException. * Provided a default message but added the option to supply a custom one. * Renamed to QuantumProcessorTranslationException. * Improved the default message. * Updating placeholder names to provider names (#215) Co-authored-by: Stefan J. Wernli <swernli@microsoft.com> * Show warning message for OutputFormat.FriendlyUri * Fix tests * Rename test project * Add test for unknown target * Add test project to test.ps1 * Handle Azure quantum known exceptions (#218) * Add the three standard constructors for the newly created exceptions. * Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic. * Removed exception that is not needed. * Improved error message. * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update src/Simulation/EntryPointDriver/Azure.cs Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com> * Update copyright headers in Azure Quantum client * Remove TODO for audience URI Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Co-authored-by: César Zaragoza Cortés <cesar.zaragoza@outlook.com> Co-authored-by: Ryan Shaffer <ryan.shaffer@microsoft.com> Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change handles two known exceptions that can happen when submitting/executing a program in Azure quantum:
AzureQuantumExceptionQuantumProcessorTranslationException