nptscot / npt

Data processing code, also use this repo for issue tracking for the Network Planning Tool. See https://nptscot.github.io for development version
https://www.npt.scot/
GNU Affero General Public License v3.0
5 stars 0 forks source link

add coherent funtion into targets #411

Closed wangzhao0217 closed 4 months ago

wangzhao0217 commented 4 months ago
wangzhao0217 commented 4 months ago

This error needs to be fixed:

Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: object 'all_city_coherent_networks_75' not found

Hi Robin, pls pull, this is not the latest

Robinlovelace commented 4 months ago

OK my bad. Will try with latest version.

Robinlovelace commented 4 months ago

Also don't have this file:

data-raw/combined_network_tile.geojson
Robinlovelace commented 4 months ago

I think

    for (city in names(all_city_coherent_networks)) {

Should be replaced with

    for (city in parameters$coherent_area) {
Robinlovelace commented 4 months ago

This would also work:

    for (city in names(coherent_network)) {

Note @wangzhao0217 the name of the target is the only thing that targets can 'see', not the name of objects within each object.

Robinlovelace commented 4 months ago

Looking good @wangzhao0217 only issue now is this:

✖ error target coherent_network
▶ end pipeline [3.081 hours]
Warning message:
15 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages. 
Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: Cannot open "inputdata/sg_intermediatezone_bdry_2011.gpkg"; The file doesn't seem to exist.

Maybe add the data as a release in inputdata if not already in there (I couldn't find it).

wangzhao0217 commented 4 months ago

Looking good @wangzhao0217 only issue now is this:

✖ error target coherent_network
▶ end pipeline [3.081 hours]
Warning message:
15 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages. 
Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: Cannot open "inputdata/sg_intermediatezone_bdry_2011.gpkg"; The file doesn't seem to exist.

Maybe add the data as a release in inputdata if not already in there (I couldn't find it).

Hi Robin, here is the release of all inputdata for CN: https://github.com/nptscot/npt/releases/tag/Coherent-inputdata

wangzhao0217 commented 4 months ago

Hi Robin There are 3 files required for coherent network: sg_intermediatezone_bdry_2011 = sf::st_read("inputdata/sg_intermediatezone_bdry_2011.gpkg") las_scotland_2023 = sf::st_read("inputdata/las_scotland_2023.geojson") can be downloaded from https://github.com/nptscot/npt/releases/tag/boundaries-2024

MasterMap = sf::st_read("inputdata/MasterMap_Scotland.geojson") I have shared this file with you on Team

wangzhao0217 commented 4 months ago

Looking good @wangzhao0217 only issue now is this:

✖ error target coherent_network
▶ end pipeline [3.081 hours]
Warning message:
15 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages. 
Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: Cannot open "inputdata/sg_intermediatezone_bdry_2011.gpkg"; The file doesn't seem to exist.

Maybe add the data as a release in inputdata if not already in there (I couldn't find it).

Hi Robin There are 3 files required for coherent network: sg_intermediatezone_bdry_2011 = sf::st_read("inputdata/sg_intermediatezone_bdry_2011.gpkg") las_scotland_2023 = sf::st_read("inputdata/las_scotland_2023.geojson") can be downloaded from https://github.com/nptscot/npt/releases/tag/boundaries-2024

MasterMap = sf::st_read("inputdata/MasterMap_Scotland.geojson") I have shared this file with you on Team

Robinlovelace commented 4 months ago

Now hitting this error after running tar_make():

▶ start target rs_commute_balanced
✖ error target coherent_network
▶ end pipeline [17.876 seconds]
Error:
! Error running targets::tar_make()
  Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
  Debugging guide: https://books.ropensci.org/targets/debugging.html
  How to ask for help: https://books.ropensci.org/targets/help.html
  Last error: the condition has length > 1
Robinlovelace commented 4 months ago

OK just did

git pull

now trying again.

Robinlovelace commented 4 months ago

https://github.com/nptscot/npt/assets/1825120/57311972-2dc6-4433-bc51-2df3ac66b318