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

Improve NDDataArray (use composition, not inheritance) #832

Merged
merged 6 commits into from Jan 9, 2017

Conversation

@joleroi
Copy link
Contributor

@joleroi 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 Remove NDData subclassing Remove NDDataArray subclassing Jan 6, 2017
@joleroi joleroi force-pushed the joleroi:nddata branch from c570a29 to 3ce7c67 Jan 6, 2017
@joleroi
Copy link
Contributor Author

@joleroi joleroi commented Jan 6, 2017

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

@cdeil
Copy link
Member

@cdeil 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 joleroi force-pushed the joleroi:nddata branch from 3ce7c67 to 65e2c6d Jan 9, 2017
@joleroi
Copy link
Contributor Author

@joleroi 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
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 Remove NDDataArray subclassing 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
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants