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 ECCO metadata_url and urls that both adding a trailing / #318

Merged
merged 15 commits into from
Jan 20, 2025

Conversation

navidcy
Copy link
Collaborator

@navidcy navidcy commented Dec 24, 2024

Close #316

@navidcy navidcy requested review from glwagner and simone-silvestri and removed request for glwagner December 24, 2024 07:33
@navidcy navidcy added the build docs Add this label to built the docs in a PR label Dec 24, 2024
@navidcy navidcy added the bug Something isn't working label Dec 24, 2024
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (3b252db) to head (7a0eb90).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/DataWrangling/ECCO/ECCO_metadata.jl 0.00% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #318   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         34      34           
  Lines       1983    1983           
=====================================
  Misses      1983    1983           

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

@navidcy navidcy mentioned this pull request Dec 24, 2024
@navidcy
Copy link
Collaborator Author

navidcy commented Dec 25, 2024

So we can literate this example, but I don't know what to do with the sliders. I don't think we can have sliders in the docs...
At the moment, it looks like:
https://clima.github.io/ClimaOceanDocumentation/previews/PR318/literated/ecco_inspect_temperature_salinity/

@glwagner
Copy link
Member

If this fixes a bug, we should add a test to ensure the bug doesn't happen again. How did this bug get through?

@navidcy
Copy link
Collaborator Author

navidcy commented Dec 27, 2024

I'm also wondering because there are tests that download ECCO data; I'll look into that.

@simone-silvestri
Copy link
Collaborator

simone-silvestri commented Dec 27, 2024

Repeated / are usually not accounted for when navigating URLs or a (UNIX) file system.
For example, to access ClimaOcean
https://github.com/CliMA/ClimaOcean.jl/
is equivalent to
https://github.com/CliMA/////ClimaOcean.jl/
or
https://github.com/////CliMA/ClimaOcean.jl
The same goes with cd:
cd /to/my/path and cd /to///my/path/// are equivalent.
With this convention, it is possible to compose directories or join paths without considering whether adding a trailing / will break the path and we can always add a trailing /. So this is not technically a bug, I would call it more a syntax cleanup. However, I am not sure this pattern is also valid when navigating a windows filesystem.

@glwagner
Copy link
Member

Ok that is what I suspected --- not a bug, but good to clean up regardless. Let's not mark it as a bug though because that may mislead

@navidcy navidcy removed the bug Something isn't working label Jan 11, 2025
@navidcy navidcy changed the title Fix bug with ECCO metadata_url and urls both adding a trailing / Fix ECCO metadata_url and urls that both adding a trailing / Jan 11, 2025
@navidcy navidcy marked this pull request as ready for review January 11, 2025 03:52
@navidcy
Copy link
Collaborator Author

navidcy commented Jan 12, 2025

@simone-silvestri
Copy link
Collaborator

yeah looks like. Should go away if we use [email protected]

trying out to see if scalar operations came with v0.95.7 and changes introduced by CliMA/Oceananigans.jl#4037
@navidcy
Copy link
Collaborator Author

navidcy commented Jan 12, 2025

and none of the tests of Oceananigans caught this?

@navidcy
Copy link
Collaborator Author

navidcy commented Jan 12, 2025

and none of the tests of Oceananigans caught this?

OK, none of Oceananigans tests caught this because they are all run within a CUDA.allowscalar()!

https://github.com/CliMA/Oceananigans.jl/blob/e02564df8ab90fb8f994fddf465b10d123fdfc3a/test/runtests.jl#L19

We should remove this CUDA.allowscalar() do ... all-the-tests ... end

cc @glwagner

@simone-silvestri
Copy link
Collaborator

I am definitely in favor of that. allowscalar should be more granular and used only when necessary.

@navidcy navidcy merged commit 25e2881 into main Jan 20, 2025
24 checks passed
@navidcy navidcy deleted the ncc/metadata-bug branch January 20, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build docs Add this label to built the docs in a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECCO's metadata_url and urls both add a / between the url's path and filename
3 participants