Skip to content

Conversation

@antgonza
Copy link
Member

@antgonza antgonza commented Sep 3, 2020

No description provided.

@antgonza antgonza requested a review from wasade September 3, 2020 19:12
@codecov-commenter
Copy link

Codecov Report

Merging #3029 into dev will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #3029   +/-   ##
=======================================
  Coverage   94.94%   94.95%           
=======================================
  Files          74       74           
  Lines       14275    14291   +16     
=======================================
+ Hits        13554    13570   +16     
  Misses        721      721           
Impacted Files Coverage Δ
...ita_db/metadata_template/base_metadata_template.py 96.34% <100.00%> (ø)
qiita_db/metadata_template/prep_template.py 98.07% <100.00%> (+0.04%) ⬆️
qiita_db/metadata_template/sample_template.py 100.00% <100.00%> (ø)
...ta_db/metadata_template/test/test_prep_template.py 99.55% <100.00%> (+<0.01%) ⬆️
..._db/metadata_template/test/test_sample_template.py 99.86% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 773f640...b66c398. Read the comment docs.

Copy link
Contributor

@wasade wasade left a comment

Choose a reason for hiding this comment

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

A possible non blocking change for a little further code reduction, and a question about the accessions dict

add_ebi_accessions : bool, optional
If this should add the ebi accessions
"""
df = self._common_to_dataframe_steps()
Copy link
Contributor

Choose a reason for hiding this comment

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

what about:

accessions = None
if add_ebi_accessions:
    accessions = self.ebi_sample_accessions

return self._common_to_dataframe_steps(accessions, 'ebi_sample_accessions')

...similar for the prep template to_dataframe, and then add into the common function:

if accessions is not None:
    df[f'qiita_{accession_type}'] = df.index.map(lambda sid: accessions[sid])

Would reduce a little of code duplication

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 strong feeling about leaving as is or changing ...

Copy link
Contributor

Choose a reason for hiding this comment

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

cool cool, then :shipit: i think :)

df = self._common_to_dataframe_steps()

if add_ebi_accessions:
accessions = self.ebi_sample_accessions
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all samples assured to be represented in this object? If not, would it be safer to have the lambda issue a accessions.get?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, AFAIK all samples in the prep/sample are represented.

Copy link
Member Author

@antgonza antgonza left a comment

Choose a reason for hiding this comment

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

thank you @wasade

df = self._common_to_dataframe_steps()

if add_ebi_accessions:
accessions = self.ebi_sample_accessions
Copy link
Member Author

Choose a reason for hiding this comment

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

yes, AFAIK all samples in the prep/sample are represented.

add_ebi_accessions : bool, optional
If this should add the ebi accessions
"""
df = self._common_to_dataframe_steps()
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 strong feeling about leaving as is or changing ...

@wasade wasade merged commit 7f13ac2 into qiita-spots:dev Sep 4, 2020
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.

3 participants