marineenergy / apps

shiny apps for marineenergy.app
https://marineenergy.github.io/apps/
MIT License
3 stars 1 forks source link

Pubs/Mgt error with Tidal, Collision, Fish #106

Closed bbest closed 2 years ago

bbest commented 2 years ago

From Grace:

I just came across this error. I had entered Tidal, Collision, Fish as tags. The error only occurs on the Management and Publications pages. All other pages look fine. Looks like an issue with the Tethys API?

image

bbest commented 2 years ago

When running Shiny app from https://rstudio.marineenergy.app:

Warning: Error in : Mapped vectors must have consistent lengths:
* `.x` has length 3
* `.y` has length 2
  119: map2_chr
  118: .f [/share/github/apps_dev/scripts/shiny_report.R#375]
  117: map
bbest commented 2 years ago

Ah whoops, I see now a problem with how we separately:

  1. Drop non-applicable tag categories, ie dropping Consequence.Collision tag from interactions querying Publications since this content type lacks the Consequence category; and

  2. Convert missing child tags to parents, ie converting Stressor.Noise.Underwater to Stressor.Noise with Publications since this content type only has the parent Noise tag.

We should be updating the interactions for every content type accordingly and spit out warnings for each. I think this will be best handled with something like a new get_content_tags() function that handles each case and updates the tags queried accordingly.

relevant functions

cdobbelaere commented 2 years ago

@bbest, It looks like the issue in displaying management/publications (as documented above) may be due to get_content_tag_categories("publications") returning character(0):

Screen Shot 2022-01-18 at 11 03 00 AM
bbest commented 2 years ago

fixed with https://github.com/marineenergy/apps/commit/d7cdcdf07c39a5c04983e25f5155df7cbcbf530f