Comments (3)
Hello @pguenth,
thanks for reporting this!
I think this is the only point where I use the logging
Line 1 in 7afc1f8
i.e. to notify the user if
sherpa
and Gammapy
are not installed.
Can it be that by re-importing logging
here it is setting the logging back to the default level (that should be WARNING or ERROR, right)?
Perhaps adding a
logger = logging.getLogger(__name__)
and then using logger.info("...")
in fit/__init__.py
will fix the issue (I think it will import the logger already defined).
from agnpy.
As far as I understand the logging library, this should not make a difference. Just using logging.info()
and similar calls (instead of using a particular logger) should just default to some default logger. I will try to think of a test to find out.
from agnpy.
Okay the behavior of the logging module is apparently even more unexpected (at least to me):
The functions debug(), info(), warning(), error() and critical() will call basicConfig() automatically if no handlers are defined for the root logger.
(https://docs.python.org/3/library/logging.html#logging.basicConfig)
So the problem is most likely that agnpy's call to logging.warning()
in the file you mentioned implicitely calls logging.basicConfig()
with some defaults, which prevents further code (that imports agnpy) to configure the root logger.
The solution you proposed seems to be the best in my opinion (although for a slightly different reason) and is also what the documentation recommends.
from agnpy.
Related Issues (20)
- bug when simulation of gammapy datasets with an agnpy spectrum model HOT 9
- Absorption calculation stability HOT 1
- Add sherpa and gammapy among the dependencies (add them to install_requires in setup.py) HOT 4
- Add a CITATION.cff file?
- TypeError: __init__() got an unexpected keyword argument 'is_norm' HOT 3
- Bullet points of lists disappear on Read the Docs HOT 1
- Error in the EBL absorption HOT 1
- Error in InterpolatedDistribution HOT 11
- Discrepancy between AGNpy and LeHa code in proton synchrotron
- Add the synchrotron proton to the models available for fitting
- Issue with fitting MWL SED using agnpy HOT 7
- Return the different SED components after a fit HOT 2
- Problem about load_absorption_table in class EBL HOT 2
- Problem about load_absorption_table in class EBL
- Move the tests to the subdirectory of each module. HOT 1
- Fitting of a MWL BL Lac SED: Fit doesn't converge. HOT 1
- d_L parameter in blob definition spoiling older code and examples
- Tests related to Gammapy fit are failing
- Error on synchrotron from interplated distribution
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 agnpy.