Skip to content

Updated tests for resampling Generic Map and some documentation in the Sunpy/data/test. #2011

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

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Copy link
Member

Choose a reason for hiding this comment

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

This file should not be here at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, its a file in the sunpy.github.io in the website making repository.
You can close this PR.
2 or 3 PRs has been collectively addressed here
I will send separate PRs for the other related issues :)

20 changes: 11 additions & 9 deletions sunpy/cm/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

hinodexrt = ct.xrt_color_table()
hinodesotintensity = ct.sot_color_table('intensity')
#hinodesotstokesquv = ct.sot_color_table('stokesQUV')
#hinodesotmagneticf = ct.sot_color_table('magnetic field')
#hinodesotvelocity = ct.sot_color_table('velocity')
#hinodesotwidth = ct.sot_color_table('width')
# hinodesotstokesquv = ct.sot_color_table('stokesQUV')
# hinodesotmagneticf = ct.sot_color_table('magnetic field')
# hinodesotvelocity = ct.sot_color_table('velocity')
# hinodesotwidth = ct.sot_color_table('width')

trace171 = ct.trace_color_table('171')
trace195 = ct.trace_color_table('195')
Expand Down Expand Up @@ -83,10 +83,10 @@
'yohkohsxtwh': yohkohsxtwh,
'hinodexrt': hinodexrt,
'hinodesotintensity': hinodesotintensity,
#'hinodesotstokesquv': hinodesotstokesquv,
#'hinodesotmagneticf': hinodesotmagneticf,
#'hinodesotvelocity': hinodesotvelocity,
#'hinodesotwidth': hinodesotwidth,
# 'hinodesotstokesquv': hinodesotstokesquv,
# 'hinodesotmagneticf': hinodesotmagneticf,
# 'hinodesotvelocity': hinodesotvelocity,
# 'hinodesotwidth': hinodesotwidth,
'trace171': trace171,
'trace195': trace195,
'trace284': trace284,
Expand Down Expand Up @@ -169,7 +169,7 @@ def show_colormaps(filter=None):
"""

if filter:
maps = sorted({k:v for (k,v) in cmlist.items() if k.lower().count(filter.lower())})
maps = sorted({k: v for (k, v) in cmlist.items() if k.lower().count(filter.lower())})
if len(maps) == 0:
raise KeyError('No color maps found for key - ' + filter)
else:
Expand All @@ -180,7 +180,9 @@ def show_colormaps(filter=None):
a = np.linspace(0, 1, 256).reshape(1, -1) # pylint: disable=E1103
a = np.vstack((a, a))


fig = plt.figure(figsize=(5, 10),dpi=64)

fig.subplots_adjust(top=0.99, bottom=0.01, left=0.2, right=0.99)
for i, name in enumerate(maps):
ax = plt.subplot(nmaps, 1, i + 1)
Expand Down
8 changes: 8 additions & 0 deletions sunpy/database/tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This module was developed with funding provided by
# the Google Summer of Code (2013).


""" Using tests from Sunpy.data.test """
from __future__ import absolute_import

import glob
Expand All @@ -26,12 +28,18 @@
from sunpy.database import attrs
from sunpy.net import vso, hek
from sunpy.data.test.waveunit import waveunitdir
# importing the waveunitdir from sunpy/data/test/waveunit

from sunpy.io import fits
from sunpy.extern.six.moves import range
from sunpy.extern.six.moves import configparser

import sunpy.data.test

"""
Using Sunpy.data.test

"""
testpath = sunpy.data.test.rootdir
RHESSI_IMAGE = os.path.join(testpath, 'hsi_image_20101016_191218.fits')

Expand Down
8 changes: 8 additions & 0 deletions sunpy/net/vso/vso.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,21 @@ def download(self, method, url, dw, callback, errback, *args):

@staticmethod
def by_provider(response):
"""
Copy link
Member

Choose a reason for hiding this comment

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

You just opened another PR with this change in, it should only be in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I have sent a seperate PR for this. This PR is all jumbled up with other PRs, due to some patch mismatch. You can close this PR.

Returns a dictionary of provider corresponding
to records in the response.
"""
map_ = defaultdict(list)
for record in response:
map_[record.provider].append(record)
return map_

@staticmethod
def by_fileid(response):
"""
Returns a dictionary of fileids corresponding
to records in the response.
"""
return dict(
(record.fileid, record) for record in response
)
Expand Down