Skip to content

Adding in remaining maxent related functions and test scripts#13

Merged
hannahlowens merged 3 commits intohannahlowens:mainfrom
EmmalineSheahan:main
Sep 26, 2025
Merged

Adding in remaining maxent related functions and test scripts#13
hannahlowens merged 3 commits intohannahlowens:mainfrom
EmmalineSheahan:main

Conversation

@EmmalineSheahan
Copy link
Copy Markdown
Contributor

env_stack_transform is a function to convert a list of spatrasters where each list element is a variable and each layer is a depth into a list of spatrasters where each list element is a depth and each layer is a variable. partition_3D creates kfold and block partitions in 3D for training and validation, maxent_3D generates 3D ENMs using maxent, and threshold_3D creates thresholded 3D spatraster stacks.

… threshold_3D, and their respective test scripts, as well as modified test scripts for cleanDepth and depthMatch to make them match the format of the other test scripts
@hannahlowens hannahlowens self-requested a review September 25, 2025 13:07
@hannahlowens hannahlowens self-assigned this Sep 25, 2025
Copy link
Copy Markdown
Owner

@hannahlowens hannahlowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself looks good, but please add predicts to Imports in the Description file (I prefer alphabetically, so the packages are easier to review when making changes). Also, check your unit tests for cleanDepth. I'm seeing:

── Warning ('test-cleanDepth.R:25:1'): (code run outside of test_that()) ─────
[readValues] raster has no values
Backtrace:

  1. ├─base::sample(c(-4000:0), size = length(values(bath_data))) at test-cleanDepth.R:25:1
  2. │ └─base::sample.int(length(x), size, replace, prob)
  3. ├─terra::values(bath_data)
  4. └─terra::values(bath_data) at terra/R/Agenerics.R:388:50
  5. └─terra (local) .local(x, ...)
  6. ├─terra::readValues(...) at terra/R/values.R:94:9
    
  7. └─terra::readValues(...) at terra/R/Agenerics.R:382:58
    
  8.   └─terra (local) .local(x, ...)
    
  9.     └─terra:::messages(x, "readValues") at terra/R/values.R:59:9
    
  10.       └─terra:::warn(f, paste(unique(x@pntr$getWarnings()), collapse = "\n")) at terra/R/messages.R:19:25
    

…ackages in maxent_3D and threshold_3D to be alphabetical, and edited test-cleanDepth.R to remove warning message
@EmmalineSheahan
Copy link
Copy Markdown
Contributor Author

Gotcha, I just pushed a new commit with those things fixed!

@hannahlowens hannahlowens merged commit 1cbd6a8 into hannahlowens:main Sep 26, 2025
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants