Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SpectrumObservation and SpectrumObservationList classes #2153

Merged
merged 5 commits into from May 23, 2019

Conversation

2 participants
@registerrier
Copy link
Contributor

commented May 22, 2019

This PR removes the SpectrumObservation and SpectrumObservationList which are no longer needed after the modifications from PR #2139.

The SpectrumStats class definition has been moved to data/obs_stats.py where ObservationStats is implemented.
Tests have been added.

@registerrier registerrier requested a review from adonath May 22, 2019

@registerrier registerrier self-assigned this May 22, 2019

@registerrier registerrier added this to To do in Spectrum analysis (1D) via automation May 22, 2019

@registerrier registerrier added this to the 0.12 milestone May 22, 2019

@adonath
Copy link
Member

left a comment

Thanks @registerrier! This looks good to me. My only question is whether it's worth to keep the .to_sherpa() method?

# TODO: optimize layout
plt.subplots_adjust(wspace=0.3)

def to_sherpa(self):

This comment has been minimized.

Copy link
@adonath

adonath May 23, 2019

Member

Shall we keep this as SpectrumDatasetOnOff.to_sherpa()? Or just replace it with a docs example maybe?

This comment has been minimized.

Copy link
@registerrier

registerrier May 23, 2019

Author Contributor

The conversion to sherpa is still possible through the export to OGIP files. This is the approach suggested in the notebook spectrum_fitting_with_sherpa.ipynb.

livetime=self.livetime,
)

def stats_table(self):

This comment has been minimized.

Copy link
@adonath

adonath May 23, 2019

Member

Just a side comment: I think this is basically the way we should do these stats info methods on the datasets. I.e. return either astropy.Table or dict objects. I'll keep it in mind...

@registerrier

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2019

The to_sherpa() method is not really needed anymore, and we can still export to OGIP to later load and perform the fit with sherpa. So we do not export it.

@registerrier registerrier merged commit d832d19 into gammapy:master May 23, 2019

9 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Scrutinizer Analysis: 7 updated code elements – Tests: passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
gammapy.gammapy Build #20190522.10 succeeded
Details
gammapy.gammapy (DevDocs) DevDocs succeeded
Details
gammapy.gammapy (Lint) Lint succeeded
Details
gammapy.gammapy (Test Python35) Test Python35 succeeded
Details
gammapy.gammapy (Test Windows35) Test Windows35 succeeded
Details
gammapy.gammapy (Test Windows37) Test Windows37 succeeded
Details

Spectrum analysis (1D) automation moved this from To do to Done May 23, 2019

@adonath adonath changed the title Remove spectrum observation Remove SpectrumObservation and SpectrumObservationList classes May 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.