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

Update Belgian occurrence indicators based on corrected cubes #128

Closed
Tracked by #125
damianooldoni opened this issue Mar 28, 2024 · 7 comments · Fixed by #132
Closed
Tracked by #125

Update Belgian occurrence indicators based on corrected cubes #128

damianooldoni opened this issue Mar 28, 2024 · 7 comments · Fixed by #132
Assignees

Comments

@damianooldoni
Copy link
Contributor

damianooldoni commented Mar 28, 2024

Run occurrence based indicators on corrected cubes:

This means running all Rmds in ./src from 5 to 12.

@damianooldoni damianooldoni changed the title rerun Belgian occurrence indicators based on corrected cubes Update Belgian occurrence indicators based on corrected cubes Mar 28, 2024
@soriadelva
Copy link
Collaborator

soriadelva commented Apr 9, 2024

Update: the links to the corrected cubes on zenodo have been added where necessary. However, two errors occurred

  • In script 09_define_overlay_grid_belgium_with_protected_areas.Rmd: The download of the Natura2000_end2019_Shapefile fails (a folder is created on the local computer but remains empty). It goes wrong somewhere in the following lines:

    if (!file.exists(path_natura2000)) {
    options(timeout = 60*30) # 30min max allowed for downloading
    temp <- tempfile()
    download.file(
    "https://cmshare.eea.europa.eu/s/n5L8Lrs9aYD775S/download",
    temp,
    cacheOK = FALSE
    )
    unzip(temp, exdir = path_natura2000)
    unlink(temp)
    }

  • In script 07_occurrence_indicators_modelling.Rmd the following error occurs when running the trias::apply_gam function:
    Error in map2(): ℹ In index: 6. Caused by error in dplyr::select(): ! Can't select columns that don't exist. ✖ Column smooth doesn't exist.
    This same error has also appeared in another repo that uses the apply_gam function: see Tests of package (via devtools::check() ) indicates an error and warnings trias#113

damianooldoni added a commit that referenced this issue Apr 10, 2024
This olves the first of the two problems described in #128 (comment)

Co-Authored-By: Pieter Huybrechts <[email protected]>
@damianooldoni
Copy link
Contributor Author

First problem solved via c6e5763

@soriadelva
Copy link
Collaborator

@damianooldoni I tried to rerun the 07_occurrence_indicators_modelling.Rmd script but still encountered the same error linked to the apply_gam function (column smooth doesn't exist). It has likely something to do with how I loaded the updated version of the trias package on my local computer (I fetched the main branch of trias-project/trias and did "update from main" in Github Desktop for the current branch linked to issue #128 of trias-project/indicators). As that still gave an error, I updated the trias package on my local computer but that also didn't work. Do you know if I still need to do something else? Thanks in advance!

@damianooldoni
Copy link
Contributor Author

Hi @soriadelva. The trias branch with the update was still not merged to main. That was indeed my task to do after your review. I have just merged to main. You could now via GitHub Desktop:

  1. go to trias repository
  2. check you are on main branch
  3. click on "fetch origin"
  4. Pull the changes
  5. Open tias RStudio project related to trias R package
  6. Run devtools::install()
  7. Close it
  8. Open indicator R project or close it and open it again.
  9. Run library(trias)
  10. Check you have the right package version by running devtools::session_info(). If you see a line with trias * 2.1.0 it's ok.

So, in general, it's just a question of checking versions of a package. This is a nice example why it's important to apply versioning in package development 😄

Please, don't hesitate to contact me here or via chat if something is not working or not clear.

@soriadelva
Copy link
Collaborator

Hi @soriadelva. The trias branch with the update was still not merged to main. That was indeed my task to do after your review. I have just merged to main. You could now via GitHub Desktop:

  1. go to trias repository
  2. check you are on main branch
  3. click on "fetch origin"
  4. Pull the changes
  5. Open tias RStudio project related to trias R package
  6. Run devtools::install()
  7. Close it
  8. Open indicator R project or close it and open it again.
  9. Run library(trias)
  10. Check you have the right package version by running devtools::session_info(). If you see a line with trias * 2.1.0 it's ok.

So, in general, it's just a question of checking versions of a package. This is a nice example why it's important to apply versioning in package development 😄

Please, don't hesitate to contact me here or via chat if something is not working or not clear.

Thanks @damianooldoni, this worked! I ran all scripts and knit the respective .Rmd files. Before I generate a Pull Request, do you want me to commit all the files that have been overwritten by the changes?

@damianooldoni
Copy link
Contributor Author

Did you remember to delete all existent images before generating the new ones?

Yes, you can push the changes in some commits and then generate a Pull Request 👍 Thanks a lot.

@soriadelva
Copy link
Collaborator

Did you remember to delete all existent images before generating the new ones?

Yes, you can push the changes in some commits and then generate a Pull Request 👍 Thanks a lot.

oh no, I didn't! 😓 I'll run it again!!

@soriadelva soriadelva linked a pull request Apr 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants