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

Improve NDDataArray (use composition, not inheritance) #832

Merged
merged 6 commits into from Jan 9, 2017

Conversation

Projects
None yet
2 participants
@joleroi
Contributor

joleroi commented Jan 6, 2017

This PR:

  • Rewrites NDDataArray as standalone class (instead of an abstract base class)
  • Adds a tutorial notebook, for the NDDataArray class
  • Rewrites all former NDDataArray subclasses to now have an NDDataArray as attributed (composition over inheritance)
  • Updates the documentation of the relevant classes
  • Reexposes the Dataarray axes as properties everywhere

This PR does NOT:

  • Reexpose the data numpy array, thus all calls like aeff2d.data.value now look like aeff2d.data.data.value
  • Reexpose the evaluate method aeff2d.evaluate -> aeff2d.data.evaluate

@joleroi joleroi added the cleanup label Jan 6, 2017

@joleroi joleroi added this to the 0.6 milestone Jan 6, 2017

@joleroi joleroi changed the title from Remove NDData subclassing to Remove NDDataArray subclassing Jan 6, 2017

@joleroi

This comment has been minimized.

Show comment
Hide comment
@joleroi

joleroi Jan 6, 2017

Contributor

@jjlk This affects the CTA classes you have added to gammapy/scripts

Contributor

joleroi commented Jan 6, 2017

@jjlk This affects the CTA classes you have added to gammapy/scripts

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jan 6, 2017

Member

@joleroi - Thanks!

I'll merge #831 now, so you might have to rebase this PR.
There's one fail on travis-ci: https://travis-ci.org/gammapy/gammapy/jobs/189549935#L1834

Let me know if / when you want a review on this.

Member

cdeil commented Jan 6, 2017

@joleroi - Thanks!

I'll merge #831 now, so you might have to rebase this PR.
There's one fail on travis-ci: https://travis-ci.org/gammapy/gammapy/jobs/189549935#L1834

Let me know if / when you want a review on this.

@joleroi

This comment has been minimized.

Show comment
Hide comment
@joleroi

joleroi Jan 9, 2017

Contributor

If you want to give feedback you can have a look at
https://github.com/gammapy/gammapy-extra/blob/master/notebooks/nddata_demo.ipynb
(feel free to edit directly)

Contributor

joleroi commented Jan 9, 2017

If you want to give feedback you can have a look at
https://github.com/gammapy/gammapy-extra/blob/master/notebooks/nddata_demo.ipynb
(feel free to edit directly)

@joleroi joleroi merged commit 5aad1fd into gammapy:master Jan 9, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@joleroi joleroi deleted the joleroi:nddata branch Jan 9, 2017

@cdeil cdeil changed the title from Remove NDDataArray subclassing to Improve NDDataArray (use composition, not inheritance) Jan 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment