pecan icon indicating copy to clipboard operation
pecan copied to clipboard

Refactor Settings handling in soilgrids_ic_process()

Open divine7022 opened this issue 3 weeks ago • 3 comments

Description

soilgrids_ic_process() in modules/data.land/R/IC_SOILGRID_Utilities.R currently uses ad-hoc logic to handle Settings vs MultiSettings inputs.

  • it relies on checking element structure instead of proper type validation
  • inconsistent with PEcAn conventions (doesn't use is.Settings() / is.MultiSettings())

Proposed Refactor

  • normalize settings using proper type checking
  • extract site info from normalized settings
  • use PEcAn.settings::papply() for per-site IC generation

Tasks

  • [ ] update settings normalization to use is.Settings() / is.MultiSettings()
  • [ ] use papply() for per-site IC generation
  • [ ] update function documentation
  • [ ] update tests

Reference

See PEcAn XML Settings documentation for Settings/MultiSettings structure details.

divine7022 avatar Dec 06 '25 13:12 divine7022

Hi @divine7022, can I work on this issue? Could you assign it to me?

Shivang14d04 avatar Dec 06 '25 14:12 Shivang14d04

Hey @divine7022,

I’ve made the changes in the codebase, but I’m not seeing them reflected when I access the Pecan URL while running it via Docker. I tried to look in the pecan docs, but was unable to find anything related to this. Could you please clarify the recommended way to verify whether documentation or code changes are correctly applied in a Docker-based setup?

Shivang14d04 avatar Dec 09 '25 18:12 Shivang14d04

the link you opening seems to be to the web UI it's for running PEcAn workflows, so it won’t automatically reflect your code changes. I wouldn’t recommend you to go through the web portal, rather use notebook based demos to learn and get basic idea (demos)

but the easier way to test the function is through R or Rstudio, 1 ) checkout your branch locally 2 ) load module -- ( devtools::load_all("modules/data.land") ) 3 ) run function -- ( soilgrids_ic_process(...) ) 4 ) build document -- ( devtools::document("modules/data.land") ) 5 ) run tests -- ( testthat::test_dir("modules/data.land/tests/testthat") )

divine7022 avatar Dec 09 '25 21:12 divine7022

hi @divine7022 , is this issue still available to work on ? I'd like to work on it.

dibyajyoti-mandal avatar Dec 22 '25 16:12 dibyajyoti-mandal