rosemariafontana commited on
Commit
b803baf
·
verified ·
1 Parent(s): 2324b31

updated classes to have none

Browse files
Files changed (1) hide show
  1. schema_classes.py +51 -51
schema_classes.py CHANGED
@@ -3,28 +3,28 @@ from typing import List, Dict, Any, Optional, Literal, Union
3
  from enum import Enum
4
 
5
  # These are the necessary components that make up the Trials
6
- #class Variables(BaseModel):
7
- # controlled: List[str] = Field(..., title="Controlled Variables", description="A list of controlled variables, which will be constant (controlled) across all trials")
8
- # independent: List[str] = Field(..., title="Independent Variables", description="A list of independent variables (ie treatments), which will be intentionally varied across one or more trials")
9
- # outcome: List[str] = Field(..., title="Outcome Variables", description="A list of outcome variables (ie dependent or response variables)")
10
 
11
  class Treatment(BaseModel):
12
- name: str = Field(..., title="Name", description="The treatment name")
13
- description: str = Field(..., title="Description", description="The treatment description, including the conditions within this treatment")
14
- crops: List[str] = Field(..., title="Crops", description="A list of crops being tested in this treatment")
15
- fields: List[str] = Field(..., title="Fields", description="A list of fields in which this treatment has occured or will occur")
16
- #learnings: List[str] = Field(..., title="Learnings", description="A list of lessons learned from this experiment")
17
- #variables: Variables = Field(..., title="Variables", description="Variables (ie factors) in this experiment. Some variables are constant (controlled) and some will vary in order to learn something (independent)")
18
- #confoundingFactors: List[str] = Field(..., title="Confounding Factors", description="A list of factors which may impact the outcomes of the experiment that were not planned for")
19
 
20
  class Trial(BaseModel):
21
- name: str = Field(..., title="Name", description="The name of this trial")
22
- description: str = Field(..., title="Description", description="A description of this trial")
23
- treatments: List[Treatment] = Field(..., title="Treatments", description="A list of different treatments (strips or blocks with the same conditions applied) performed by the partner")
24
 
25
  class TrialLite(BaseModel):
26
- name: str = Field(..., title="Name", description="The name of this trial")
27
- description: str = Field(..., title="Description", description="A description of this trial")
28
 
29
  #################################################################################
30
 
@@ -36,21 +36,21 @@ class Role(str, Enum):
36
  OTHER = 'other'
37
 
38
  class Person(BaseModel):
39
- name: str = Field(..., title="Name", description="Name of this person")
40
- role: Role = Field(..., title="Role", description="Role of this person")
41
 
42
  class Interactions(BaseModel):
43
- people: List[Person] = Field(..., title="People", description="People involved or mentioned during interaction")
44
- date: str = Field(..., title="Date of current interaction", description="Date of the interaction")
45
- nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")
46
- nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")
47
- summary: str = Field(..., title="Summary", description="Summary of the interaction")
48
 
49
  class InteractionsLite(BaseModel):
50
- date: str = Field(..., title="Date of current interaction", description="Date of the interaction")
51
- nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")
52
- nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")
53
- summary: str = Field(..., title="Summary", description="Summary of the interaction")
54
 
55
  #################################################################################
56
 
@@ -95,42 +95,42 @@ class Structure(str, Enum):
95
  SILT = 'silt'
96
 
97
  class Log(BaseModel):
98
- convention: Convention = Field(..., title="Logs", description="This log's convention (i.e. this log's category or type)")
99
- date: str = Field(..., title="Date", description="Date the log (i.e. action of the activity or input) was performed")
100
- description: str = Field(..., title="Description", description="A description of the details of the log (i.e. details about farm activity performed")
101
 
102
  class Soil(BaseModel):
103
- description: str = Field(..., title="Description", description="A general description of the soil")
104
- structure: List[Structure] = Field(..., title="Structure", description="The structure of the soil using options from the major soil texture classes (sand, clay, silt)")
105
- biology: str = Field(..., title="Biology", description="Biological activity levels of the soil, including fluffiness, worms and bugs, and other evidence of soil biological activity")
106
 
107
  class Yield(BaseModel):
