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

DM-37523: Implement walk() for HttpResourcePath class #41

Merged
merged 16 commits into from Feb 22, 2023

Conversation

airnandez
Copy link
Contributor

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 84.14% // Head: 84.32% // Increases project coverage by +0.18% 🎉

Coverage data is based on head (4561a8a) compared to base (3fd76a0).
Patch coverage: 81.98% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   84.14%   84.32%   +0.18%     
==========================================
  Files          27       27              
  Lines        3476     3529      +53     
  Branches      714      735      +21     
==========================================
+ Hits         2925     2976      +51     
+ Misses        435      434       -1     
- Partials      116      119       +3     
Impacted Files Coverage Δ
python/lsst/resources/tests.py 97.57% <0.00%> (ø)
python/lsst/resources/http.py 79.43% <78.57%> (+1.48%) ⬆️
tests/test_http.py 93.12% <97.05%> (+0.60%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks. Minor comments.

url,
),
mem_usage=True,
mem_unit=u.mebibyte,
Copy link
Member

Choose a reason for hiding this comment

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

Are you worried about memory usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention is that we collect as much resource consumption information as we can when we are timing the execution. I thought it would not cost too much since time_this does not collect the memory usage when the logger is not enable for DEBUG level, which is the normal production configuration.

@@ -27,6 +27,7 @@
from typing import TYPE_CHECKING, BinaryIO, Iterator, List, Optional, Tuple, Union, cast

import requests
from astropy import units as u
Copy link
Member

Choose a reason for hiding this comment

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

This requires that we add astropy to the https optional dependencies section in pyproject.toml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added "astropy >= 4.0", following what is done in https://github.com/lsst/daf_butler/blob/main/pyproject.toml

@@ -227,10 +228,26 @@ def test_dav_as_local(self):
self.assertEqual(ResourcePath(local_path).read(), contents)
os.remove(local_path)

def test_dav_size(self):
# Size of an inexistent file must raise
Copy link
Member

Choose a reason for hiding this comment

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

"a nonexistent file" (also, period at end of comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@airnandez airnandez merged commit c4b1c5f into main Feb 22, 2023
@airnandez airnandez deleted the tickets/DM-37523 branch February 22, 2023 17:18
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.

None yet

2 participants