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

#226: Add support for rtc files #342

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8389051
feat Initial commit rtc files, generated from XsDate
RuudHurkmans Sep 23, 2022
11cf986
autoformat: isort & black
RuudHurkmans Sep 23, 2022
fcc69ce
#226: Update generated models with missing root model.
priscavdsluis Sep 23, 2022
2f010dd
#226: Remove factory for now.
priscavdsluis Sep 23, 2022
3c00fef
#226: Update rtcDataConfig/models.py and add corresponding JSON.
priscavdsluis Sep 26, 2022
7c70834
#226: Add initial serializer for a rtcDataConfig file. Serializer sho…
priscavdsluis Sep 26, 2022
18ded4c
#226: Cast values to strings in Serializer
priscavdsluis Sep 26, 2022
84c269d
#226: Add initial parser for a rtcDataConfig file. Parser should stil…
priscavdsluis Sep 26, 2022
a760d11
#226: Create an RtcBaseModel to try to move validation outside of gen…
priscavdsluis Sep 27, 2022
00852e0
#226: Refactor RtcBaseModel a little bit.
priscavdsluis Sep 27, 2022
7205a37
#226: Add rtcToolsConfig.json
priscavdsluis Sep 27, 2022
9e71187
#226: Move files around
priscavdsluis Sep 27, 2022
a3fe4bd
#226: Update generated models
priscavdsluis Sep 27, 2022
b1c309a
#226: Add `allow_population_by_field_name` as True to RtcBaseModel
priscavdsluis Sep 27, 2022
d59316a
#226: Remove `allow_population_by_field_name` from generated models
priscavdsluis Sep 27, 2022
48baac8
#226: Add auto-generated file for rtcRuntimeConfig
priscavdsluis Sep 27, 2022
7596eb8
#226: Update generated data
priscavdsluis Sep 27, 2022
07354c6
#226: Add temporary bat script.
priscavdsluis Sep 27, 2022
96696de
#226: Add temporary bat script.
priscavdsluis Sep 27, 2022
474622a
#226: Update namspaces
priscavdsluis Sep 27, 2022
82cdce1
#226: Update script
priscavdsluis Sep 27, 2022
0bc621e
#226: Update generated models.
priscavdsluis Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#226: Update generated models
  • Loading branch information
priscavdsluis committed Sep 27, 2022
commit a3fe4bd72c280c722a696b42acdba4a4efbd84f8
6 changes: 3 additions & 3 deletions hydrolib/core/io/rtc/rtcDataConfig/generated/_.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# generated by datamodel-codegen:
# filename: rtcDataConfig.json
# timestamp: 2022-09-27T13:10:33+00:00
# timestamp: 2022-09-27T13:22:03+00:00

from __future__ import annotations

from pydantic import BaseModel
from hydrolib.core.io.rtc.basemodel import RtcBaseModel

from . import RtcDataConfigComplexType


class RtcDataConfig(BaseModel):
class RtcDataConfig(RtcBaseModel):
class Config:
allow_population_by_field_name = True

55 changes: 28 additions & 27 deletions hydrolib/core/io/rtc/rtcDataConfig/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# generated by datamodel-codegen:
# filename: rtcDataConfig.json
# timestamp: 2022-09-27T13:10:33+00:00
# timestamp: 2022-09-27T13:22:03+00:00

from __future__ import annotations

from enum import Enum
from typing import Any, List, Optional, Union

from pydantic import BaseModel, Extra, Field
from hydrolib.core.io.rtc.basemodel import RtcBaseModel
from pydantic import Extra, Field

from . import _

@@ -23,42 +24,42 @@ class EnsembleModeEnumStringType(str, Enum):
INDEPENDENT = 'INDEPENDENT'


