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

adapt singlecell example to macos #180

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Conversation

AurelienJaquier
Copy link
Collaborator

No description provided.

@AurelienJaquier AurelienJaquier self-assigned this Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.27%. Comparing base (8d5b0ab) to head (884efaa).
Report is 131 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   60.07%   51.27%   -8.81%     
==========================================
  Files         109      125      +16     
  Lines        7838    10733    +2895     
==========================================
+ Hits         4709     5503     +794     
- Misses       3129     5230    +2101     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

FILES=$(curl -s "$BASE_API" | grep -oP "\"path\": \"$FOLDER/.*?\.ibw\"" | grep -oP "(?<=\"$FOLDER/)[^\"]+")
# Execute the following line if you are working on macos:
# FILES=$(curl -s "$BASE_API" | grep -oE "\"path\": \"$FOLDER/.*?\.ibw")
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 this should also work for linux, so we could even keep only this variant

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I asked AI, and this is what it told me:
The -E option enables extended regular expressions, which is supported in GNU grep. However, the .*? lazy quantifier is not supported in extended regular expressions 1, 3.

To make this code work on a GNU Linux machine, you should use the -P option instead of -E to enable Perl-compatible regular expressions (PCRE)

Copy link
Collaborator Author

@AurelienJaquier AurelienJaquier Jan 9, 2025

Choose a reason for hiding this comment

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

This comment confirms that just using grep -E on linux would not work because of the .*? part, so we need to keep both the linux case and the macos case I believe: https://stackoverflow.com/questions/3027518/how-to-do-a-non-greedy-match-in-grep/5774431#5774431

Copy link
Collaborator

@ilkilic ilkilic Jan 9, 2025

Choose a reason for hiding this comment

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

Thanks for the explanation. What if we use the command below instead which I believe would give the same result and doesn't need PCRE:
FILES=$(curl -s "$BASE_API" | grep -oE "\"path\": \"$FOLDER/[^\"]*\.ibw" | grep -oE "[^/]*\.ibw$")

edited the command

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great, thanks. updated in latest commit with FILES=$(curl -s "$BASE_API" | grep -oE "\"path\": \"$FOLDER/[^\"]*\.ibw"), as discussed offline.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great! thank you

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

approval please? 🙏

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, all good! Thank you very much

@AurelienJaquier AurelienJaquier merged commit 626f780 into main Jan 9, 2025
6 checks passed
@AurelienJaquier AurelienJaquier deleted the singlecell-example branch January 9, 2025 16:22
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.

4 participants