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

Addressed the Issue #848 - Download data and add entries to database from a HEK query #3061

Closed
wants to merge 10 commits into from

Conversation

Ayoob7
Copy link

@Ayoob7 Ayoob7 commented Apr 19, 2019

Addressed the Issue #848 - Download data and add entries to database from a HEK query

Description

Fixes #848

@pep8speaks
Copy link

pep8speaks commented Apr 19, 2019

Hello @Ayoob7! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 443:1: E302 expected 2 blank lines, found 1

Comment last updated at 2019-05-10 09:17:19 UTC

@ghost
Copy link

ghost commented Apr 19, 2019

Thanks for the pull request @Ayoob7!

I am a bot that checks pull requests for milestones and changelog entries. If you have any questions about what I am saying, please ask!
I have the following to report on this pull request:

  • I didn't detect a changelog file in this pull request. Please add a changelog file to the changelog/ directory following the instructions in the changelog README.

If there are any issues with this message, please report them here.

@nabobalis nabobalis added this to the 1.0 milestone Apr 19, 2019
@nabobalis nabobalis added the database Affects the database submodule label Apr 19, 2019
@nabobalis
Copy link
Contributor

Hi @Ayoob7, thanks for the pull request! Could you write a test for this new code? It would go in database/tests/test_database.py.

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 19, 2019 via email

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 20, 2019

Hi @nabobalis ,

I cant seem to install [parfive] module in my venv to run the test_database.py, when I try to install parfive in my venv, I get the following:

Exception:
Traceback (most recent call last):
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/commands/install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/req/__init__.py", line 57, in install_given_reqs
    **kwargs
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/req/req_install.py", line 913, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/req/req_install.py", line 445, in move_wheel_files
    warn_script_location=warn_script_location,
  File "/home/ayoobm/Desktop/SoCIS/sunpy/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_internal/wheel.py", line 428, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: parfive .dist-info directory not found

I would be grateful for any Input on the problem thanks :)

@nabobalis
Copy link
Contributor

How are you installing parfive?

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 20, 2019 via email

@nabobalis
Copy link
Contributor

That's odd. I'm not aware there is an issue with installing parfive, at lest our CI seems to be ok. I've not seen that error before, I guess there might be something off with your virtual environment but I don't know what.

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 20, 2019

Sorted, I can run the tests, I'll be adding my tests shortly. 👍 :)

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 20, 2019

Added the test cases.

@Ayoob7
Copy link
Author

Ayoob7 commented Apr 21, 2019

Hey @nabobalis , made the changes as we discussed above, (removed the undo and redo methods for the database in the tests), would you be able to review my PR.
Thanks in advance.

@nabobalis
Copy link
Contributor

nabobalis commented Apr 21, 2019

The test fails:

  @pytest.mark.remote_data
  def test_download_from_hek_query_result(database, hek_qr, tmpdir):
E       fixture 'hek_qr' not found

I assume the fixture was not committed to the file?

query_result : sunpy.net.vso.QueryResponse
A VSO query response that was returned by the ``query`` method of a
:class:`sunpy.net.vso.VSOClient` object.
path , progress
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for the late reply, I'll go through, we had an internet outage and slowdown in Sri Lanka, these are parameters for the method "download_from_vso_query_result".

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine, there is no rush.

If that is the case, we need to expand on these items (adding type and a description) like we have for query_result.

Co-Authored-By: Ayoob7 <mohamedayoob01@gmail.com>
nabobalis and others added 3 commits May 1, 2019 20:49
Co-Authored-By: Ayoob7 <mohamedayoob01@gmail.com>
Co-Authored-By: Ayoob7 <mohamedayoob01@gmail.com>
Co-Authored-By: Ayoob7 <mohamedayoob01@gmail.com>
sunpy/database/tests/test_database.py Outdated Show resolved Hide resolved
"""
translated_query = itertools.chain.from_iterable(
H2VClient().translate_and_query(query_result))
self.download_from_vso_query_result(translated_query,path=path,progress=progress)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.download_from_vso_query_result(translated_query,path=path,progress=progress)
self.download_from_vso_query_result(translated_query, path=path, progress=progress)

sunpy/database/database.py Outdated Show resolved Hide resolved
@Ayoob7
Copy link
Author

Ayoob7 commented May 15, 2019

Hi @dpshelio , made the changes for code consistency and pushed them. Would you be able to review and ratify this PR ? Thanks a bunch :)

@Cadair Cadair modified the milestones: 1.0, 1.1 May 22, 2019
@Ayoob7
Copy link
Author

Ayoob7 commented May 23, 2019 via email

@stale
Copy link

stale bot commented Oct 20, 2019

This pull request has been automatically marked as stale because it has not had any activity for the past five months. It will be closed if no further activity occurs. If the ideas in this pull request are still worth implementing, please make sure you open an issue to keep track of that idea!

@stale stale bot added the Stale The bot will close this PR after 6 months label Oct 20, 2019
@Cadair Cadair modified the milestones: 1.1, 2.0 Oct 24, 2019
@stale
Copy link

stale bot commented Nov 23, 2019

This pull request has been automatically closed since there was no activity for a month since it was marked as stale. If the ideas in this pull request are still worth implementing, please make sure you open an issue to keep track of that idea!

@stale stale bot closed this Nov 23, 2019
@nabobalis nabobalis added the Needs Adoption PRs that were abandoned but should be picked up again and merged in label Nov 23, 2019
@nabobalis nabobalis removed this from the 2.0 milestone Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Affects the database submodule Needs Adoption PRs that were abandoned but should be picked up again and merged in Stale The bot will close this PR after 6 months
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download data and add entries to database from a HEK query
5 participants