Closed HeatherGranger closed 4 years ago
I think the best way is to make sure the codes/variables are the same as the codes/variables in the limits reference table. Where is the current codes.csv and limits.csv?
Yes I agree with making the codes/variables the same as in the limits reference table.
The limits.csv doesn't exist anymore because the limits are pulled from
limits <- bcdata::bcdc_get_data(record = "85d3990a-ec0a-4436-8ebd-150de3ba0747")
The codes.csv file is in data-raw/codes.csv
.
The codes.csv file hasn't changed since 2017
❯ git log --follow data-raw/codes.csv
commit a91a953e815125ec0040df71e732a19cd3681e4f
Author: ateucher <andy.teucher@gov.bc.ca>
Date: Thu Jun 8 16:53:14 2017 -0700
Use Col.unit for colour units everywhere (#77)
commit 87dff6f4b27ececb1ea580e6e13c385e49774dc5
Author: Andy Teucher <andy.teucher@gov.bc.ca>
Date: Thu Mar 30 11:01:59 2017 -0700
Get codes from ems_codes, add Alkalanity pH 4.5/5.2
commit f37acb440251d29176b3b5744fcd8f6d9e1a1c9f
Author: joethorley <joe@poissonconsulting.ca>
Date: Fri Feb 3 08:04:25 2017 -0800
more variable codes plus coliforms and units
As far as I can determine at the this point codes serves two roles: 1) it provides EC_Codes for EMS_Codes and 2) it allows us to recognise variables that are missing from limits.csv.
@joethorley do you think the best way forward then, is for me to update the codes.csv with all the variables in the limits reference table? If so, what is the best way for me to get the subset of limits from data bc that are listed in the limits reference table? Other than me going through the databc guideline list and pulling out the aquatic life guidelines!
I'm starting to think we should simply add those codes with missing limits to limits and just used codes as a look up for EC_Codes vs EMS_Codes?
As per the Friday Aug 7th Heather/Joe chat - some variables we want to bring into the app and plot don't have limits. Manually adding variables/codes to codes.csv seems the best way to move forward at this time. Heather to test when @joethorley confirms wqbc
is ready.
@joethorley tested shinyrems with new variables added to codes.csv. 'Chlorophyll A' and 'Extinction Depth' not retained in Tidy tab. I re-installed the latest wqbc version before running shinyrems; is there something else I need to do?
I'll have a look this afternoon. Are your changes on a branch?
The updated codes.csv was added on the add-codes branch, which we merged into master last week. We were looking at limits-and-codes.R on our call to try and diagnose why the new codes weren't integrating. I believe that's where we left it.
@HeatherGranger - can you resolve this issue?
@joethorley No, I'm not sure where in limits-and-codes.R the issue is to ensure the codes.csv is being implemented in wqbc. Tested now and new variables in codes.csv are being removed in the tidy tab of shinyrems.
Sorry that was a confusing comment.
I meant can you resolve this issue: https://github.com/bcgov/wqbc/issues/150
Its holding things up
@joethorley Answered!
@joethorley One more thing on this - as we move forward and I discover other variables we've missed including in codes.csv, is the easiest thing just for me to add to codes.csv and push?
That is a good question - we should probably discuss what makes most sense as a workflow.
@joethorley looking to complete this issue before tomorrow afternoon. If @JessicaPenno needs to add variables to codes.csv, what is the best workflow for her?
bcgov/wqbc
codes.csv
in Excel and manually add variablesR/units.R
) let me know and I will update wqbc
to recognize them (will require user to pull master and merge into fork)data-raw/data-raw.R
line by line ensuring their are no errorsshinyrems
Thanks! @JessicaPenno these are the steps. I'll close this issue now.
Compare lookup_codes to variables. Errors in finding fecal coliforms, BOD etc. The codes may just pertain to what guidelines are being calculated. Likely expand list of codes to include all usual water quality parameters in EMS.