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

Remove aliases for NASIS columns, replace with physical column name #368

Closed
wants to merge 2 commits into from

Conversation

brownag
Copy link
Member

@brownag brownag commented Dec 10, 2024

Will close #242. Nearly time to rip off the band-aid. For now just a draft PR to facilitate testing.

This is a breaking change for many things that rely on soilDB to query NASIS. It can be difficult to explain to new soilDB users why some columns are aliased and others follow the data model. It will be good to rely on the defined physical column names and standard associated metadata for better parity with internal NASIS queries, web reports, and the official data model in general.

Removes the following aliases in use in fetchNASIS()- and fetchVegdata()-related functions.

Replacing with NASIS physical column name as follows:

  • site_id => usiteid
  • pedon_id => upedonid or assocuserpedonid (as needed)
  • describer => descname
  • vegplot_id => vegplotid
  • vegtransect_id => vegtransectid or vegtransectiid (as needed)
  • x_std => longstddecimaldegrees
  • y_std => latstddecimaldegrees
  • elev_field => elev
  • slope_field => slope
  • aspect_field => aspect
  • es_classifier => siteecositehistory.classifier (distinguished from classifier which is petaxhistory.classifier)
  • sand => sandtotest
  • silt => silttotest
  • clay => claytotest
  • genhz => dspcomplayerid

Aliases are still used for the foreign key columns that end in "ref" as many soilDB queries target multiple related tables, so it doesn't always make sense to include "ref" and users benefit from the shorter name e.g. peiid rather than peiidref

Affected code, projects, teaching materials:

  • STATS I and II book content ()
  • STATS I and II homework, exercises, demos (start with our "own" content, then move out from there)
  • soilReports (how about we take care of those reports we maintain)
  • NCSS tech tutorials (Dylan volunteers to do this)
  • misc. scripts on local machines
  • shiny apps ?

People to include in an email announcement:

  • Sharon Perone
  • Kevin Godsey
  • John Hammerly
  • Chad Ferguson
  • Alex Stum
  • Joe Brennan
  • Nate Roe
  • Shawn Salley
  • Jon Maynard
  • Emily Piche
  • Amanda Pennino

@dylanbeaudette
Copy link
Member

It is probably time. We should make sure that as many people as possible know about this as it is going to break a lot of code.

What is assocuserpedonid ?

@brownag
Copy link
Member Author

brownag commented Dec 11, 2024

What is assocuserpedonid ?

This is the "Associated User Pedon ID" in the Vegetation Plot table.

@dylanbeaudette
Copy link
Member

I suggest that we have a quick phone call to discuss, with at least Jay, Stephen, Andrew, and myself. I can set this up.

@brownag
Copy link
Member Author

brownag commented Dec 20, 2024

Closing this PR, but not deleting the branch, as PR will not be merged in this form.

#369 supersedes the commits on this branch. It introduces deprecation messages and duplicate columns to ease the transition to the suggested physical column names and will be part of the next CRAN release. A release some time after the next release will turn off the deprecation messages and remove all aliases.

In the meantime, the branch associated with this PR "remove-aliases" is useful for testing that one has found all of the aliases they need to replace. Install it for testing with:

remotes::install_github("ncss-tech/soilDB@remove-aliases", dependencies=FALSE)

@brownag brownag closed this Dec 20, 2024
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.

ensure soilDB uses NASIS/SDA column names at all times
2 participants