Giter Club home page Giter Club logo

Comments (3)

Richert avatar Richert commented on June 13, 2024

This code was introduced at some point in order to prevent exactly those problems "in other tests". When running different tests with different circuit structures that, however, included the exact same module names, sys.modules would not update the modules between tests. Thus, this code was added to ensure that modules from older versions of the same circuit would be forgotten, so that the new ones could be added to sys.modules. Since every CircuitIR instance comes with just one backend, I did not expect this to cause trouble in "productive code". Also, I never ran into strange bugs. However, it is possible that changes to the code generation structure further down the line made this code unnecessary. Thus, I will see whether removing it causes any other problems. If not, we can get rid of it.

from pyrates.

dafrose avatar dafrose commented on June 13, 2024

Okay, so the problem is that Python registers modules for the backend that may need to be refreshed, correct? In my case, the backend removed all modules that contained "circuit" in their name, thus also removing PyRates' own modules for circuit templates and IR. That again cause a problem somewhere else, when I wanted to verify instances of template classes. Checking for instance itself is not a good practice in Python, so it might also be worth rewriting those checks...

Either, I'll still leave this open until we have decided, whether the current fix is acceptable or not.

from pyrates.

Richert avatar Richert commented on June 13, 2024

So I removed these parts of the code and they did not change anything about running the pytests or other test scripts on my end. I pushed the changes and will close this issue now.

from pyrates.

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.