Comments (4)
Do I understand you correctly that it blocks exceptions in non-Brian programs? How does the except hook get registered if Brian isn't imported?
Whatever the issue is, I think we should have a preference to switch off the except hook.
from brian2.
Something like this:
import brian2
raise ValueError
print "This doesn't happen"
Will just silently terminate.
I guess it's a bug in how our excepthook works on Py 2.6?
from brian2.
It turned out this wasn't a problem with the excepthook but a more general issue with logging: Under Python 2.7+ it's ok to use something like setLevel('DEBUG')
(which we use when setting the log levels from the preference file), but in Python 2.6, while not raising an error this leads to comparisons like 10 >= 'DEBUG'
later on which then results in no messages being logged :-/
I added a translation from string to number to make this work again. I added a dictionary with the translation, even though such a translation already exists in the logging module: logging.getLevelName('DEBUG')
will return 10 -- but the name and the documentation only mention the other direction (logging.getLevelName(10) == 'DEBUG'
) so I did not want to rely on this.
And this shows a limit of our test suite by the way: We are currently testing the logging system by capturing messages with a special handler -- unfortunately this does not capture problems in the configuration of a handler, as the one in this issue...
from brian2.
Nice fix! I don't think we should worry about the test suite - you can never make it perfect I guess.
from brian2.
Related Issues (20)
- "python setup.py install" error HOT 1
- Dynamic delays during a run HOT 3
- Incompatible with numpy version >= 1.20 due to deprecated aliases HOT 5
- SpatialNeuron (spatialstateupdate) fails with numpy without scipy HOT 7
- Improve parser for model descriptions HOT 1
- Improve the MarkDown exporter
- Use randomised timesteps to avoid artificial synchronisation
- Improve Pyodide support
- [Question] Regarding the spatial neuron equation HOT 2
- GSL incompatibility with latest Cython beta
- Problem with storing Neurongroups in dictionaries HOT 1
- the Izhikevich_2007 example neuron model bug HOT 4
- [readthedocs] Tutorials disappeared HOT 2
- Random number generation on C++ standalone is slow HOT 3
- [beginner question]step through brian2 to understand inner workings of neuronal models HOT 1
- Setting Neuron weights? HOT 2
- Floor division of integer values sometimes incorrect on C++ standalone
- Returned value needs to be retrieved for object to work HOT 7
- A bug in the Synapse.connect documentation HOT 2
- module 'brian2' has no attribute 'units' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brian2.