Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure work - clear up site conditions vs site location #127

Closed
micah-prime opened this issue Sep 13, 2024 · 6 comments
Closed

Restructure work - clear up site conditions vs site location #127

micah-prime opened this issue Sep 13, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@micah-prime
Copy link
Contributor

We now have a Site belonging to a Campaign. Previously SiteData had a date AND location associated with weather, conditions, etc.

To maintain this info, we can change SiteData to SiteConditions and link that to the Site.

https://github.com/SnowEx/snowexsql/blob/dev/snowexsql/tables/site_data.py#L11
https://github.com/SnowEx/snowexsql/blob/dev/snowexsql/tables/site.py#L20

Site can have the location and SiteConditions can have date-specific conditions. Each point or pit can link to a SiteCondition, belonging to a Site, belonging to a Campaign.

FYI @micahjohnson150

@jomey
Copy link
Member

jomey commented Sep 19, 2024

erDiagram
  Campaign ||--|{ Site : "has many"
  Site ||--|| SiteCondition : "has one"
  Campaign
  Site {
    int campaign_id
    int site_condition_id
    String plot_id
    date site_visit
  }
  SiteCondition {
    int site_id
  }
Loading

@jomey
Copy link
Member

jomey commented Sep 19, 2024

I imagine all of these pit header fields going into the Site table

image

@micah-prime
Copy link
Contributor Author

I imagine all of these pit header fields going into the Site table

image

Yep, basically everything here https://github.com/SnowEx/snowexsql/blob/master/snowexsql/tables/site_data.py#L15-L28

@micah-prime
Copy link
Contributor Author

So I was initially under the impression that a site would not be date dependent unlike the pits. This was a misconception on my part.
Since Site == a pit, does it still make sense to split up the site condition into a separate table, or should we just keep the site conditions in the Site table?
@jomey

@jomey
Copy link
Member

jomey commented Oct 3, 2024

So I was initially under the impression that a site would not be date dependent unlike the pits. This was a misconception on my part. Since Site == a pit, does it still make sense to split up the site condition into a separate table, or should we just keep the site conditions in the Site table? @jomey

I guess we can keep these as attributes in the table. Can't think of a obvious reason and we can come back to this if needed.
Think the overview here seems to be the target for now.

@micah-prime
Copy link
Contributor Author

Sweet, I'll just consolidate for now then

micah-prime added a commit that referenced this issue Oct 3, 2024
@jomey jomey closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants