Skip to content

Improve progress bar updating in xml creation tasks on backend #322

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

haniffm
Copy link

@haniffm haniffm commented May 21, 2019

No description provided.

@codecov
Copy link

codecov bot commented May 21, 2019

Codecov Report

Merging #322 into master will decrease coverage by 0.4%.
The diff coverage is 15.38%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #322      +/-   ##
=========================================
- Coverage    54.7%   54.3%   -0.41%     
=========================================
  Files         160     160              
  Lines       11534   11563      +29     
  Branches     1493    1507      +14     
=========================================
- Hits         6310    6279      -31     
- Misses       5031    5085      +54     
- Partials      193     199       +6
Flag Coverage Δ
#backend 54.3% <15.38%> (-0.41%) ⬇️
Impacted Files Coverage Δ
ESSArch_Core/fixity/receipt/backends/xml.py 61.9% <0%> (-3.95%) ⬇️
ESSArch_Core/tasks.py 36.63% <0%> (-0.33%) ⬇️
ESSArch_Core/ip/utils.py 44.11% <0%> (-1.34%) ⬇️
ESSArch_Core/ip/tasks.py 0% <0%> (ø) ⬆️
ESSArch_Core/essxml/Generator/xmlGenerator.py 87.61% <66.66%> (-0.27%) ⬇️
ESSArch_Core/fixity/checksum.py 78.37% <0%> (-10.82%) ⬇️
ESSArch_Core/fixity/format.py 93.61% <0%> (-4.26%) ⬇️
ESSArch_Core/_version.py 29.91% <0%> (-3.42%) ⬇️
ESSArch_Core/util.py 58.99% <0%> (-2.97%) ⬇️
ESSArch_Core/storage/copy.py 53.96% <0%> (-1.59%) ⬇️
... and 1 more

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 40ee013...5ba6b43. Read the comment docs.

@codecov
Copy link

codecov bot commented May 21, 2019

Codecov Report

Merging #322 into master will decrease coverage by 0.14%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
- Coverage    54.7%   54.56%   -0.15%     
==========================================
  Files         160      160              
  Lines       11534    11559      +25     
  Branches     1493     1503      +10     
==========================================
- Hits         6310     6307       -3     
- Misses       5031     5058      +27     
- Partials      193      194       +1
Flag Coverage Δ
#backend 54.56% <16.66%> (-0.15%) ⬇️
Impacted Files Coverage Δ
ESSArch_Core/fixity/receipt/backends/xml.py 61.9% <0%> (-3.95%) ⬇️
ESSArch_Core/tasks.py 36.63% <0%> (-0.33%) ⬇️
ESSArch_Core/ip/utils.py 45.45% <0%> (ø) ⬆️
ESSArch_Core/ip/tasks.py 0% <0%> (ø) ⬆️
ESSArch_Core/essxml/Generator/xmlGenerator.py 87.61% <66.66%> (-0.27%) ⬇️

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 40ee013...5a1ab56. Read the comment docs.

@OskarPersson OskarPersson self-requested a review May 21, 2019 09:01
@@ -79,7 +79,8 @@ def generate_content_mets(ip):
algorithm = ip.get_checksum_algorithm()

generator = XMLGenerator()
generator.generate(files_to_create, folderToParse=ip.object_path, algorithm=algorithm)
for _ in generator.generate(files_to_create, folderToParse=ip.object_path, algorithm=algorithm):
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably use yield from here instead of the loop. (Note that the loop body also can be deleted, it's just that Github doesn't allow multi line suggestions atm)

Suggested change
for _ in generator.generate(files_to_create, folderToParse=ip.object_path, algorithm=algorithm):
yield from generator.generate(files_to_create, folderToParse=ip.object_path, algorithm=algorithm)

Copy link
Author

Choose a reason for hiding this comment

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

Very pythonic! 👍 Me like! :)

@OskarPersson OskarPersson self-requested a review May 28, 2019 13:17
@OskarPersson OskarPersson removed their request for review April 28, 2020 07:01
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.

2 participants