Created
September 3, 2019 14:19
-
-
Save cdeil/f7058f47fb4417f73f4feb24f5a40616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
___________________________________________________________________________________ test_analysis ___________________________________________________________________________________ | |
config_analysis_data = {'flux': {'fp_binning': {'hi_bnd': 50, 'interp': 'log', 'lo_bnd': 1, 'nbin': 4, ...}}, 'general': {'logging': {'level'...'filters': [{'filter_type': 'ids', 'obs_ids': [23523, 23526], 'value_param': 'Crab', 'variable': 'TARGET_NAME'}]}, ...} | |
@requires_dependency("iminuit") | |
@requires_data() | |
def test_analysis(config_analysis_data): | |
analysis = Analysis(config_analysis_data) | |
analysis.get_observations() | |
analysis.reduce() | |
> analysis.fit() | |
gammapy/scripts/tests/test_analysis.py:152: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
gammapy/scripts/analysis.py:82: in fit | |
self._read_model() | |
gammapy/scripts/analysis.py:215: in _read_model | |
self.model = SpectralModel.from_dict(model_pars) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'gammapy.spectrum.models.SpectralModel'> | |
data = {'parameters': [{'factor': 2.0, 'frozen': False, 'name': 'index', 'unit': '', ...}, {'factor': 1e-12, 'frozen': False,... 'cm-2 s-1 TeV-1', ...}, {'factor': 1.0, 'frozen': True, 'name': 'reference', 'unit': 'TeV', ...}], 'type': 'PowerLaw'} | |
@classmethod | |
def from_dict(cls, data): | |
params = { | |
x["name"].split("@")[0]: x["value"] * u.Unit(x["unit"]) | |
for x in data["parameters"] | |
} | |
> init = cls(**params) | |
E TypeError: __init__() got an unexpected keyword argument 'index' | |
gammapy/utils/fitting/model.py:56: TypeError | |
_________________________________________________________________________________ test_to_from_dict _________________________________________________________________________________ | |
def test_to_from_dict(): | |
spectrum = TEST_MODELS[0] | |
model = spectrum["model"] | |
model_dict = model.to_dict() | |
> new_model = SpectralModel.from_dict(model_dict) | |
gammapy/spectrum/tests/test_models.py:355: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'gammapy.spectrum.models.SpectralModel'> | |
data = {'parameters': [{'factor': 2.3, 'frozen': False, 'max': nan, 'min': nan, ...}, {'factor': 4.0, 'frozen': False, 'max': nan, 'min': nan, ...}, {'factor': 1.0, 'frozen': True, 'max': nan, 'min': nan, ...}], 'type': 'PowerLaw'} | |
@classmethod | |
def from_dict(cls, data): | |
params = { | |
x["name"].split("@")[0]: x["value"] * u.Unit(x["unit"]) | |
for x in data["parameters"] | |
} | |
> init = cls(**params) | |
E TypeError: __init__() got an unexpected keyword argument 'index' | |
gammapy/utils/fitting/model.py:56: TypeError | |
---------- coverage: platform darwin, python 3.7.0-final-0 ----------- | |
Coverage HTML written to dir htmlcov | |
=========================================================== 2 failed, 1426 passed, 2 skipped, 5 xfailed in 199.31 seconds =========================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment