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

Misc fixes found when running package checks on newer releases of R #3237

Merged
merged 44 commits into from
Feb 21, 2024

Conversation

infotroph
Copy link
Member

Description

Motivation and Context

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@infotroph infotroph mentioned this pull request Nov 30, 2023
13 tasks
@@ -30,7 +30,7 @@ mcmc.list2init <- function(dat) {

## define variables
ic <- list()
n <- nrow(dat[[1]])
nr <- nrow(dat[[1]])
Copy link
Member

Choose a reason for hiding this comment

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

surprised this was not found earlier.

Copy link
Member Author

Choose a reason for hiding this comment

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

Me too! It looks like the typo ought to make this function return all samples instead of just the last ones, which seems like it ought to be pretty obvious. And yet...!

@infotroph

This comment was marked as outdated.

@mdietze
Copy link
Member

mdietze commented Jan 17, 2024

@infotroph there are merge conflicts that need to be resolved in order to pull this one in

@infotroph

This comment was marked as outdated.

R CMD check complains that data directory is large and that json is a type not allowed in data/.
Moved ecoregion JSONs to inst/extdata; resaved BADM.csv (2 MB) as BADM.rda (74 KB!)
It is not used in this package or elsewhere, so does not need to be installed with
the package (especially since it weighs >2 MB and triggers check warnings about installed
package size.)
@@ -12,6 +12,6 @@ generalized_plate_model <- function(k, refractive, N) {
length(N) == 1
)
RT <- matrix(0, 2101, 2)
outlist <- .Fortran("gpm", k, refractive, N, RT)
outlist <- .Fortran("gpm", k, refractive, N, RT, PACKAGE="PEcAnRTM")
Copy link
Member Author

Choose a reason for hiding this comment

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

@ashiklom are you still lurking in the PEcAn world? Would it be possible to get your eyes on this commit?
TL;DR: Does this patch look OK to you?

This is a proposed fix for intermittent test failures from RTM that have me puzzled for three reasons:

  1. Tests are only failing on R 4.2, not on older or newer R versions.
  2. Failure is traceable to .Fortran calls to foursail sometimes, but not always, returning NaNs. Repeated calls with the same input fail maybe 2/3 of the time but succeed often enough to make me nervous.
  3. Adding the PACKAGE argument to each .Fortran call seems to fix it, which would seem to imply some kind of namespace collision... but I don't know what other package would contain a foursail symbol or why symbol lookup would behave nondeterministically from one invocation to another.

@infotroph
Copy link
Member Author

All checks are passing, so I'll merge this today unless anyone speaks up before then.

Substantive changes since the last review:

  • Reorganized, resaved, and documented datasets in data.land, and made package data be lazy-loaded.
  • CI checks now ignore timestamps printed by newer versions of R CMD check
  • include PACKAGE argument in all .Fortran calls from RTM, fixing a test failure that only happens on R 4.2

@infotroph infotroph added this pull request to the merge queue Feb 21, 2024
Merged via the queue into PecanProject:develop with commit 6b22467 Feb 21, 2024
12 checks passed
@infotroph infotroph deleted the check-on-newer-R branch March 2, 2024 06:13
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.

4 participants