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

Communities and experiments #259

Open
oscgonfer opened this issue Sep 29, 2023 · 4 comments
Open

Communities and experiments #259

oscgonfer opened this issue Sep 29, 2023 · 4 comments

Comments

@oscgonfer
Copy link
Contributor

oscgonfer commented Sep 29, 2023

As mentioned, this idea has been there for a while, but this issue is to discuss potential integrations of a new concept in the data model for users: communities, and their relationships with devices: experiments

Communities: simply a group of users with a description and a name:

{
  "id": 123,
   "name": "Community of Santa Coloma",
   "description": "A group studying the impact of the new park in Santa Coloma in terms of PM2.5",
   "users":  [list of users],
   "experiments": [list of experiments],
   "tags": ??
  ...
  ???
}

Experiments: relationship between devices containing a set of readings and potential other links and metadata:

{
  "id": 1234,
  "name": "PM2.5 Summer test",
  "description": "...",
  "status": "active"
  "devices":
     [
       {"device_id": 12345,
        "from": "2023-09-12T00:00:00",
        "to": "now"},
      ...
     ]
}

Just adding some thoughts here. Maybe this can be discussed further for next year.

@oscgonfer
Copy link
Contributor Author

oscgonfer commented Jul 16, 2024

Updates on experiments model:

{
  "id": 1234,
  "name": "PM2.5 Summer test",
  "description": "...",
  "status": "active",
  "is_test": false,
  "start_date": "2024-05-03T21:00:01Z",
  "end_date": null,
  "devices":
     [
       12345,
       12346,
       12347
     ]
}

@timcowlishaw what do you think? I added the is_test flag.

@timcowlishaw
Copy link
Contributor

What values do we want for the "status" field @oscgonfer ?

@oscgonfer
Copy link
Contributor Author

Good question, I hadn't put much thought on it.

An experiment can be basically on-going or not (duh). Reasons for not on-going could be various: stalled, finalized... However, for the shake of simplicity I was thinking something along the lines of active, completed.

So, if we only have two options, then rather make it a boolean, and change status for active, and keep it simple.
Later on, we can think of a different business logic if needed.
What do you think?

@timcowlishaw
Copy link
Contributor

ok, changed "status" to an "active" boolean - the experiments part of this is in #343, but leaving the ticket open 'til we've tackled communities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants