cda-tum / mqt-core

MQT Core - The Backbone of the Munich Quantum Toolkit
https://mqt.readthedocs.io/projects/core
MIT License
62 stars 31 forks source link

🩹fix loading circuits from `PathLike` objects #681

Closed burgholzer closed 2 months ago

burgholzer commented 2 months ago

Description

This PR fixes a small oversight in the mqt.core.load method, where the method would not work if being passed a PathLike object that is not a string (e.g., a Path). The changes in the PR make sure that such an object is appropriately converted to a string before being passed to the constructor.

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.0%. Comparing base (28dc65e) to head (4165c22). Report is 3 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681/graphs/tree.svg?width=650&height=150&src=pr&token=MqstsRKdqp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) ```diff @@ Coverage Diff @@ ## main #681 +/- ## ===================================== Coverage 87.0% 87.0% ===================================== Files 125 125 Lines 13781 13781 Branches 2164 2164 ===================================== Hits 11995 11995 Misses 1786 1786 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | *Carryforward flag | |---|---|---|---| | [cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `86.6% <ø> (ø)` | | Carriedforward from [28dc65e](https://app.codecov.io/gh/cda-tum/mqt-core/commit/28dc65e0ea04bba1fb70676a290b96709d675d07?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | | [python](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `99.7% <100.0%> (ø)` | | | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) to find out more. | [Files with missing lines](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [src/mqt/core/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-core/pull/681?src=pr&el=tree&filepath=src%2Fmqt%2Fcore%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9jb3JlL19faW5pdF9fLnB5) | `100.0% <100.0%> (ø)` | |