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

normal_input is failing. #118

Closed
CeresBarros opened this issue Dec 12, 2023 · 9 comments
Closed

normal_input is failing. #118

CeresBarros opened this issue Dec 12, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@CeresBarros
Copy link
Member

I think it might be because data downloads are not being triggered by data_check, given that length(c(list_gcm(), list_normal())) is >1 even when nothing has been downloaded.

❯ checking examples ... ERROR
  Running examples in 'climr-Ex.R' failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: downscale
  > ### Title: Downscale target rasters to points of interest
  > ### Aliases: downscale
  > 
  > ### ** Examples
  > 
  > 
  > xyz <- data.frame(lon = runif(10, -140, -106), lat = runif(10, 37, 61), elev = runif(10))
  > normal <- normal_input()
  Error: [rast] filename is empty. Provide a valid filename
  Execution halted
@CeresBarros CeresBarros added the bug Something isn't working label Dec 12, 2023
@kdaust
Copy link
Collaborator

kdaust commented Dec 12, 2023

Ah. normal_input is no longer used, as it was meant for the previous non-postgres version. So it should be removed. The replacement is normal_input_postgis. Since everything is now on postgis, should we rename the new version to 'normal_input`?

@CeresBarros
Copy link
Member Author

Since everything is now on postgis, should we rename the new version to 'normal_input`?

Yes, i think that's a good idea. Will address this ASAP

@CeresBarros
Copy link
Member Author

I'm still having issues running normal_input -- the problem is happening in the example of dowscale.

I've changed the example code to

xyz <- data.frame(lon = runif(10, -140, -106), lat = runif(10, 37, 61), elev = runif(10))
thebb <- get_bb(xyz) ##get bounding box based on input points
dbCon <- data_connect() 
normal <- normal_input(dbCon = dbCon, bbox = thebb, cache = TRUE)
gcm_input <- gcm_input(list_gcm()[3], list_ssp()[1], list_period()[2])
downscale(xyz, normal, gcm)
historic <- historic_input()
out <- downscale(xyz, normal, gcm = NULL, historic = historic, ppt_lr = FALSE)

yet this is failing:

> data_connect()
NULL
Warning message:
In value[[3L]](cond) :
  Error: connection to server at "146.190.244.244", port 5432 failed: Connection refused (0x0000274D/10061)
	Is the server running on that host and accepting TCP/IP connections?

Could not connect to database. Will try using cached data.

Could you help me get this example working?

@kdaust
Copy link
Collaborator

kdaust commented Dec 13, 2023

Ah yes - had some server issues yesterday where it crashed a few times. Should be back up and stable now - let me know if it's still being problematic!

@CeresBarros
Copy link
Member Author

Seems to be working now :)

@CeresBarros
Copy link
Member Author

@kdaust, did was gcm_input also deprecated in favour of gcm_input_postgis? if so what name do we keep?

@CeresBarros
Copy link
Member Author

CeresBarros commented Dec 13, 2023

Similarly, were list_period and list_years_ts deprecated in favour of list_gcm_period?

@kdaust
Copy link
Collaborator

kdaust commented Dec 13, 2023

Yes and yes - I think normal_input and gcm_input are the only ones with old versions. And I changed to list_gcm_period() because we also have historic periods, which is currently list_historic(), but should maybe be chaged to list_historic_period()?

@CeresBarros
Copy link
Member Author

fixed in #124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants