-
Notifications
You must be signed in to change notification settings - Fork 27
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
model.base: improve NamespaceSet
#154
Commits on Oct 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 77e0f86 - Browse repository at this point
Copy the full SHA 77e0f86View commit details -
- Set
Entity.specific_asset_id
asIterable[SpecificAssetId]
, beca……use the spec has changed - Add check of constraint AASd-014 for Entity, see https://rwth-iat.github.io/aas-specs/AASiD/AASiD_1_Metamodel/index.html#Entity - Add check of constraint AASd-131 for AssetInformation, see https://rwth-iat.github.io/aas-specs/AASiD/AASiD_1_Metamodel/index.html#AssetInformation - Refactor de-/serialization of Entity - Refactor deserialization of AssetInformation because of check of constraint AASd-131
Configuration menu - View commit details
-
Copy full SHA for e1fffec - Browse repository at this point
Copy the full SHA e1fffecView commit details -
Refactor
check_entity_equal()
&check_asset_information_equal()
Add function for checking `Iterable[SpecificAssetId]`
Configuration menu - View commit details
-
Copy full SHA for 92e8618 - Browse repository at this point
Copy the full SHA 92e8618View commit details -
- Add globalAssetId for all `ÀssetInformation` - Fix Entity.specificAssetIds in test files
Configuration menu - View commit details
-
Copy full SHA for 0ed5d4f - Browse repository at this point
Copy the full SHA 0ed5d4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc66b2a - Browse repository at this point
Copy the full SHA bc66b2aView commit details
Commits on Oct 29, 2023
-
Use getter/setter decorators for global_asset_id
- Use getter/setter decorators for global_asset_id - Refactor `Entity.__init__`: use setter for `entity_type` and remove `_validate_asset_ids_for_entity_type()` from init because it will be called in `entity_type` setter - Add return type to some init funcs of abstract classes to calm down MyPy
Configuration menu - View commit details
-
Copy full SHA for 91bfe92 - Browse repository at this point
Copy the full SHA 91bfe92View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0386628 - Browse repository at this point
Copy the full SHA 0386628View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f8a731 - Browse repository at this point
Copy the full SHA 2f8a731View commit details
Commits on Nov 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for f537658 - Browse repository at this point
Copy the full SHA f537658View commit details -
Configuration menu - View commit details
-
Copy full SHA for 046ee15 - Browse repository at this point
Copy the full SHA 046ee15View commit details
Commits on Nov 4, 2023
-
model.base: fix
ConstrainedList.clear()
atomicityThe default inherited `clear()` implementation repeatedly deletes the last item of the list until the list is empty. If the last item can be deleted successfully, but an item in front of it that will be deleted later cannot, this makes `clear()` non-atomic. Thus, the `clear()` method is now overriden in an atomic way. Furthermore, the ConstrainedList atomicity test is fixed to correctly test for this as well.
Configuration menu - View commit details
-
Copy full SHA for 7a2e341 - Browse repository at this point
Copy the full SHA 7a2e341View commit details -
model.submodel: remove
_string_constraints
decorator fromEntity
This decorator silently overrides the `global_asset_id` property, resulting in the constraints not being checked properly.
Configuration menu - View commit details
-
Copy full SHA for ff31f45 - Browse repository at this point
Copy the full SHA ff31f45View commit details -
model.submodel: move
Entity.global_asset_id
string constraint check…… to setter This only needs to be checked if the `global_asset_id` changes.
Configuration menu - View commit details
-
Copy full SHA for 7ac9aa6 - Browse repository at this point
Copy the full SHA 7ac9aa6View commit details -
model.submodel: remove duplicate code in
Entity
`_validate_asset_ids_for_entity_type()` only needs to know whether there are `specific_asset_ids` or not. This can be represented by a boolean, allowing the delete hook of the `ConstrainedList` to make use of this function as well.
Configuration menu - View commit details
-
Copy full SHA for 4b8a7ae - Browse repository at this point
Copy the full SHA 4b8a7aeView commit details -
model.ass: add
_validate_asset_ids()
function toAssetInformation
Similar to `submodel.Entity`, this is done to reduce duplicate code.
Configuration menu - View commit details
-
Copy full SHA for 3dcf9ff - Browse repository at this point
Copy the full SHA 3dcf9ffView commit details -
model.{aas, submodel}: add set hook to `{AssetInformation, Entity}.sp…
…ecific_asset_id` Since `__setitem__` can be used to clear the list as well (e.g. `list[:] = ()`), the constraints need to be verified in this case as well.
Configuration menu - View commit details
-
Copy full SHA for b853160 - Browse repository at this point
Copy the full SHA b853160View commit details -
model.submodel: assign values correctly in
Entity.__init__
The attributes need to be assigned bypassing the setters because the setters try to access attributes that haven't been set yet for constraint validation. Only `global_asset_id` is set via the setter as a final constraint validation, and because `global_asset_id` is also constrained via a string constraint.
Configuration menu - View commit details
-
Copy full SHA for 39a8c48 - Browse repository at this point
Copy the full SHA 39a8c48View commit details -
model.{aas, submodel}: add getter/setter for `{AssetInformation, Enti…
…ty}.specific_asset_id` This prevents setting the attributes without verification of the constraints.
Configuration menu - View commit details
-
Copy full SHA for 6b3de29 - Browse repository at this point
Copy the full SHA 6b3de29View commit details -
model.submodel: verify constraints when
SpecificAssetIds
are added ……to `Entity` This adds an `item_add_hook` to the `specific_asset_id` `ConstrainedList`, which is called whenever a new item is added to the list. This is necessary because a co-managed `Entity` is not allowed to have specific asset ids, so it shouldn't be possible to add any in this case.
Configuration menu - View commit details
-
Copy full SHA for 47b2e47 - Browse repository at this point
Copy the full SHA 47b2e47View commit details -
model.{aas, submodel}: improve `{AssetInformation, Entity}.global_ass…
…et_id` type hints
Configuration menu - View commit details
-
Copy full SHA for 5e0f160 - Browse repository at this point
Copy the full SHA 5e0f160View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fb375d - Browse repository at this point
Copy the full SHA 6fb375dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f11c7f5 - Browse repository at this point
Copy the full SHA f11c7f5View commit details
Commits on Nov 7, 2023
-
Merge pull request #1 from rwth-iat/entityfix
improve `AssetInformation` and `Entity` constraint validation + add tests
Configuration menu - View commit details
-
Copy full SHA for f8a2bf6 - Browse repository at this point
Copy the full SHA f8a2bf6View commit details -
Refactor
Entity
andAssetInformation
- Refactor hook funcs param names - Set all private attributes, bypassing setters. - Place setting of `Entity._global_asset_id` ahead of `Entity._specific_asset_id` to set item_add_hook directly in the ConstrainedList initialization - Rename `Entity._validate_asset_ids_for_entity_type` to `Entity._validate_asset_ids` - Place check of `global_asset_id` value into `_validate_asset_ids` - Run `_validate_asset_ids` at the end of init
Configuration menu - View commit details
-
Copy full SHA for 9ed5704 - Browse repository at this point
Copy the full SHA 9ed5704View commit details -
Refactor
Entity
andAssetInformation
- Bundle check methods together at the end of classes - Extract validation of `global_asset_id` to `_validate_asset_ids()` - Rename `Entity._validate_asset_ids()` to `_validate_aasd_014` and `AssetInformation._validate_asset_ids()` to `_validate_aasd_131`, as the methods only validate these constraints and not all asset ids
Configuration menu - View commit details
-
Copy full SHA for 0222237 - Browse repository at this point
Copy the full SHA 0222237View commit details
Commits on Nov 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 130eb89 - Browse repository at this point
Copy the full SHA 130eb89View commit details -
- Refactored `NamespaceSet.add()` as too big - Extracted some methods, in particular `_execute_item_del_hook`. I used the method also in other places - As we check different constraints for uniqueness in the namespace, I defined ATTRIBUTES_CONSTRAINT_IDS. The dict will be used when throwing exception. The solution with the dict is temporary, we need other solution here.
Configuration menu - View commit details
-
Copy full SHA for a0184e5 - Browse repository at this point
Copy the full SHA a0184e5View commit details -
Fix of namespace and its tests
- Use correct constraint ids for each NamespaceSet in tests, use 000 if not constraint id is suitable
Configuration menu - View commit details
-
Copy full SHA for ddc425b - Browse repository at this point
Copy the full SHA ddc425bView commit details