108
- quantity: str = Field(..., title="Quantity", description="A description of the total yield (harvested amount) from this planting, including units when available")
109
- quality: str = Field(..., title="Quality", description="The product quality of the harvest. For example, small or large fruits, sweet or tart flavor, easily molding or containing mold, high number of product seconds, etc.)")
110
 
111
  # It breaks if soil and yield aren't lists for some reason
112
  class Planting(BaseModel):
113
- name: str = Field(..., title="Name", description="The name of the planting")
114
- status: Status = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)")
115
- crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting")
116
- variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting")
117
- logs: List[Log] = Field(..., title="Logs", description="A list of all the logs that are associated with the farm activities")
118
- soil: List[Soil] = Field(..., title="Soil", description="A single soil profile for this planting, containing only one soil description")
119
- yield_: List[Yield] = Field(..., title="Yield", description="One set of quantitative and qualitative yield observations for this planting")
120
 
121
  class FarmActivities(BaseModel):
122
- name: str = Field(..., title="Name", description="The name of the agricultural field.")
123
- description: str = Field(..., title="Description", description="The description of the agricultural field.")
124
- plantings: List[Planting] = Field(..., title="Plantings", description="All of the plantings which have occurred on this field.")
125
 
126
  # These are extra for the modular approach (step-wise)
127
  class FarmActivitiesLite(BaseModel):
128
- name: str = Field(..., title="Name", description="The name of the agricultural field.")
129
- description: str = Field(..., title="Description", description="The description of the agricultural field.")
130
 
131
  class PlantingLite(BaseModel):
132
- name: str = Field(..., title="Name", description="The name of the planting")
133
- status: Status = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)")
134
- crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting")
135
- variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting")
136
 
 
3
  from enum import Enum
4
 
5
  # These are the necessary components that make up the Trials
6
+ class Variables(BaseModel):
7
+ controlled: Union[List[str], None] = Field(..., title="Controlled Variables", description="A list of controlled variables, which will be constant (controlled) across all trials")
8
+ independent: Union[List[str], None] = Field(..., title="Independent Variables", description="A list of independent variables (ie treatments), which will be intentionally varied across one or more trials")
9
+ outcome: Union[List[str], None] = Field(..., title="Outcome Variables", description="A list of outcome variables (ie dependent or response variables)")
10
 
11
  class Treatment(BaseModel):
12
+ name: Union[str, None] = Field(..., title="Name", description="The treatment name")
13
+ description: Union[str, None] = Field(..., title="Description", description="The treatment description, including the conditions within this treatment")
14
+ crops: Union[List[str], None] = Field(..., title="Crops", description="A list of crops being tested in this treatment")
15
+ fields: Union[List[str], None] = Field(..., title="Fields", description="A list of fields in which this treatment has occured or will occur")
16
+ learnings: Union[List[str], None] = Field(..., title="Learnings", description="A list of lessons learned from this experiment")
17
+ variables: Union[Variables, None] = Field(..., title="Variables", description="Variables (ie factors) in this experiment. Some variables are constant (controlled) and some will vary in order to learn something (independent)")
18
+ confoundingFactors: Union[List[str], None] = Field(..., title="Confounding Factors", description="A list of factors which may impact the outcomes of the experiment that were not planned for")
19
 
20
  class Trial(BaseModel):
21
+ name: Union[str, None] = Field(..., title="Name", description="The name of this trial")
22
+ description: Union[str, None] = Field(..., title="Description", description="A description of this trial")
23
+ treatments: Union[List[Treatment], None] = Field(..., title="Treatments", description="A list of different treatments (strips or blocks with the same conditions applied) performed by the partner")
24
 
25
  class TrialLite(BaseModel):
26
+ name: Union[str, None] = Field(..., title="Name", description="The name of this trial")
27
+ description: Union[str, None] = Field(..., title="Description", description="A description of this trial")
28
 
29
  #################################################################################
30
 
 
36
  OTHER = 'other'
37
 
38
  class Person(BaseModel):
39
+ name: Union[str, None] = Field(..., title="Name", description="Name of this person")
40
+ role: Union[Role, None] = Field(..., title="Role", description="Role of this person")
41
 
