Remove all kinds of warning in brian2?

Description of problem

I have a running brian2 code which does work as I want it to be. However, even when I switch off the run report like this

run(tend*second)

I get some responses like this:

WARNING    The name "nsiemens" refers to different objects in different namespaces used for resolving names in the context of group "neurongroup". Will use the object from the units namespace with the value nsiemens, but the name also refers to a variable in the run namespace with value '1. * nsiemens'. [brian2.groups.group.Group.resolve.resolution_conflict]
WARNING    The name "mV" refers to different objects in different namespaces used for resolving names in the context of group "neurongroup". Will use the object from the units namespace with the value mvolt, but the name also refers to a variable in the run namespace with value '1. * mvolt'. [brian2.groups.group.Group.resolve.resolution_conflict]
WARNING    The name "mV" refers to different objects in different namespaces used for resolving names in the context of group "synapses". Will use the object from the units namespace with the value mvolt, but the name also refers to a variable in the run namespace with value '1. * mvolt'. [brian2.groups.group.Group.resolve.resolution_conflict]

Is there a way to switch this off / clear it periodically as well ?

Minimal code to reproduce problem

What you have already tried

Nothing as off yet

Expected output (if relevant)

Actual output (if relevant)

Full traceback of error (if relevant)

Hi @Jeevan_codes8580. You can switch off all warnings by using BrianLogger.log_level_error() (the default log level is WARNING, which means warning + error messages, and this command sets it to ERROR, which means only error messages). Another option is to switch off only resolution_conflict warnings, see the example in the documentation.

But I am actually a bit surprised by your warning messages. Could it be that you are using a very old numpy version?

1 Like

Yes I just checked. I am using numpy 1.26 which is not quite updated :smiling_face_with_tear:. I shall upgrade it to the newest.

Hi @Jeevan_codes8580. Numpy 1.26 is not very recent, but we still support it (we are following this policy: NEP 29 — Recommend Python and NumPy version support as a community policy standard — NumPy Enhancement Proposals). I will try to reproduce the warning later today, maybe there is something to do from our side.

1 Like