feat(properties and taxonomy): add properties and taxonomy fields#205
feat(properties and taxonomy): add properties and taxonomy fields#205dusanparipovic wants to merge 8 commits into
Conversation
| ConstantData, | ||
| DataBase, | ||
| PortRef, | ||
| PortsConnection, |
| model=model, | ||
| id=id, | ||
| scenario_group=scenario_group, | ||
| properties=properties or {}, |
There was a problem hiding this comment.
{} because of mypy
| from gems.study.scenario_builder import ScenarioBuilder | ||
|
|
||
|
|
||
| def _resolve_properties_raw_to_dict( |
There was a problem hiding this comment.
@tbittar what do you think about this, do we wan't to put this here or to process parsing inside GemsViewBuilder ?
… implement corresponding unit test for YAML parsing
|
|
||
| class ModelSchema(ModifiedBaseModel): | ||
| id: str | ||
| taxonomy_category: Optional[str] = None # # Optional or mandatory,open question ? |
There was a problem hiding this comment.
@dusanparipovic @tbittar : I suggest optional for now in GemsPy ; yet mandatory in ViewBuilder.
|
@dusanparipovic: shouldn't we move the target branch to develop/ ? |
… taxonomy_category field
aoustry
left a comment
There was a problem hiding this comment.
Nice ! Can you also update the doc and the changelog ?
Yes no problem, sorry for late response Github doesn't show me comments for some reason... @aoustry |
…my category - Introduced optional `properties` for components in `system.yml`, allowing key/value pairs that are normalized into a dictionary. - Added optional `taxonomy-category` field for models in library YAML files, accessible via `ModelSchema.taxonomy_category`. - Updated documentation to reflect these changes and provided examples in the user guide.
- Updated documentation to replace "key" with "id" in the context of component properties in `system.yml`. - Adjusted test assertions to reflect the change from "key" to "id" for consistency with the updated documentation. - Ensured that error messages for duplicate properties also refer to "id" instead of "key".
| ### Added | ||
|
|
||
| --- | ||
| - **System components: `properties`** - introduces optional `properties` on components in `system.yml` (a list of `id`/`value` pairs). These are normalized into a `dict[str, str]` on the resolved `Component` (duplicate ids raise a `ValueError`). |
There was a problem hiding this comment.
Second sentence is directly connected to this.
Do we really want to put this parsing here or that parsing will be done inside GVB.
There was a problem hiding this comment.
@dusanparipovic @tbittar I guess that
- the field
propertiesshould also be added to Component ? (not only ComponentSchema). - the field
taxonomy-categoryshould also be added to Model? (not only ModelSchema).
No description provided.