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

Migrate to pure julia #62

Merged
merged 12 commits into from
Jan 23, 2025
Merged

Migrate to pure julia #62

merged 12 commits into from
Jan 23, 2025

Conversation

albangossard
Copy link
Member

@albangossard albangossard commented Jan 16, 2025

What has been done

  • Removed the PyCall dependencies
  • Updated the environment
  • Some code cleaning
  • Updated the jld2 files

The tests test/runtests.jl passed on my local branch ✔️

Next steps

  • Put OGGM data on a server
  • Automatically pull these data
  • Remove oggm_env from the CI
  • Pursue the migration in the other repos

Copy link
Member

@JordiBolibar JordiBolibar left a comment

Choose a reason for hiding this comment

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

Just a couple of minor comments :)

Project.toml Outdated
@@ -6,6 +6,7 @@ version = "0.6.1"
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Copy link
Member

Choose a reason for hiding this comment

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

Is this really necessary? I think it's just use in tandem with CSV.jl, and we saw that those are quite easy to read, so I'd drop this dependency unless it's really necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, not using DataFrames with CSV is almost transparent. This dependency was removed in a89c40e

function params_constructor_specified(; save_refs::Bool = true) # TODO: change
function params_constructor_specified(; save_refs::Bool = false)

rgi_paths = JSON.parsefile("/tmp/OGGM/ODINN_prepro/rgi_paths.json") # TODO: find a way to automatically determine the path
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to always stick to this path or we want to make it dynamic?

Copy link
Member Author

Choose a reason for hiding this comment

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

We want it to be dynamic and this needs to be based on the preprocessed data that are downloaded in the __init__. All of this was implemented in a89c40e

Copy link
Member Author

@albangossard albangossard left a comment

Choose a reason for hiding this comment

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

Thanks for the review! Data are now automatically downloaded. We need to put the files in an appropriate server (cf #63) but for the moment a google drive folder makes the job.

Project.toml Outdated
@@ -6,6 +6,7 @@ version = "0.6.1"
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, not using DataFrames with CSV is almost transparent. This dependency was removed in a89c40e

function params_constructor_specified(; save_refs::Bool = true) # TODO: change
function params_constructor_specified(; save_refs::Bool = false)

rgi_paths = JSON.parsefile("/tmp/OGGM/ODINN_prepro/rgi_paths.json") # TODO: find a way to automatically determine the path
Copy link
Member Author

Choose a reason for hiding this comment

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

We want it to be dynamic and this needs to be based on the preprocessed data that are downloaded in the __init__. All of this was implemented in a89c40e

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 63.52941% with 31 lines in your changes missing coverage. Please review.

Please upload report for BASE (purejulia@cd84675). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/glaciers/climate/climate2D_utils.jl 47.61% 22 Missing ⚠️
src/glaciers/glacier/glacier2D_utils.jl 68.42% 6 Missing ⚠️
src/glaciers/climate/Climate1D.jl 0.00% 2 Missing ⚠️
src/glaciers/glacier/Glacier1D.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             purejulia      #62   +/-   ##
============================================
  Coverage             ?   29.51%           
============================================
  Files                ?       15           
  Lines                ?      603           
  Branches             ?        0           
============================================
  Hits                 ?      178           
  Misses               ?      425           
  Partials             ?        0           

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

@albangossard albangossard force-pushed the agossard/migratePureJulia branch from 0f3df9f to 4182903 Compare January 17, 2025 17:15
@albangossard albangossard force-pushed the agossard/migratePureJulia branch from 4182903 to 6834b5d Compare January 19, 2025 21:13
@albangossard albangossard merged commit 7e113ca into purejulia Jan 23, 2025
1 check passed
@albangossard albangossard deleted the agossard/migratePureJulia branch January 23, 2025 10:35
albangossard added a commit that referenced this pull request Jan 23, 2025
* migrate all 2D files to purejulia

* update test references

* remove PyCall dependencies in the 1D files

* automatic download of preprocessed data + remove DataFrames dependency

* try to remove Python from the CI

* remove remaining implicit dependencies to Python objects

* create get_rgi_paths

* fix various bugs

* remove absolute paths from get_rgi_paths to make the tests platform agnostic

* fix bugs with the climate_2D_step structure

* some cleaning

* bump version
albangossard added a commit that referenced this pull request Jan 23, 2025
…ng on PyCall (#65)

* Add version number to all dependencies

* Update CI.yml with new micromamba version

* Update environment.yml

* Changing python imports

* Python environment working in local - testing CI

* Update CI.yml - Testing in multiple versions & OS

* Update CI.yml

* Remove cache environments

* Remove unnecessary `which python`

* Update CI.yml - bring some specific os info

* Rename environment

* Update CI.yml - Ask more network variables

* Update CI.yml - typo in NetworkOptions

* Ping path for Mac - not working for Ubuntu

* Update CI.yml - checking path

* Update CI.yml

* Update CI.yml

* Update CI.yml

* Update CI.yml

* Update CI.yml

* Update config.jl - remove catch warning

* Update CI.yml - Now maybe exporiting global env variable

* Update CI.yml - Fix export on environmnet names

* Update CI.yml - bump micromamba version

* testing idea from the discourse

* Update CI.yml

* Update action version of `checkout` and `setup-python`

* Update CI.yml - fix typo with SSH -> SSL

* Update CI.yml - export SSL_CERT_FILE

* Update CI.yml - Change Python path

* Update CI.yml

* Update CI.yml

* Update CI.yml - Trying to reproduce past behaviour

* Update CI.yml

* Update config.jl - remove try's

* Update CI.yml - Julia 1.11

* Update CI.yml - remove Python setup and let this to micromamba

* Update CI.yml - conda -> micromamba for environment inspection

* Remove some redundancy and things that may fail

* Update CI.yml

* Update CI.yml

* [WIP] Removing Python dependencies and migrating to Rasters.jl

Ongoing fix, still a few lines missing, and tests have still not been run.

* Remove environment.yml file

* [WIP] continue the migration, tests of params_construction.jl are passing

* Migrate to pure julia (#62)

* migrate all 2D files to purejulia

* update test references

* remove PyCall dependencies in the 1D files

* automatic download of preprocessed data + remove DataFrames dependency

* try to remove Python from the CI

* remove remaining implicit dependencies to Python objects

* create get_rgi_paths

* fix various bugs

* remove absolute paths from get_rgi_paths to make the tests platform agnostic

* fix bugs with the climate_2D_step structure

* some cleaning

* bump version

* fix dependencies after rebase

---------

Co-authored-by: Facundo Sapienza <[email protected]>
Co-authored-by: Jordi <[email protected]>
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.

3 participants