waternumbers / dynatopGIS

GIS tools for building dynamic TOPMODEL implimentations
https://waternumbers.github.io/dynatopGIS/
2 stars 0 forks source link

devtools::github_install fails #1

Closed waternumbers closed 4 years ago

waternumbers commented 5 years ago

devtools::github_install fails to find the Rcpp wrapper functions but cloning and using devtools::install_all works.

waternumbers commented 5 years ago

v0.0.2 works for me on my systems. @octopusann @barryhankin please check on yours by doing

remove.packages("dynatopGIS") devtools::install_github("waternumbers/dynatopGIS")

then trying, for example sink_fill

octopusann commented 5 years ago

Will try tomorrow.

Dr. Ann Kretzschmar Senior Research Associate Q-NFM

B505 LEC 1

Lancaster Environment Centre Lancaster University LA1 4YQ

From: Paul Smith notifications@github.com Sent: 01 July 2019 15:23 To: waternumbers/dynatopGIS dynatopGIS@noreply.github.com Cc: Kretzschmar, Ann a.kretzschmar@lancaster.ac.uk; Mention mention@noreply.github.com Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

v0.0.2 works for me on my systems. @octopusannhttps://github.com/octopusann @barryhankinhttps://github.com/barryhankin please check on yours by doing

remove.packages("dynatopGIS") devtools::install_github("waternumbers/dynatopGIS")

then trying, for example sink_fill

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVV625XSRV7UQKS3J5TP5IHLHA5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY6JFXA#issuecomment-507286236, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVRMBMXPQG4M25VWA33P5IHLHANCNFSM4H32LILA.

octopusann commented 5 years ago

Run dynatopGIS v2 on Swindale. Looks to have run OK but when I move on to the example in the same vignette using Brompton, its falls over in check_model.

The message is Error in dynatop::check_model(model) : param should be a numeric matrix

If you try to list model$param it says it doesn't exist.

Dr. Ann Kretzschmar

Lancaster Environment Centre

Lancaster University

LA1 4YQ

kretzsch@exchange.lancs.ac.ukmailto:kretzsch@exchange.lancs.ac.uk

octopusann@me.commailto:octopusann@me.com

mobile: 07775-968315


From: Kretzschmar, Ann Sent: 01 July 2019 17:18:48 To: waternumbers/dynatopGIS Subject: RE: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

Will try tomorrow.

Dr. Ann Kretzschmar

Senior Research Associate Q-NFM

B505 LEC 1

Lancaster Environment Centre

Lancaster University

LA1 4YQ

From: Paul Smith notifications@github.com Sent: 01 July 2019 15:23 To: waternumbers/dynatopGIS dynatopGIS@noreply.github.com Cc: Kretzschmar, Ann a.kretzschmar@lancaster.ac.uk; Mention mention@noreply.github.com Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

v0.0.2 works for me on my systems. @octopusannhttps://github.com/octopusann @barryhankinhttps://github.com/barryhankin please check on yours by doing

remove.packages("dynatopGIS") devtools::install_github("waternumbers/dynatopGIS")

then trying, for example sink_fill

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVV625XSRV7UQKS3J5TP5IHLHA5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY6JFXA#issuecomment-507286236, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVRMBMXPQG4M25VWA33P5IHLHANCNFSM4H32LILA.

waternumbers commented 5 years ago

Do you mean the later part of the example where Swindale is run with the Brompton forcing data or the vignette in the dynatop package?

if the later please raise the issue on the issue tracker for the dynatop package.

Assuming the former if model[[3]] returns what looks like the parameter vector the model was generated using the older erroneous version of dynatopGIS.

Check you have the latest version installed and are using it when the model is generated (compared to say an older git clone on your machine).

octopusann commented 5 years ago

The example running Swindale with the Brompton data. I followed your instructions to remove and reinstall. I have cloned from github and called in v2 but only in the top level folder.

How can I tell which versaion I have installed? Don’t follow your last comment – sorry.

Dr. Ann Kretzschmar Senior Research Associate Q-NFM

B505 LEC 1

