Skip to content

Conversation

@jacob-a-brown
Copy link
Contributor

@jacob-a-brown jacob-a-brown commented May 19, 2025

  1. If there are multiple records keep the one with p code 70300 if it exists, otherwise keep the one with p code 70301 then 70303. If none of those are present raise an error
  2. If there is only a single record keep it regardless of the p code

Copy link

@chasetmartin chasetmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, looks good to me. Only one comment that does not relate to the code logic.

if record["ActivityStartDate"] == date
}
if len(date_records.items()) > 1:
if "70301" in date_records.keys():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! My only suggestion is to consider making your preferred USGSPCodes 70301 and 70303 a variable for reusability and ease of adding new ones, but that's not necessary for functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - that's a good practice. I've made the p codes variables in constants.py so that they can be used throughout (may need them in nwis eventually)

Copy link

@chasetmartin chasetmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, like we discussed, just considering adding record date to the log for removing duplicates.

@jacob-a-brown jacob-a-brown merged commit f1f9135 into pre-production May 21, 2025
3 checks passed
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.

3 participants