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

Fix USGS and Style #139

Merged

Conversation

SorooshMani-NOAA
Copy link
Contributor

@SorooshMani-NOAA SorooshMani-NOAA commented May 13, 2024

Fix #138

The original code removed duplicates in the USGS station data frames based on value and qualifier only. The dataframe duplicates should look at datetime, site_no, qualifier, code and option to identify duplicates instead

@SorooshMani-NOAA
Copy link
Contributor Author

SorooshMani-NOAA commented May 13, 2024

@pmav99 I think the style protection setup for searvey needs to be more lenient!! Every time I go back to fixing a 5min bug in searvey I need to spend hours trying to figure out how to submit the code! I'm using conda environment for my dev, and somehow it doesn't like pipx and precommit and black and everytime something gets messed up.

I can no longer make init in my env (new env I create from scratch on conda). It's just too much!! This is the fix for the bug @AtiehAlipour-NOAA discovered. But I don't know how to move forward with creating a clean PR for merge given the issues I keep having on my env with pipx and precommit.

Update
I am now able to make init, but I still fail in the precommit black and reorder-python-imports. If I manually run black all is fine!!

@pmav99
Copy link
Member

pmav99 commented May 14, 2024

Yeah, this happens because reorder-python-imports and black have made an incompatible choice WRT to whitespace after module docstrings. Your commit adds an extra line here: https://github.com/oceanmodeling/searvey/pull/139/files#diff-693873d8dcc79e85f6d48197d036272497c1d339ec3c218a87ed678f40489030R12
Reorder-python-imports removes this line and black adds it again. The end result is that the file is identical to the state it was before you run pre-commit (which is why it is not easy to understand what happens) but since both checks changed the file they both fail.

For more info check e.g. asottile/reorder-python-imports#66 and many other issues in the reorder-python-imports bugtracker.

I am happy to discuss and review improvements to our CI :)

@SorooshMani-NOAA
Copy link
Contributor Author

Thank you @pmav99 it now makes sense! I think the main thing is having a good feedback! I couldn't get it why it would just gives me error on both of these tools. Let's talk about possible solutions during our next meeting. Failing during commit is very annoying, so maybe we should not do all of the reordering, etc. at the same time during commit. Let's for example do Black only during precommit and do the rest for merge tests, or something like that

@pmav99
Copy link
Member

pmav99 commented May 14, 2024

OK, I revoked all the changes I had done in this branch because I merged them on master via #140

@SorooshMani-NOAA can you please rebase? There will be a minor conflict which will need to be resolved (the empty line after the module docstring). I could do it myself but resolving the conflict would show me as the COMMIT_AUTHOR instead of you.

After rebase, if CI is happy, feel free to merge.

@SorooshMani-NOAA SorooshMani-NOAA merged commit 95f26d6 into oceanmodeling:master May 14, 2024
8 checks passed
@SorooshMani-NOAA SorooshMani-NOAA deleted the bugfix/usgs_nwis branch May 14, 2024 15:51
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.

Issue with USGS data
2 participants