Lancaster Environment Centre Lancaster University LA1 4YQ

From: Paul Smith notifications@github.com Sent: 02 July 2019 10:42 To: waternumbers/dynatopGIS dynatopGIS@noreply.github.com Cc: Kretzschmar, Ann a.kretzschmar@lancaster.ac.uk; Mention mention@noreply.github.com Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

Do you mean the later part of the example where Swindale is run with the Brompton forcing data or the vignette in the dynatop package?

if the later please raise the issue on the issue tracker for the dynatop package.

Assuming the former if model[[3]] returns what looks like the parameter vector the model was generated using the older erroneous version of dynatopGIS.

Check you have the latest version installed and are using it when the model is generated (compared to say an older git clone on your machine).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVSJPCYBTAGH6KJ35ZDP5MPHLA5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAWMVY#issuecomment-507602519, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVV7N6UXR7OHRRXAAQDP5MPHLANCNFSM4H32LILA.

waternumbers commented 5 years ago

You have both an installed version and the cloned source code. You could be making the function in the library available by either

library(dynatopGIS) - which will used the installed version

or

devtools::load_all(<path to source code>)

which will make the source code you have cloned available.

The instructions I sent where to update the installed version. They will have no effect if you are using devtools::load_all

To check the install version in R run

installed.packages()["dynatopGIS",]

the version number should be 0.0.2

Alternatively to tell if you are using a version that correctly generates the model start an R session, load the library into R (which ever method described above) and type create_model at the R prompt If you are on the latest version you should see a line

       pet_input = "unknown", stringsAsFactors = FALSE), param = c(srz_max_default = 0.05, 

If however yours looks like

       pet_input = "unknown", stringsAsFactors = FALSE), param <- c(srz_max_default = 0.05, 

you are on a older version

octopusann commented 5 years ago

1) Installed.packages gives me this

installed.packages()["dynatopGIS",] Package LibPath "dynatopGIS" "/home/kretzsch/R/x86_64-redhat-linux-gnu-library/3.6" Version Priority "0.0.2" NA Depends Imports "R (>= 3.1)" "Rcpp, raster, sp, rgeos, rgdal, jsonlite" LinkingTo Suggests "Rcpp" "knitr, rmarkdown, dynatop, covr" Enhances License NA "GPL-2" License_is_FOSS License_restricts_use NA NA OS_type MD5sum NA NA NeedsCompilation Built "yes" "3.6.0" so it seems to be picking up the correct version.

2) typing create_model lists the code. I can only see two instances of pet_input

initialise the hillslope

model <- list(hillslope = data.frame(
                  id = raster::unique(brck[[hillslope_class]]),
                  area = raster::zonal(brck[['land_area']],brck[[hillslope_class]],
                                       'sum',digits=4)[,2],
                  atb_bar = raster::zonal(brck[['atb']],brck[[hillslope_class]],
                                          'mean',digits=4)[,2],
                  precip_input="unknown",
                  pet_input="unknown",
                  srz_max="srz_max_default",
                  srz_0="srz_0_default",
                  ln_t0="ln_t0_default",
                  m="m_default",
                  td="td_default",
                  tex="tex_default"
              ),
              channel = data.frame(
                  id = raster::unique(brck[['channel_id']]),
                  area = raster::zonal(brck[['channel_area']],brck[['channel_id']],
                                       'sum',digits=4)[,2],
                  precip_input="unknown",
                  pet_input="unknown"
              ),

It looks quite differen tto your example. It is followed by

param <- c(srz_max_default=0.05, srz_0_default=0.99, ln_t0_default=19, m_default=0.004, td_default=20, tex_default=100) )

Dr. Ann Kretzschmar

Lancaster Environment Centre

Lancaster University

LA1 4YQ

kretzsch@exchange.lancs.ac.ukmailto:kretzsch@exchange.lancs.ac.uk

octopusann@me.commailto:octopusann@me.com

mobile: 07775-968315


From: Paul Smith notifications@github.com Sent: 02 July 2019 11:33:33 To: waternumbers/dynatopGIS Cc: Kretzschmar, Ann; Mention Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

