Giter Club home page Giter Club logo

Comments (2)

Richert avatar Richert commented on June 3, 2024

Hi @GanshengT ,

Thank you for your interest in working with PyRates.
From your example, I think the issue is connected to multiple executions of your jupyter notebook cells.
When calling CircuitTemplate.run, PyRates uses a caching system to reduce the number of templates that have to be loaded separately. These templates, however, are altered along the process of translating a given model into the backend. Thus, the cache has to be cleared first, before you can call CircuitTemplate.run again.

I think the following adjustments just allow to execute a cell with your code multiple times:

from pyrates import CircuitTemplate, clear_frontend_caches

jrc = CircuitTemplate.from_yaml("model_templates.neural_mass_models.jansenrit.JRC")
results = jrc.run(simulation_time=1.0,
                          step_size=1e-2,
                          sampling_step_size=1e-2,
                          outputs={'V_pce': 'pc/rpo_e_in/V',
                          'V_pci': 'pc/rpo_i/V'},
                          backend='default',
                          solver='scipy')

Notice, that I have also changed the name of the output variables from Z to V, to account for a recent modification I made to the model templates. Should you not use the most recent version of PyRates, feel free to go back to your original variable names. For me, the code above worked with the most recent PyRates version, using Python 3.8 and jupyter notebook on Ubuntu 20.04.

Hope that solves your problem!

from pyrates.

GanshengT avatar GanshengT commented on June 3, 2024

Thank you for the prompt response! It did solve the problem!

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.