Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
  • 0.1.10
  • 0.1.5
  • 0.1.6
  • 0.1.7
  • 0.1.8
  • 0.1.9
  • 0.2.0
  • 0.2.1
  • 0.2.2
  • 0.2.3
  • 0.2.4
  • v0.5
  • v0.5.1
  • v0.5.2
  • v0.6.0
  • v0.6.1
  • v0.6.2
  • v0.6.3
  • v0.602
  • v0.9
21 results

Target

Select target project
  • VIPS/vipscore-python-common
1 result
Select Git revision
  • main
  • 0.1.10
  • 0.1.5
  • 0.1.6
  • 0.1.7
  • 0.1.8
  • 0.1.9
  • 0.2.0
  • 0.2.1
  • 0.2.2
  • 0.2.3
  • 0.2.4
  • v0.5
  • v0.5.1
  • v0.5.2
  • v0.6.0
  • v0.6.1
  • v0.6.2
  • v0.6.3
  • v0.602
  • v0.9
21 results
Show changes
Commits on Source (3)
......@@ -67,7 +67,7 @@ def get_dataframe_from_weather_observations(weather_observations: list, timezone
def get_result_list_from_dataframe(df: DataFrame):
"""
Create a list of VIPS Result objects from a dataframe
Requires timeseries as index and a column named WARNING_STATUS with INT values ranging from 0-4 (see Result class)
Requires timeseries as index and a column named WARNING_STATUS with INT values ranging from 0-4 (see entities.Result class)
"""
result_list = []
dictframe = df.to_dict(orient="index")
......
......@@ -25,7 +25,7 @@ along with VIPSCore-Python-Common. If not, see <http://www.nibio.no/licenses/>.
from datetime import datetime
from shapely.geometry import Point, Polygon
from pydantic import BaseModel, validator, constr, Field
from typing import Any, Union, ClassVar, Optional
from typing import Any, ClassVar, Optional
import pytz
class Result(BaseModel):
......@@ -33,7 +33,7 @@ class Result(BaseModel):
Represents a set of DSS model result values for a given point in space (Point, Polygon, MultiPolygon) and time (Period or immediate)
"""
valid_time_start: datetime = Field(alias="validTimeStart")
valid_time_end: Optional[datetime] = Field(alias="validTimeStart")
valid_time_end: Optional[datetime] = Field(alias="validTimeEnd")
valid_geometry: Optional[Any] = Field(alias="validGeometry")
warning_status: int = Field(alias="warningStatus")
all_values: dict = Field(alias="allValues")
......@@ -73,8 +73,11 @@ class Result(BaseModel):
class ModelConfiguration(BaseModel):
"""All the input data for the model."""
model_id: constr(min_length=10, max_length=10)
config_parameters: dict
model_id: constr(min_length=10, max_length=10) = Field(alias="modelId")
config_parameters: dict = Field(alias="configParameters")
class Config:
allow_population_by_field_name = True
# Can we do this and still serialize the object??
def get_config_parameter_as_date(self, param_name: str, required=True) -> datetime:
......