You have both an installed version and the cloned source code. You could be making the function in the library available by either

library(dynatopGIS) - which will used the installed version

or

devtools::load_all()

which will make the source code you have cloned available.

The instructions I sent where to update the installed version. They will have no effect if you are using devtools::load_all

To check the install version in R run

installed.packages()["dynatopGIS",]

the version number should be 0.0.2

Alternatively to tell if you are using a version that correctly generates the model start an R session, load the library into R (which ever method described above) and type create_model at the R prompt If you are on the latest version you should see a line

   pet_input = "unknown", stringsAsFactors = FALSE), param = c(srz_max_default = 0.05,

If however yours looks like

   pet_input = "unknown", stringsAsFactors = FALSE), param <- c(srz_max_default = 0.05,

you are on a older version

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVQRUC4VBWRCCR5CPQDP5MVH3A5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZA2N4I#issuecomment-507619057, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVQFCDKJOHAL42M6RPLP5MVH3ANCNFSM4H32LILA.

waternumbers commented 5 years ago

What ever code you have loaded is an old version

octopusann commented 5 years ago

Now I’m really confused! There is something odd going on. The packages list in Rstudio shows version 2. I’ve detached it by unchecking the box and am attempting reattach using the Library command. The shortcut box shows both dynatop and dynatopGIS. If I run the curser over, I get info about dynatop but nothing for dynatopGIS. It is still telling me this is version 2. Now when I type create_model, a different verion of the code is coming up, the new one I think. I’ll try running it again.

I haven’t knowingly done anything different this time!!!

This time it seems to have worked ……..

Dr. Ann Kretzschmar Senior Research Associate Q-NFM

B505 LEC 1

Lancaster Environment Centre Lancaster University LA1 4YQ

From: Paul Smith notifications@github.com Sent: 02 July 2019 12:14 To: waternumbers/dynatopGIS dynatopGIS@noreply.github.com Cc: Kretzschmar, Ann a.kretzschmar@lancaster.ac.uk; Mention mention@noreply.github.com Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

What ever code you have loaded is an old version

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVSLRMONTFUKV2W6EUTP5M2ATA5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZA5MZQ#issuecomment-507631206, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVR4L6IY2BERQSK7DTLP5M2ATANCNFSM4H32LILA.

waternumbers commented 5 years ago

Great . It is really easy to get confused - if in doubt kill your r session and start again :) i do this multiple times a day....

octopusann commented 5 years ago

I've run both Swindale and Kent through dynatopGIS now and all seems to be well - will load into GIS to check later.

You've run your example using the data file Brompton.rda I need to construct data files for the Kent so I can do a test run but I have to admit to confusion over R data structures and lists and how to put it all together. If I'm understanding my notes correctly, we have the model generated by dynatopGIS and I also need a PET time series (can I get away with zeros just for now?) and gridded rainfall. We used a test period of November 2017 for Decipher so I'll do the same. I have a raster containing the the IDs of 262 stations over the catchment which tell us which gauge to use for which cell. Is that the correct format? (hope that makes sense)

Dr. Ann Kretzschmar

Lancaster Environment Centre

Lancaster University

LA1 4YQ

kretzsch@exchange.lancs.ac.ukmailto:kretzsch@exchange.lancs.ac.uk

octopusann@me.commailto:octopusann@me.com

mobile: 07775-968315


From: Paul Smith notifications@github.com Sent: 02 July 2019 12:40:33 To: waternumbers/dynatopGIS Cc: Kretzschmar, Ann; Mention Subject: Re: [waternumbers/dynatopGIS] devtools::github_install fails (#1)

Great . It is really easy to get confused - if in doubt kill your r session and start again :) i do this multiple times a day....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/waternumbers/dynatopGIS/issues/1?email_source=notifications&email_token=ADG6OVUGY7FWYM5E3IHHUNLP5M5DDA5CNFSM4H32LILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZA7OKA#issuecomment-507639592, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG6OVSIUO6KUMSWCKVPHULP5M5DDANCNFSM4H32LILA.