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

HEKClient search method now returns table instead of list of dict #2759

Merged
merged 4 commits into from Nov 16, 2018

Conversation

Projects
None yet
6 participants
@souravghosh97
Copy link
Contributor

commented Sep 21, 2018

HEKClient.search() method returns table instead of list of dict
Closes #2740

@sunpy-bot

This comment has been minimized.

Copy link

commented Sep 21, 2018

Thanks for the pull request @souravghosh97! Everything looks great!

@pep8speaks

This comment has been minimized.

Copy link

commented Sep 21, 2018

Hello @souravghosh97! Thanks for updating the PR.

@souravghosh97 souravghosh97 force-pushed the souravghosh97:HEKObject branch from 3cdb5e8 to 6e8d7f0 Sep 23, 2018

@nabobalis nabobalis added this to the 1.0 milestone Oct 2, 2018

@nabobalis nabobalis added the net label Oct 2, 2018

@nabobalis

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2018

Thanks @souravghosh97, do you have an example of what the output looks like now?

@souravghosh97

This comment has been minimized.

Copy link
Contributor Author

commented Oct 2, 2018

>>> from sunpy.net import hek
>>> client = hek.HEKClient()  
>>> tstart = '2011/08/09 07:23:56'
>>> tend = '2011/08/09 12:40:29'
>>> event_type = 'FL'
>>> result = client.search(hek.attrs.Time(tstart,tend),hek.attrs.EventType(event_type))
>>> result
<HEKTable length=19>
         SOL_standard          active ar_compactnesscls ar_mcintoshcls ar_mtwilsoncls ar_noaaclass ar_noaanum ... skel_chaincode skel_curvature skel_nsteps skel_startc1 skel_startc2  sum_overlap_scores 
            str30               str4         str1            str1           str1          str1       object   ...      str1          object        object      object       object           str20        
------------------------------ ------ ----------------- -------------- -------------- ------------ ---------- ... -------------- -------------- ----------- ------------ ------------ --------------------
SOL2011-08-08T01:30:04L247C075   true                                                                    None ...                          None        None         None         None   12.588887041198964
SOL2011-08-08T01:30:04L247C075   true                                                                    None ...                          None        None         None         None   12.588887041198964
SOL2011-08-08T01:30:04L247C075   true                                                                    None ...                          None        None         None         None   12.588887041198964
SOL2011-08-09T01:40:04L230C084   true                                                                    None ...                          None        None         None         None  37.4574863857972034
SOL2011-08-09T02:30:04L319C077   true                                                                    None ...                          None        None         None         None  13.6403551847007094
SOL2011-08-09T02:30:04L319C077   true                                                                    None ...                          None        None         None         None  13.6403551847007094
SOL2011-08-09T02:30:04L319C077   true                                                                    None ...                          None        None         None         None  13.6403551847007094
SOL2011-08-09T07:19:00L296C075   true                                                                       0 ...                          None        None         None         None                    1
SOL2011-08-09T07:19:00L227C090   true                                                                   11263 ...                          None        None         None         None                    0
SOL2011-08-09T07:22:38L305C073   true                                                                    None ...                          None        None         None         None 0.283032539594587795
SOL2011-08-09T07:22:44L305C073   true                                                                    None ...                          None        None         None         None                    1
SOL2011-08-09T07:48:00L296C076   true                                                                       0 ...                          None        None         None         None                    0
SOL2011-08-09T07:48:00L296C073   true                                                                   11263 ...                          None        None         None         None                    0
SOL2011-08-09T07:55:59L305C073   true                                                                    None ...                          None        None         None         None                    0
SOL2011-08-09T07:59:49L300C077   true                                                                    None ...                          None        None         None         None                    0
SOL2011-08-09T08:00:03L305C073   true                                                                    None ...                          None        None         None         None                    0
SOL2011-08-09T08:00:20L305C073   true                                                                    None ...                          None        None         None         None                    0
SOL2011-08-09T08:00:53L305C073   true                                                                    None ...                          None        None         None         None                    0
SOL2011-08-09T08:01:21L300C077   true                                                                    None ...                          None        None         None         None                    0
>>> result[0]['event_peaktime']
'2011-08-09T11:55:00'
>>> result['event_peaktime']
<HEKColumn name='event_peaktime' dtype='str19' length=19>
2011-08-09T11:55:00
2011-08-09T11:55:00
2011-08-09T11:55:00
2011-08-09T08:07:00
2011-08-09T08:07:00
2011-08-09T08:07:00
2011-08-09T08:07:00
2011-08-09T07:23:00
2011-08-09T07:23:00
2011-08-09T08:07:38
2011-08-09T07:23:08
2011-08-09T08:05:00
2011-08-09T08:05:00
2011-08-09T08:06:23
2011-08-09T08:07:37
2011-08-09T08:06:51
2011-08-09T08:05:08
2011-08-09T08:07:05
2011-08-09T08:05:57

This is the output.

@dpshelio
Copy link
Member

left a comment

Looks good to me

Show resolved Hide resolved sunpy/net/hek/hek.py Outdated
@Cadair

Cadair approved these changes Nov 14, 2018

@Cadair

Cadair approved these changes Nov 14, 2018

@souravghosh97

This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2018

I think the test should pass.

@nabobalis nabobalis force-pushed the souravghosh97:HEKObject branch from 42c0f67 to c905875 Nov 15, 2018

@nabobalis nabobalis merged commit c545321 into sunpy:master Nov 16, 2018

9 of 10 checks passed

codecov/patch 40% of diff hit (target 43.73%)
Details
ci/circleci: egg-info-36 Your tests passed on CircleCI!
Details
ci/circleci: egg-info-37 Your tests passed on CircleCI!
Details
ci/circleci: figure-tests-36 Your tests passed on CircleCI!
Details
ci/circleci: html-docs Your tests passed on CircleCI!
Details
codecov/project 43.73% (-0.01%) compared to 34918ed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
giles Click details to preview the documentation build
Details
sunpy-bot All checks passed
@nabobalis

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2018

@irahulcse

This comment has been minimized.

Copy link

commented Mar 7, 2019

@nabobalis @dpshelio I would like to work on the issue #2759

@nabobalis

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2019

Hi @irahulcse, I am not aware that there is anything else to do regarding this.

I would suggest having a look at another open issue: https://github.com/sunpy/sunpy/issues

@souravghosh97 souravghosh97 deleted the souravghosh97:HEKObject branch Mar 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.