Giter Club home page Giter Club logo

Comments (4)

jcfr avatar jcfr commented on June 3, 2024

Reloading of the module may be directly done in qSlicerScriptedLoadableModuleWidget by using PyImport_ReloadModule()12

Footnotes

  1. https://docs.python.org/3/c-api/import.html#c.PyImport_ReloadModule

  2. https://stackoverflow.com/questions/26543648/refreshing-a-import-in-c-embedded-python

from slicer.

lassoan avatar lassoan commented on June 3, 2024

Bite that when the module has an internal Python package in a subfolder (...Lib) then we modify the reload function to reload that package, too. If there are closely related modules then we also reload those. Order of reload seems to matter, too (if we reload in incorrect order the we need to reload multiple times). It would be nice if these would work with the new reload solution.

from slicer.

pieper avatar pieper commented on June 3, 2024

+1 for a more robust and comprehensive reload procedure.

from slicer.

jcfr avatar jcfr commented on June 3, 2024

I introduced the qSlicerScriptedLoadableModuleWidget::reload1 function through #7351 anticipating we would indeed improve the approach.

For now, it addresses the original issue. Once the release is done, I will look into a more robust approach.

Footnotes

  1. https://github.com/Slicer/Slicer/blob/57087f3c568e4b7ad17ff1745e8880fa06c3ebb8/Base/QTGUI/qSlicerScriptedLoadableModuleWidget.cxx#L180-L189

from slicer.

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.