Spaces:
Build error
Build error
updated classes to have none
Browse files2 unmodified lines34567891011121314151617181920212223242526272829305 unmodified lines36373839404142434445464748495051525354555638 unmodified lines95969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351362 unmodified linesfrom enum import Enum# These are the necessary components that make up the Trials#class Variables(BaseModel):# controlled: List[str] = Field(..., title="Controlled Variables", description="A list of controlled variables, which will be constant (controlled) across all trials")# 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")# outcome: List[str] = Field(..., title="Outcome Variables", description="A list of outcome variables (ie dependent or response variables)")class Treatment(BaseModel):name: str = Field(..., title="Name", description="The treatment name")description: str = Field(..., title="Description", description="The treatment description, including the conditions within this treatment")crops: List[str] = Field(..., title="Crops", description="A list of crops being tested in this treatment")fields: List[str] = Field(..., title="Fields", description="A list of fields in which this treatment has occured or will occur")#learnings: List[str] = Field(..., title="Learnings", description="A list of lessons learned from this experiment")#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)")#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")class Trial(BaseModel):name: str = Field(..., title="Name", description="The name of this trial")description: str = Field(..., title="Description", description="A description of this trial")treatments: List[Treatment] = Field(..., title="Treatments", description="A list of different treatments (strips or blocks with the same conditions applied) performed by the partner")class TrialLite(BaseModel):name: str = Field(..., title="Name", description="The name of this trial")description: str = Field(..., title="Description", description="A description of this trial")#################################################################################5 unmodified linesOTHER = 'other'class Person(BaseModel):name: str = Field(..., title="Name", description="Name of this person")role: Role = Field(..., title="Role", description="Role of this person")class Interactions(BaseModel):people: List[Person] = Field(..., title="People", description="People involved or mentioned during interaction")date: str = Field(..., title="Date of current interaction", description="Date of the interaction")nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")summary: str = Field(..., title="Summary", description="Summary of the interaction")class InteractionsLite(BaseModel):date: str = Field(..., title="Date of current interaction", description="Date of the interaction")nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")summary: str = Field(..., title="Summary", description="Summary of the interaction")#################################################################################38 unmodified linesSILT = 'silt'class Log(BaseModel):convention: Convention = Field(..., title="Logs", description="This log's convention (i.e. this log's category or type)")date: str = Field(..., title="Date", description="Date the log (i.e. action of the activity or input) was performed")description: str = Field(..., title="Description", description="A description of the details of the log (i.e. details about farm activity performed")class Soil(BaseModel):description: str = Field(..., title="Description", description="A general description of the soil")structure: List[Structure] = Field(..., title="Structure", description="The structure of the soil using options from the major soil texture classes (sand, clay, silt)")biology: str = Field(..., title="Biology", description="Biological activity levels of the soil, including fluffiness, worms and bugs, and other evidence of soil biological activity")class Yield(BaseModel):quantity: str = Field(..., title="Quantity", description="A description of the total yield (harvested amount) from this planting, including units when available")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.)")# It breaks if soil and yield aren't lists for some reasonclass Planting(BaseModel):name: str = Field(..., title="Name", description="The name of the planting")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)")crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting")variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting")logs: List[Log] = Field(..., title="Logs", description="A list of all the logs that are associated with the farm activities")soil: List[Soil] = Field(..., title="Soil", description="A single soil profile for this planting, containing only one soil description")yield_: List[Yield] = Field(..., title="Yield", description="One set of quantitative and qualitative yield observations for this planting")class FarmActivities(BaseModel):name: str = Field(..., title="Name", description="The name of the agricultural field.")description: str = Field(..., title="Description", description="The description of the agricultural field.")plantings: List[Planting] = Field(..., title="Plantings", description="All of the plantings which have occurred on this field.")# These are extra for the modular approach (step-wise)class FarmActivitiesLite(BaseModel):name: str = Field(..., title="Name", description="The name of the agricultural field.")description: str = Field(..., title="Description", description="The description of the agricultural field.")class PlantingLite(BaseModel):name: str = Field(..., title="Name", description="The name of the planting")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)")crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting")variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting")2 unmodified lines34567891011121314151617181920212223242526272829305 unmodified lines36373839404142434445464748495051525354555638 unmodified lines95969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351362 unmodified linesfrom enum import Enum# These are the necessary components that make up the Trialsclass Variables(BaseModel):controlled: Union[List[str], None] = Field(..., title="Controlled Variables", description="A list of controlled variables, which will be constant (controlled) across all trials")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")outcome: Union[List[str], None] = Field(..., title="Outcome Variables", description="A list of outcome variables (ie dependent or response variables)")class Treatment(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The treatment name")description: Union[str, None] = Field(..., title="Description", description="The treatment description, including the conditions within this treatment")crops: Union[List[str], None] = Field(..., title="Crops", description="A list of crops being tested in this treatment")fields: Union[List[str], None] = Field(..., title="Fields", description="A list of fields in which this treatment has occured or will occur")learnings: Union[List[str], None] = Field(..., title="Learnings", description="A list of lessons learned from this experiment")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)")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")class Trial(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of this trial")description: Union[str, None] = Field(..., title="Description", description="A description of this trial")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")class TrialLite(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of this trial")description: Union[str, None] = Field(..., title="Description", description="A description of this trial")#################################################################################5 unmodified linesOTHER = 'other'class Person(BaseModel):name: Union[str, None] = Field(..., title="Name", description="Name of this person")role: Union[Role, None] = Field(..., title="Role", description="Role of this person")class Interactions(BaseModel):people: Union[List[Person], None] = Field(..., title="People", description="People involved or mentioned during interaction")date: Union[str, None] = Field(..., title="Date of current interaction", description="Date of the interaction")nextMeeting: Union[str, None] = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")nextSteps: Union[List[str], None] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")summary: Union[str, None] = Field(..., title="Summary", description="Summary of the interaction")class InteractionsLite(BaseModel):date: Union[str, None] = Field(..., title="Date of current interaction", description="Date of the interaction")nextMeeting: Union[str, None] = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction")nextSteps: Union[List[str], None] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction")summary: Union[str, None] = Field(..., title="Summary", description="Summary of the interaction")#################################################################################38 unmodified linesSILT = 'silt'class Log(BaseModel):convention: Union[Convention, None] = Field(..., title="Logs", description="This log's convention (i.e. this log's category or type)")date: Union[str, None] = Field(..., title="Date", description="Date the log (i.e. action of the activity or input) was performed")description: Union[str, None] = Field(..., title="Description", description="A description of the details of the log (i.e. details about farm activity performed")class Soil(BaseModel):description: Union[str, None] = Field(..., title="Description", description="A general description of the soil")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)")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")class Yield(BaseModel):quantity: Union[str, None] = Field(..., title="Quantity", description="A description of the total yield (harvested amount) from this planting, including units when available")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.)")# It breaks if soil and yield aren't lists for some reasonclass Planting(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of the planting")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)")crop: Union[List[str], None] = Field(..., title="Crop", description="A list of the crops in this planting")variety: Union[List[str], None] = Field(..., title="Variety", description="A list of the crop varieties in this planting")logs: Union[List[Log], None] = Field(..., title="Logs", description="A list of all the logs that are associated with the farm activities")soil: Union[List[Soil], None] = Field(..., title="Soil", description="A single soil profile for this planting, containing only one soil description")yield_: Union[List[Yield], None] = Field(..., title="Yield", description="One set of quantitative and qualitative yield observations for this planting")class FarmActivities(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of the agricultural field.")description: Union[str, None] = Field(..., title="Description", description="The description of the agricultural field.")plantings: Union[List[Planting], None] = Field(..., title="Plantings", description="All of the plantings which have occurred on this field.")# These are extra for the modular approach (step-wise)class FarmActivitiesLite(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of the agricultural field.")description: Union[str, None] = Field(..., title="Description", description="The description of the agricultural field.")class PlantingLite(BaseModel):name: Union[str, None] = Field(..., title="Name", description="The name of the planting")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)")crop: Union[List[str], None] = Field(..., title="Crop", description="A list of the crops in this planting")variety: Union[List[str], None] = Field(..., title="Variety", description="A list of the crop varieties in this planting")
schema_classes.py+51-51