pfmc-assessments / PacFIN.Utilities

R code to manipulate data from the PacFIN database for assessments
http://pfmc-assessments.github.io/PacFIN.Utilities
Other
7 stars 1 forks source link

PACFIN_SPECIES_CODE sometimes has spaces #98

Closed kellijohnson-NOAA closed 1 year ago

kellijohnson-NOAA commented 1 year ago

Describe the bug Sometimes, PACFIN_SPECIES_CODE has leading or trailing spaces. This only pertains to the BDS data.

To Reproduce e.g., " POP", " REX", "POP ", "REX "

Expected behavior All PACFIN_SPECIES_CODES should match the list given in their documentation.

Additional context @okenk this pertains to Rex Sole.

okenk commented 1 year ago

Do we need to do a new data pull, or is is the current data they have sufficient? They will likely do another pull closer to the data deadline anyway.

kellijohnson-NOAA commented 1 year ago

I am still working out some of the kinks in extracting the bds data but there are thousands of records for rex sole that were not previously provided because we were only searching for "REX". Hopefully, I will have it fixed by Monday early morning.

iantaylor-NOAA commented 1 year ago

Is this something that we can push back to PacFIN in the future as well? I appreciate keeping the data in raw form as much as possible, but this isn't raw, it's just typos that they should fix, right?

kellijohnson-NOAA commented 1 year ago

It is really a state thing not a PacFIN thing imo. And, unfortunately all states have REX with a space before or after so it will take a while to fix.

chantelwetzel-noaa commented 1 year ago

@kellijohnson-NOAA I don't know how you caught this but thank you!

kellijohnson-NOAA commented 1 year ago

The bds data will now search for " REX" or "REX " when a user supplies pacfin_species_code = "REX".

kellijohnson-NOAA commented 1 year ago

@okenk the new pull with the previously missing " REX" and "REX " bds data is on the network. Unfortunately, it still has a bug in it wrt the 2021 and 2022 data where there are duplicated records. California is looking into why some FISH_IDs are duplicated but it probably won't be fixed for at least a week or so.