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

fixing searching for restricted datasets and accessing ASF on demand data from Opera #443

Merged
merged 13 commits into from
Feb 11, 2024

Conversation

betolink
Copy link
Member

@betolink betolink commented Feb 1, 2024


📚 Documentation preview 📚: https://earthaccess--443.org.readthedocs.build/en/443/

@betolink betolink requested a review from jhkennedy February 1, 2024 17:32
@@ -228,7 +228,9 @@ def __repr__(self) -> str:
Temporal coverage: {self['umm']['TemporalExtent']}
Size(MB): {self.size()}
Data: {data_links}\n\n
""".strip().replace(" ", "")
""".strip().replace(
Copy link
Member Author

Choose a reason for hiding this comment

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

Black likes this, Ruff does not, which one is right? @mfisher87

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should pick one :) Ruff offers a formatter that re-implements Black, but I've never worked with it before. Personally, I'd turn Ruff formatting off and stick with Black due to my lack of experience, but if I had more time I'd try to learn more and switch to Ruff for everything.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like Ruff prefers the compact and black expands. I think Ruff is actually correct here (obvs. subjective).

This doc is helpful for black vs ruff:
https://github.com/astral-sh/ruff/blob/main/docs/formatter/black.md#implicit-string-concatenations-in-attribute-accesses

I don't think it matters which, but I agree that we should pick one -- I'd prefer ruff overall.

@MattF-NSIDC I'm pretty happy with ruff; and the transition from black to ruff is pretty straight forward as they mostly behave the same.

earthaccess/auth.py Show resolved Hide resolved
earthaccess/search.py Outdated Show resolved Hide resolved
betolink and others added 3 commits February 1, 2024 22:35
adding Sentinel 1, (I though Sentinel was working before.)

Co-authored-by: Joseph H Kennedy <[email protected]>
Co-authored-by: Joseph H Kennedy <[email protected]>
@betolink betolink marked this pull request as ready for review February 2, 2024 04:42
@@ -4,7 +4,7 @@ channels:
dependencies:
# This environment bootstraps poetry, the actual dev environment
# is installed and managed with poetry
- python=3.9
- python=3.10
Copy link
Member Author

Choose a reason for hiding this comment

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

This one is only for the local dev environment and actually not necessary as we can just pip install the project locally.... I use it to bootstrap the environment and install some conda libs to test notebooks with (cartopy)

@betolink
Copy link
Member Author

betolink commented Feb 2, 2024

Should we include #436 on this PR? since we are touching the EDL session?

@jhkennedy
Copy link
Collaborator

Should we include #436 on this PR? since we are touching the EDL session?

Yes, that's a good idea


def __init__(
self, username: Optional[str] = None, password: Optional[str] = None
) -> None:
super().__init__()
self.headers.update({"User-Agent": user_agent})
Copy link
Member Author

Choose a reason for hiding this comment

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

earthaccess will now use the User-Agent header to identify requests to EDL. 🎉

Co-authored-by: Joseph H Kennedy <[email protected]>
@betolink
Copy link
Member Author

betolink commented Feb 8, 2024

Should we merge this before the other open PRs? @jhkennedy @mfisher87

@mfisher87
Copy link
Collaborator

pre-commit.ci autofix

def instrument(self, instrument: str) -> Type[CollectionQuery]:
"""Searh datasets by instrument

???+ Tip
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mfisher87
Copy link
Collaborator

Should we merge this before the other open PRs? @jhkennedy @mfisher87

Logistically, that makes sense to me. I haven't done a proper review here and won't have time in short-term, so I'll leave the "approval" decision to others :)

jhkennedy
jhkennedy previously approved these changes Feb 8, 2024
Copy link
Collaborator

@jhkennedy jhkennedy left a comment

Choose a reason for hiding this comment

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

I think this looks good! Should work as is, but I added a take-or-leave suggestion

earthaccess/auth.py Outdated Show resolved Hide resolved
Co-authored-by: Joseph H Kennedy <[email protected]>
@betolink
Copy link
Member Author

betolink commented Feb 8, 2024

I think this looks good! Should work as is, but I added a take-or-leave suggestion

I think that last commit broke things... 😂 @jhkennedy

@jhkennedy
Copy link
Collaborator

I think this looks good! Should work as is, but I added a take-or-leave suggestion

I think that last commit broke things... 😂 @jhkennedy

Yes, hense the "Note: imports will also need to be adjusted." 😉

@betolink betolink requested a review from jhkennedy February 9, 2024 03:17
@betolink
Copy link
Member Author

betolink commented Feb 9, 2024

I'm using importlib so we avoid importing the library and potentially produce one of those circular import errors, I think it should be good now.

@betolink
Copy link
Member Author

going to merge this @jhkennedy

@betolink betolink merged commit e187ae0 into main Feb 11, 2024
13 checks passed
@mfisher87 mfisher87 linked an issue Apr 8, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants