NewGraphEnvironment/fish_passage_elk_2022_reporting

Bull trout observation rows in habitat sheet step 2 are duplicated with burbot rows

Closed this issue · 8 comments

I thought I had addressed this a while ago. There's a mix up with the species codes. I know how to fix. Will update and close.

if there is a half quick way to fix things once and for all using fishbc::freshwaterfish vs wrangling the mucked up page from the submission template that woudl be preferred. you can view the tibble with

checkmeout <– fishbc::freshwaterfish

If there are ever issues with that tibble we can make PRs to the repo. There actually used to be an error with burbot but I made a PR that fixed it years ago

I'm not sure I understand why this error is happening in the first place. When doing the fish summaries we extract the species codes from the "Species Template Order" sheet from the template and cross ref with the fish we caught. When I look at the species code for burbot in that sheet it is correct (BB). So why is it turning it back to BT?

best to put a link to where the code is if we want to get to the bottom of it

would be good to know which objects the code is correct in and which ones it is switched wrong in

I just committed to a new branch, here's what I did for a quick fix that worked : https://github.com/Mateo9569/fish_passage_elk_2022_reporting/blob/a0320661f8cde3fcc209c8a5bc704efed7bb08af/scripts/01_prep_data/0100-extract-inputs.R#L888-L893. I see that before you were calling species_by_group instead of species_by_common_name. But the species_by_group sheet doesn't exist in the template. I looked back in the skeena 2021 repo and that sheet does exist. Did they update the templates this year?

they updated the template without changing the name of the file! classic.

If we wanted we could also do:

hab_fish_codes <- fishbc::freshwaterfish %>%
      select({just the columns we need})

and leave that sheet in the rearview

Cool, thanks. Glad I caught this now. That code was also in skeena and bulkley but I just ignored it because we never caught any bull trout. Good to know. I'll get a draft of the map done first and then I'll add that code in and close this.

fyi - there is a new version of the submssion template out as of Jan 15, 2023 and they fixed that error. Let's move to fishbc anyway though since it is wonderfully stable and properly version controlled.

this can probably be left in this repo but fixed in skeena since that repo has many more features and will likely be moved ahead. better off would be functions in fpr since it doesn't really matter in skeena either as there are no BB captured. For reference - whjen it is fixed...

hab_fish_codes <- habitat_confirmations %>%
  purrr::pluck("species_by_common_name") %>% ##changed from specie_by_common_name because BB burbot was wrong!!
  select(-step)

is in there twice. we need to be sure to do a search of hab_fish_codes to be sure it is called only once AND that the names of the columns used to facilitate the joins are called by their correct names as they are likley different that the excel spreadsheet