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

tests for IRISRasterClass #7

Merged
merged 5 commits into from
Mar 9, 2017
Merged

Conversation

abit2
Copy link
Member

@abit2 abit2 commented Mar 9, 2017

@DanRyanIrish
Copy link
Member

Hi @abit2. Thanks for another PR. I'll take a look at this today. Just a quick request. When making PRs, can you give a brief explanation of what the PR does/changes and why? Not just a ping. Just makes it easier and quicker for me to figure out what's going on. Feel free to include a ping as well though ;) Cheers.

hdulist = fits.open(os.path.join(testpath, 'iris_l2_20170222_153635_3690215148_raster_t000_r00000.fits'))
for key, value in six.iteritems(wcs_l):
for key_, value_ in wcs_l[key].iteritems():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation here.

data3[hdulist[3].data == -200.] = np.nan

spectral_windows = iris_l2_test_raster.data.keys()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to get the spectral window names from iris_l2_test_raster.spectral_windows.name. This means we aren't locked into iris_l2_test_raster.data being a dict.

return get_pkg_data_filename(filename, package="irispy.data.test", **kwargs)


file_list = glob.glob(os.path.join(rootdir, '*.[!p]*'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this variable defined? Is it used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet but it give the list of all the files in the directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the intention of including it in this PR?

Copy link
Member Author

@abit2 abit2 Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can help in giving the list of files when using the terminal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's a clear reason we want it in, I think we should omit it in this PR. If we find we need it for something later we can always add it in then.

@DanRyanIrish
Copy link
Member

There's a FileNotFoundError when Travis runs the the tests:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/irispy-test-m8jwakk_/lib.linux-x86_64-3.5/irispy/data/test/iris_l2_20170222_153635_3690215148_raster_t000_r00000.fits'
Looks like the filepath is not equalling what you think it is. Perhaps the filepath should be defined in the test_spectrograph.py file in a more direct way?

@abit2
Copy link
Member Author

abit2 commented Mar 9, 2017

@DanRyanIrish it is passing if you run the test with
"py.test irispy/tests/test_spectrograph.py"
but not with "python setup.py test --coverage"

@DanRyanIrish
Copy link
Member

That makes me think the way you've defined the filepath isn't generally applicable.

@abit2
Copy link
Member Author

abit2 commented Mar 9, 2017

@DanRyanIrish
Copy link
Member

Hmmm. We might have to bring @Cadair to explain this then. Or point us to who can explain it.

@DanRyanIrish
Copy link
Member

It all passes! Good work @abit2 👍

@DanRyanIrish DanRyanIrish merged commit 17e5d1b into sunpy:master Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants