Data Model
The openyieldtables library uses pydantic to model the data structure.
Raw Data
The underlying data is structured in a way that allows for easy access. The raw data is stored in CSV files and is loaded into the library using the provided models.
The CSV files are structured as follows:
-
yield_tables_meta.csv: Contains metadata about the available yield tables.id: The unique identifier of the yield table.title: The name/title of the yield table.country_codes: The ISO 3166-1 alpha-2 country codes of the countries the yield table is applicable to.type: The type of the yield table (e.g.dgz_100).source: The source of the yield table.link: A link to the source of the yield table or the yield table itself.yield_class_step: The step between the yield classes.age_step: The step between the ages.tree_type: The tree type:coniferousordeciduous.
-
yield_tables.csv: Contains the yield tables.id: The unique identifier of the yield table.yield_class: The yield class.age: The age in years.dominant_height: The dominant height in m.average_height: The average height in m.dbh: The diameter at breast height in cm.taper: The tree taper.trees_per_ha: The number of trees per hectare.basal_area: The basal area in m2.volume_per_ha: The volume per hectare in vfm.average_annual_age_increment: The average annual increment up to a certain age in volume per hectare vfm.total_growth_performance: The total growth performance in volume per hectare vfm.current_annual_increment: The current annual increment in volume per hectare vfm.mean_annual_increment: The mean annual increment in volume per hectare vfm.
Models
YieldTableMeta
Bases: BaseModel
Source code in openyieldtables/models/yieldtable.py
class YieldTableMeta(BaseModel):
id: int
title: str
country_codes: List[str]
type: Optional[str] = None
source: str
link: Optional[str] = None
yield_class_step: Optional[float] = None
age_step: Optional[int] = None
available_columns: List[str]
tree_type: TreeType
YieldClassRow
Bases: BaseModel
Source code in openyieldtables/models/yieldtable.py
class YieldClassRow(BaseModel):
age: int
dominant_height: Optional[float] = None
average_height: Optional[float] = None
dbh: Optional[float] = None
taper: Optional[float] = None
trees_per_ha: Optional[float] = None
basal_area: Optional[float] = None
volume_per_ha: Optional[float] = None
average_annual_age_increment: Optional[float] = None
total_growth_performance: Optional[float] = None
current_annual_increment: Optional[float] = None
mean_annual_increment: Optional[float] = None
YieldClass
Bases: BaseModel
Source code in openyieldtables/models/yieldtable.py
class YieldClass(BaseModel):
yield_class: Union[int, float]
rows: List[YieldClassRow]
YieldTableData
Bases: BaseModel
Source code in openyieldtables/models/yieldtable.py
class YieldTableData(BaseModel):
yield_classes: List[YieldClass]
YieldTable
Bases: YieldTableMeta
Source code in openyieldtables/models/yieldtable.py
class YieldTable(YieldTableMeta):
data: YieldTableData