Skip to content

Update test-associndex.R - #64

Open
aliciamontesinos wants to merge 2 commits into
EcologyR:mainfrom
aliciamontesinos:main
Open

Update test-associndex.R#64
aliciamontesinos wants to merge 2 commits into
EcologyR:mainfrom
aliciamontesinos:main

Conversation

@aliciamontesinos

Copy link
Copy Markdown
Collaborator

we have updated the test of associndex taking into account the last changes made in the function associndex relative to the argument "threshold_density".

we have updated the test of associndex taking into account the last changes made in the function associndex relative to the argument "threshold_density".

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates a test in tests/testthat/test-associndex.R to use threshold_density = "Weibull" and deletes another test checking user-provided thresholds. Feedback suggests updating the first test's description to accurately reflect the Weibull thresholding logic, and retaining the deleted test with a valid numeric threshold to preserve test coverage.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

I am having trouble creating individual review comments. Click here to see my feedback.

tests/testthat/test-associndex.R (62)

medium

The test has been updated to use threshold_density = "Weibull" to trigger the Weibull threshold estimation. However, the test description on line 56 still reads "associndex calcula threshold automáticamente". Since the threshold is now explicitly requested via "Weibull" rather than being calculated automatically (the default NULL behavior actually avoids thresholding), the test description should be updated to be more accurate, e.g., "associndex calcula threshold usando Weibull".

tests/testthat/test-associndex.R (68-79)

medium

Instead of completely deleting the test "associndex no calcula threshold si se proporciona", it is better to keep it and update the threshold_density value to a valid numeric limit (e.g., 0). Deleting the test entirely reduces test coverage for the scenario where a user-defined numeric threshold is provided.

# Test 7.- La función no calcula el thresold si se da

test_that("associndex no calcula threshold si se proporciona", {

  expect_no_message(
    associndex(Amoladeras_int, Amoladeras_cover,
               expand = "yes",
               rm_sp_no_cover = "allsp",
               threshold_density = 0)
  )

})

Change the tolerance to consider that the area estimated in m2 for canopy and open can differ in 1 m2 the most, as smaller differences can be due to rounding effects
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.

1 participant