-
Notifications
You must be signed in to change notification settings - Fork 91
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
Added linting of docstrings #580
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,7 @@ def get_results( | |
query: Union[CollectionQuery, GranuleQuery], | ||
limit: int = 2000, | ||
) -> List[Any]: | ||
""" | ||
Get all results up to some limit, even if spanning multiple pages. | ||
"""Get all results up to some limit, even if spanning multiple pages. | ||
|
||
???+ Tip | ||
The default page size is 2000, if the supplied value is greater then the | ||
|
@@ -50,7 +49,6 @@ def get_results( | |
Raises: | ||
RuntimeError: The CMR query failed. | ||
""" | ||
|
||
page_size = min(limit, 2000) | ||
url = query._build_url() | ||
|
||
|
@@ -79,11 +77,10 @@ def get_results( | |
|
||
|
||
class DataCollections(CollectionQuery): | ||
""" | ||
???+ Info | ||
The DataCollection class queries against | ||
https://cmr.earthdata.nasa.gov/search/collections.umm_json, | ||
the response has to be in umm_json to use the result classes. | ||
"""???+ Info "Placeholder" | ||
The DataCollection class queries against | ||
https://cmr.earthdata.nasa.gov/search/collections.umm_json, | ||
the response has to be in umm_json to use the result classes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the linter messed up the indentation on this info box , so now it renders as empty (here: https://earthaccess--580.org.readthedocs.build/en/580/user-reference/collections/collections-query/)! :( I think this happened because there's no subject line in the docstring like there should be. I think we need to add that. A placeholder would be OK, since there's nothing there right now. Are you OK with adding
Sherwin-14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
_fields: Optional[List[str]] = None | ||
|
@@ -156,7 +153,6 @@ def get(self, limit: int = 2000) -> List[DataCollection]: | |
Raises: | ||
RuntimeError: The CMR query failed. | ||
""" | ||
|
||
return [ | ||
DataCollection(collection, self._fields) | ||
for collection in get_results(self.session, self, limit) | ||
|
@@ -442,7 +438,6 @@ def temporal( | |
object; or `date_from` and `date_to` are both datetime objects (or | ||
parsable as such) and `date_from` is after `date_to`. | ||
""" | ||
|
||
return super().temporal(date_from, date_to, exclude_boundary) | ||
|
||
|
||
|
@@ -481,7 +476,6 @@ def hits(self) -> int: | |
Raises: | ||
RuntimeError: The CMR query failed. | ||
""" | ||
|
||
url = self._build_url() | ||
|
||
response = self.session.get(url, headers=self.headers, params={"page_size": 0}) | ||
|
@@ -842,7 +836,6 @@ def temporal( | |
object; or `date_from` and `date_to` are both datetime objects (or | ||
parsable as such) and `date_from` is after `date_to`. | ||
""" | ||
|
||
return super().temporal(date_from, date_to, exclude_boundary) | ||
|
||
@override | ||
|
@@ -969,7 +962,6 @@ def doi(self, doi: str) -> Self: | |
Raises: | ||
RuntimeError: The CMR query to get the collection for the DOI fails. | ||
""" | ||
|
||
# TODO consider deferring this query until the search is executed | ||
collection = DataCollections().doi(doi).get() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is actually breaking some documentation:
https://earthaccess.readthedocs.io/en/latest/user-reference/granules/granules/#earthaccess.results.DataGranule.dataviz_links
https://earthaccess--580.org.readthedocs.build/en/580/user-reference/granules/granules/#earthaccess.results.DataGranule.dataviz_links
The return description is no longer being parsed correctly when this change is applied.