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 image pipe class #524

Merged
merged 20 commits into from May 3, 2016

Conversation

Projects
None yet
3 participants
@JouvinLea
Contributor

JouvinLea commented May 2, 2016

@cdeil @adonath
Hi,
I made some changes. We have now two classes: one for one observation ObsImage and one for a set of Observation MosaicImage.

We discussed with regis and this is less time computing... It is also much more clear to have these two separate classes!

@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

@adonath All the test passed so if you agree with what I changed we can merge!!
It's really the same ideas and algorithm than the image analysis class but just separated in two classes!

Contributor

JouvinLea commented May 3, 2016

@adonath All the test passed so if you agree with what I changed we can merge!!
It's really the same ideas and algorithm than the image analysis class but just separated in two classes!

@adonath adonath self-assigned this May 3, 2016

Show outdated Hide outdated gammapy/scripts/image_pipe.py Outdated
Show outdated Hide outdated gammapy/scripts/image_pipe.py Outdated
@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

@JouvinLea It's definitely an improvement to re-factor the code into two classes. I've left two minor comments for this PR. Let me know if you still can include these and than we can merge later today...

Member

adonath commented May 3, 2016

@JouvinLea It's definitely an improvement to re-factor the code into two classes. I've left two minor comments for this PR. Let me know if you still can include these and than we can merge later today...

Lea Jouvin added some commits May 3, 2016

@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

@adonath
Thanks for your suggestions!! I tool all of them into account !!

Contributor

JouvinLea commented May 3, 2016

@adonath
Thanks for your suggestions!! I tool all of them into account !!

@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

Some of the tests still fail on Travis-CI:

E       AssertionError: 
E       Items are not equal:
E        ACTUAL: 1987.2088283447931
E        DESIRED: 1987.2088283446637

But these are only numerical differences, changing to assert_almost_equal() should fix this. If necessary you can adjust the precision of the test with the argument decimal=... (see here).

EDIT: Or maybe change to assert_allclose() see here, which is recommended by numpy.

Member

adonath commented May 3, 2016

Some of the tests still fail on Travis-CI:

E       AssertionError: 
E       Items are not equal:
E        ACTUAL: 1987.2088283447931
E        DESIRED: 1987.2088283446637

But these are only numerical differences, changing to assert_almost_equal() should fix this. If necessary you can adjust the precision of the test with the argument decimal=... (see here).

EDIT: Or maybe change to assert_allclose() see here, which is recommended by numpy.

@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

ok this is weird because it passes for me locally
Le 3 mai 2016 à 12:05, adonath notifications@github.com a écrit :

Some of the tests still fail on Travis-CI:

E AssertionError:
E Items are not equal:
E ACTUAL: 1987.2088283447931
E DESIRED: 1987.2088283446637
But these are only numerical differences, changing to assert_almost_equal() should fix this. If necessary you can adjust the precision of the test with the argument decimal=... (see here).


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Contributor

JouvinLea commented May 3, 2016

ok this is weird because it passes for me locally
Le 3 mai 2016 à 12:05, adonath notifications@github.com a écrit :

Some of the tests still fail on Travis-CI:

E AssertionError:
E Items are not equal:
E ACTUAL: 1987.2088283447931
E DESIRED: 1987.2088283446637
But these are only numerical differences, changing to assert_almost_equal() should fix this. If necessary you can adjust the precision of the test with the argument decimal=... (see here).


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Lea Jouvin
@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

I think these are just numerical differences, that can occur on different machines. So changing to assert_allclose() or assert_almost_equal() is perfectly fine.

Member

adonath commented May 3, 2016

I think these are just numerical differences, that can occur on different machines. So changing to assert_allclose() or assert_almost_equal() is perfectly fine.

@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

@adonath
This is still failing on travis for the counts now bu me I have 2334 counts locally so I cant' change this test... I don't understand why this is 2333 on travis...

Contributor

JouvinLea commented May 3, 2016

@adonath
This is still failing on travis for the counts now bu me I have 2334 counts locally so I cant' change this test... I don't understand why this is 2333 on travis...

@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

@JouvinLea I just checked out your branch and the test fails on my machine locally as well (yielding 2333 instead of 2334). All the other asserts fail as well. Could you check the numbers you computed and used for the test again? Maybe you have any local un-commited changes...

Otherwise I'd be fine with commenting the asserts out for now and add a comment, that this fails on some machines, for unknown reasons....

Member

adonath commented May 3, 2016

@JouvinLea I just checked out your branch and the test fails on my machine locally as well (yielding 2333 instead of 2334). All the other asserts fail as well. Could you check the numbers you computed and used for the test again? Maybe you have any local un-commited changes...

Otherwise I'd be fine with commenting the asserts out for now and add a comment, that this fails on some machines, for unknown reasons....

@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

@adonath
I tested again, on my machine it failes if I put 2333... This is really weird now? Maybe it comes from the GAMPPY_EXTRA variable? I fetched the latest version of gammapy-extra on my machine...
So we comment the lines for now with a TODO?

Contributor

JouvinLea commented May 3, 2016

@adonath
I tested again, on my machine it failes if I put 2333... This is really weird now? Maybe it comes from the GAMPPY_EXTRA variable? I fetched the latest version of gammapy-extra on my machine...
So we comment the lines for now with a TODO?

@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

@JouvinLea That's indeed weird. So just comment it out and leave a TODO.

Member

adonath commented May 3, 2016

@JouvinLea That's indeed weird. So just comment it out and leave a TODO.

Lea Jouvin
@JouvinLea

This comment has been minimized.

Show comment
Hide comment
@JouvinLea

JouvinLea May 3, 2016

Contributor

@adonath all the test passed, we can merge?

Contributor

JouvinLea commented May 3, 2016

@adonath all the test passed, we can merge?

@adonath adonath merged commit 2ee2447 into gammapy:master May 3, 2016

2 checks passed

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

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath May 3, 2016

Member

Merged, thanks!

Member

adonath commented May 3, 2016

Merged, thanks!

@cdeil cdeil added this to the 0.5 milestone May 3, 2016

@cdeil cdeil changed the title from Image pipe: Reorganisation of the class to Improve image pipe class May 19, 2016

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