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

fetchOSD series names should be checked within extended components #128

Closed
dylanbeaudette opened this issue Mar 20, 2020 · 1 comment
Closed

Comments

@dylanbeaudette
Copy link
Member

dylanbeaudette commented Mar 20, 2020

When asking for extended summaries there is no check to ensure that the set of series names present in the summaries match those in the SPC. This can occur in likely 2 scenarios:

  1. query for data outside of CONUS: climate summaries are empty data.frames
  2. query for data within CONUS, OSD morphology missing due to funky formatting or typos in the OSD

Case 2 is a problem for analysis expecting identical vectors of series names in both SPC and climate summaries. Examples:

  • Breadsprings: OSD parsed OK (2020-03-20), OSD hz data missing (2019-11-18)
  • Hagerwest: OSD parsed OK (2020-03-20), OSD hz data missing (2019-11-18)
  • Tintero: OSD parsed OK (2020-03-20), OSD hz data missing (2019-11-18)

These series are marked as inactive, thus removed before parsing. fetchOSD should perform some level of checking / reporting / filtering (?) when the extended data aren't consistent with the SPC.

The following will fail if only Breadsprings is specified, but returns an internally inconsistent set of objects if other series are included.

library(soilDB)

# report no data as expected
soils <- c('xxx')
x <- fetchOSD(soils, extended = TRUE)

# report no data as expected 
soils <- c('Breadsprings')
x <- fetchOSD(soils, extended = TRUE)

# works
soils <- c('amador')
x <- fetchOSD(soils, extended = TRUE)

# inconsistent SPC + extended data
soils <- c('cecil', 'Breadsprings')
x <- fetchOSD(soils, extended = TRUE)
dylanbeaudette added a commit that referenced this issue Mar 20, 2020
@dylanbeaudette
Copy link
Member Author

After some thought, fetchOSD should not fail in these cases but should issue a warning with a pointer to the manual page.

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

No branches or pull requests

1 participant