42
  class Interactions(BaseModel):
43
+ people: Union[List[Person], None] = Field(..., title="People", description="People involved or mentioned during interaction")
44
+ date: Union[str, None] = Field(..., title="Date of current interaction", description="Date of the interaction")
45
+ nextMeeting: Union[str, None] = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")
46
+ nextSteps: Union[List[str], None] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")
47
+ summary: Union[str, None] = Field(..., title="Summary", description="Summary of the interaction")
48
 
49
  class InteractionsLite(BaseModel):
50
+ date: Union[str, None] = Field(..., title="Date of current interaction", description="Date of the interaction")
51
+ nextMeeting: Union[str, None] = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")
52
+ nextSteps: Union[List[str], None] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")
53
+ summary: Union[str, None] = Field(..., title="Summary", description="Summary of the interaction")
54
 
55
  #################################################################################
56
 
 
95
  SILT = 'silt'
96
 
97
  class Log(BaseModel):
98
+ convention: Union[Convention, None] = Field(..., title="Logs", description="This log's convention (i.e. this log's category or type)")
99
+ date: Union[str, None] = Field(..., title="Date", description="Date the log (i.e. action of the activity or input) was performed")
100
+ description: Union[str, None] = Field(..., title="Description", description="A description of the details of the log (i.e. details about farm activity performed")
101
 
102
  class Soil(BaseModel):
103
+ description: Union[str, None] = Field(..., title="Description", description="A general description of the soil")
104
+ structure: Union[List[Structure], None] = Field(..., title="Structure", description="The structure of the soil using options from the major soil texture classes (sand, clay, silt)")
105
+ biology: Union[str, None] = Field(..., title="Biology", description="Biological activity levels of the soil, including fluffiness, worms and bugs, and other evidence of soil biological activity")
106
 
107
  class Yield(BaseModel):
108
+ quantity: Union[str, None] = Field(..., title="Quantity", description="A description of the total yield (harvested amount) from this planting, including units when available")
109
+ quality: Union[str, None] = Field(..., title="Quality", description="The product quality of the harvest. For example, small or large fruits, sweet or tart flavor, easily molding or containing mold, high number of product seconds, etc.)")
110
 
111
  # It breaks if soil and yield aren't lists for some reason
112
  class Planting(BaseModel):
113
+ name: Union[str, None] = Field(..., title="Name", description="The name of the planting")
114
+ status: Union[Status, None] = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)")
115
+ crop: Union[List[str], None] = Field(..., title="Crop", description="A list of the crops in this planting")
116
+ variety: Union[List[str], None] = Field(..., title="Variety", description="A list of the crop varieties in this planting")
117
+ logs: Union[List[Log], None] = Field(..., title="Logs", description="A list of all the logs that are associated with the farm activities")
118
+ soil: Union[List[Soil], None] = Field(..., title="Soil", description="A single soil profile for this planting, containing only one soil description")
119
+ yield_: Union[List[Yield], None] = Field(..., title="Yield", description="One set of quantitative and qualitative yield observations for this planting")
120
 
121
  class FarmActivities(BaseModel):
122
+ name: Union[str, None] = Field(..., title="Name", description="The name of the agricultural field.")
123
+ description: Union[str, None] = Field(..., title="Description", description="The description of the agricultural field.")
124
+ plantings: Union[List[Planting], None] = Field(..., title="Plantings", description="All of the plantings which have occurred on this field.")
125
 
126
  # These are extra for the modular approach (step-wise)
127
  class FarmActivitiesLite(BaseModel):
128
+ name: Union[str, None] = Field(..., title="Name", description="The name of the agricultural field.")
129
+ description: Union[str, None] = Field(..., title="Description", description="The description of the agricultural field.")
130
 
131
  class PlantingLite(BaseModel):
132
+ name: Union[str, None] = Field(..., title="Name", description="The name of the planting")
133
+ status: Union[Status, None] = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)")
134
+ crop: Union[List[str], None] = Field(..., title="Crop", description="A list of the crops in this planting")
135
+ variety: Union[List[str], None] = Field(..., title="Variety", description="A list of the crop varieties in this planting")
136