class ExternalBooleanSimpleTypeItem(BaseModel):
class ExternalBooleanSimpleTypeItem(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str = Field(..., regex='^([\\$][\\(-_a-z]+[\\$])$')


class ExternalBooleanSimpleType(BaseModel):
class ExternalBooleanSimpleType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: Union[bool, ExternalBooleanSimpleTypeItem]


class ExternalIntegerSimpleTypeItem(BaseModel):
class ExternalIntegerSimpleTypeItem(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str = Field(..., regex='^([\\$][\\(-_a-z]+[\\$])$')


class ExternalIntegerSimpleType(BaseModel):
class ExternalIntegerSimpleType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: Union[int, ExternalIntegerSimpleTypeItem]


class ExternalParameterSimpleTypeItem(BaseModel):
class ExternalParameterSimpleTypeItem(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str = Field(..., regex='^([#-\\$][\\(-_a-z]+[#-\\$])$')


class ExternalParameterSimpleType(BaseModel):
class ExternalParameterSimpleType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

@@ -92,14 +93,14 @@ class SeparatorEnumStringType(str, Enum):
__2 = ';'


class TimeSeriesSimpleType(BaseModel):
class TimeSeriesSimpleType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str = Field(..., min_length=1)


class TimeZoneSimpleType(BaseModel):
class TimeZoneSimpleType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

@@ -123,7 +124,7 @@ class VariableTypeEnumStringType(str, Enum):
TIMEINSTANCE = 'TIMEINSTANCE'


class DateType(BaseModel):
class DateType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

@@ -152,35 +153,35 @@ class TimeStepUnitEnumStringType(str, Enum):
week = 'week'


class TimeType(BaseModel):
class TimeType(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str = Field(..., regex='^([\\d][\\d]\\:[\\d][\\d]\\:[\\d][\\d])$')


class XsBoolean(BaseModel):
class XsBoolean(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: bool


class XsPositiveInteger(BaseModel):
class XsPositiveInteger(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: int = Field(..., ge=1)


class XsString(BaseModel):
class XsString(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: str


class CSVTimeSeriesFileComplexType(BaseModel):
class CSVTimeSeriesFileComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -190,7 +191,7 @@ class Config:
attr_delimiter: Optional[SeparatorEnumStringType] = None


class DateTimeComplexType(BaseModel):
class DateTimeComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -199,7 +200,7 @@ class Config:
attr_time: TimeType


class OpenMIExchangeItemComplexType(BaseModel):
class OpenMIExchangeItemComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -213,7 +214,7 @@ class Config:
unit: UnitEnumStringType = Field(..., description='Selection of supported units')


class PITimeSeriesExportFileComplexType(BaseModel):
class PITimeSeriesExportFileComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -228,7 +229,7 @@ class Config:
)


class PITimeSeriesImportFileComplexType(BaseModel):
class PITimeSeriesImportFileComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -242,7 +243,7 @@ class Config:
)


class TimeStepComplexType(BaseModel):
class TimeStepComplexType(RtcBaseModel):
"""
The timeunit element has three attributes, unit and devider and multiplier.
the unit is second, minute, hour, week, month year.
@@ -258,7 +259,7 @@ class Config:
attr_unit: TimeStepUnitEnumStringType


class PITimeSeriesComplexType(BaseModel):
class PITimeSeriesComplexType(RtcBaseModel):
"""
The header is used to specify the link to the location
and the contents
@@ -291,7 +292,7 @@ class Config:
)


class RtcTimeSeriesComplexType(BaseModel):
class RtcTimeSeriesComplexType(RtcBaseModel):
"""
The header is used to specify the link to the location
and the contents
@@ -314,7 +315,7 @@ class Config:
)


class RtcSeriesExportComplexType(BaseModel):
class RtcSeriesExportComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -327,7 +328,7 @@ class Config:
timeSeries: List[RtcTimeSeriesComplexType] = Field(..., min_items=1)


class RtcSeriesImportComplexType(BaseModel):
class RtcSeriesImportComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -336,7 +337,7 @@ class Config:
timeSeries: List[RtcTimeSeriesComplexType] = Field(..., min_items=1)


class RtcDataConfigComplexType(BaseModel):
class RtcDataConfigComplexType(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True
@@ -351,7 +352,7 @@ class Config:
)


class Model(BaseModel):
class Model(RtcBaseModel):
"""
JSON Schema generated by XMLSpy v2019 rel. 3 sp1 (x64) (http://www.altova.com)
"""
12 changes: 6 additions & 6 deletions hydrolib/core/io/rtc/rtcToolsConfig/generated/_.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# generated by datamodel-codegen:
# filename: rtcToolsConfig.json
# timestamp: 2022-09-27T13:06:58+00:00
# timestamp: 2022-09-27T13:24:09+00:00

from __future__ import annotations

from pydantic import BaseModel
from hydrolib.core.io.rtc.basemodel import RtcBaseModel

from . import RtcRtcToolsConfigComplexType
from . import RtcToolsConfigComplexType


class RtcRtcToolsConfig(BaseModel):
class RtcToolsConfig(RtcBaseModel):
class Config:
allow_population_by_field_name = True

__root__: RtcRtcToolsConfigComplexType
__root__: RtcToolsConfigComplexType


RtcRtcToolsConfig.update_forward_refs()
RtcToolsConfig.update_forward_refs()
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# generated by datamodel-codegen:
# filename: rtcToolsConfig.json
# timestamp: 2022-09-27T13:24:09+00:00

from __future__ import annotations

from typing import Optional

from hydrolib.core.io.rtc.basemodel import RtcBaseModel
from pydantic import Extra, Field

from ... import ExternalParameterSimpleType, XsBoolean


class Field1(RtcBaseModel):
class Config:
extra = Extra.forbid
allow_population_by_field_name = True

_: Optional[ExternalParameterSimpleType] = Field(None, alias='$')
attr_useAbsoluteAsSpillCap: Optional[XsBoolean] = None
Loading