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

request list and other adaptions for more efficient experience #110

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

volodymyrss
Copy link
Member

from exploitations

@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #110 (6c02f18) into master (39c68a0) will increase coverage by 18.45%.
The diff coverage is n/a.

❗ Current head 6c02f18 differs from pull request most recent head 9d84cca. Consider uploading reports for the commit 9d84cca to get more accurate results

@@             Coverage Diff             @@
##           master     #110       +/-   ##
===========================================
+ Coverage   49.51%   67.96%   +18.45%     
===========================================
  Files          16       15        -1     
  Lines        2775     1767     -1008     
===========================================
- Hits         1374     1201      -173     
+ Misses       1401      566      -835     
Impacted Files Coverage Δ
tests/test_basic.py 86.48% <0.00%> (-1.75%) ⬇️
tests/test_cli.py 96.61% <0.00%> (ø)
oda_api/plot_tools.py
oda_api/data_products.py 47.88% <0.00%> (+5.17%) ⬆️
oda_api/cli.py 88.23% <0.00%> (+5.99%) ⬆️
tests/conftest.py 85.29% <0.00%> (+7.79%) ⬆️
oda_api/api.py 71.29% <0.00%> (+9.96%) ⬆️
tests/test_data_products.py 100.00% <0.00%> (+65.74%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@volodymyrss volodymyrss linked an issue Jan 10, 2022 that may be closed by this pull request
@volodymyrss volodymyrss requested review from dsavchenko and burnout87 and removed request for dsavchenko September 19, 2022 09:51

def __init__(self, data_list, add_meta_to_name=['src_name', 'product'], instrument=None, product=None):
self._p_list = []
self._n_list = []
Copy link
Member

Choose a reason for hiding this comment

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

duplication


os.makedirs(os.path.dirname(fn), exist_ok=True)

json.dump(response_json, gzip.open(fn, "wt"))
Copy link
Member

Choose a reason for hiding this comment

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

Here and below, isn't it better to use context manager to open?

'ID': ID, 'prod_name': prod_name, 'meta_data:': meta_data
'ID': ID,
'prod_name': prod_name,
'metadata': meta_data,
Copy link
Member

Choose a reason for hiding this comment

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

Why both metadata and meta_data?

@dsavchenko
Copy link
Member

Switchable parameter warnings and DataCollection.as_list .as_dict are nice, other parts aren't clear for me

@volodymyrss
Copy link
Member Author

Switchable parameter warnings and DataCollection.as_list .as_dict are nice, other parts aren't clear for me

it's not really done, I just thought it's good to start bringing it back, finish and then review. It's useful that you looked already.
I will come back to it in couple of days.

@volodymyrss volodymyrss self-assigned this Sep 19, 2022
@@ -36,6 +36,9 @@
pass

import logging
logging.warning('please import oda_api.tools.plot instead of oda_api.plot_tools')

from .tools.plot import *
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, will this module disappear in order to be replaced by the one in oda_api.tools??

Comment on lines +1302 to +1304
def __init__(self, data_list, add_meta_to_name=['src_name', 'product'], instrument=None, product=None):
self._p_list = []
self._n_list = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why having two __init__ almost identical?

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.

no need to set new session for each request with API
3 participants