Coder Social home page Coder Social logo

Comments (4)

rileyjmurray avatar rileyjmurray commented on August 31, 2024

I've done some looking into why PyTest found some classes with the Tester suffix before I changed pytest.ini. I think this has something to do with class inheritance structures.

Here are the full names used in definitions of relevant classes.

  • QiboEvotypeTester(BaseCase)
    • where BaseCase inherits from unittest.TestCase and is defined in ..util.py.
  • InterpygateConstructionTester(BaseCase)
    • using the same BaseCase from above.
  • LinearOpTester(OpBase)
    • OpBase inherits directly from object and is defined earlier in the same file.
  • RawObjectiveFunctionTester(object).
  • TimeIndependentMDSObjectiveFunctionTester(ObjectiveFunctionData)
    • ObjectiveFunctionData inherits directly from object and is defined earlier in the same file.
  • TimeDependentMDSObjectiveFunctionTester(ObjectiveFunctionData)
    • using the same ObjectiveFunctionData from above.

So it seems that with the current pytest.ini, PyTest automatically finds classes with the Tester suffix if (and only if) the class inherits from unittest.TestCase. If we change pytest.ini then PyTest finds all classes with the Tester suffix.

(For reproducibility's sake, I'll note that I'm using PyTest 7.4.3.)

from pygsti.

rileyjmurray avatar rileyjmurray commented on August 31, 2024

GitHub actions tests are using older version of an optional dependency called "qibo" (v 0.1.7). See here for the qibo version in the passing the test logs. Using qibo 0.2.1 causes tests to fail at this commit without any changes to pytest.ini.

Looks like I would have gotten the older (correct / safe) version of qibo if I installed pyGSTi with pip install -e .['testing']. Unfortunately for me, I installed pyGSTi as follows:

pip install -r requirements.txt
pip install -r optional-requirements.txt
pip install -e .

The difference is that optional_requirements.txt doesn't enforce a version bound on qibo.

If I had installed with pip install -e .['testing'] then I also would have gotten the csaps optional dependency. Luckily it's easy to modify the failing test in InterpygateConstructionTester to gracefully handle when csaps is not installed. Note: csaps is not listed in optional-requirements.txt.

from pygsti.

rileyjmurray avatar rileyjmurray commented on August 31, 2024

We might want to add a version check for qibo at runtime. We need to do a similar thing in CVXPY when we have to check if a third-party numerical solver has some feature. I'm not sure where we'd place the check for qibo, though.

Edit: opened #363 to document that desire.

from pygsti.

sserita avatar sserita commented on August 31, 2024

Closed with release of 0.9.12.

from pygsti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.