diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py index bd28ca20f9560e18b15e35a832b5bbf83c0ed300..a6d085c170a17722f53f51845e57e9411cb6a12b 100644 --- a/src/caosdb/common/models.py +++ b/src/caosdb/common/models.py @@ -349,19 +349,41 @@ class Entity(object): id, name, description, importance, inheritance, datatype, and unit. Any other keyword will be ignored right now. But that may change in the future. - @param property: An identifying parameter (name, id or abstract property). - @param value: The value of the new property. - @param Any other specification for this property. Accepted keywords: id, name, description, importance, inheritance, datatype, and unit. - @raise UserWarning: - If the first parameter is None then kwargs['id'] or kwargs['name'] must be defined and not be None. - Otherwise a UserWarning is raised. - - If the first parameter is an integer then it is interpreted as the id and kwargs['id'] must be - undefined or None. Otherwise a UserWarning is raised. - - If the first parameter is not None and neither an instance of Entity nor an integer it is - interpreted as the name and kwargs['name'] must be undefined or None. Otherwise a UserWarning is - raised. + Parameters + ---------- + property : int, str, Property, optional + An identifying parameter, by default None + value : int, str, Property, optional + The value of the new property, by default None + id : int, optional + Id of the property, by default None + name : str, optional + Name of the property, by default None + description : str, optional + Description of the property, by default None + datatype : str, optional + Datatype of the property, by default None + unit : str, optional + Unit of the property, by default None + importance :str, optional + Importance of the property, by default None + inheritance : str, optional + Inheritance of the property, by default None + + Returns + ------- + Entity + + Raises + ------ + UserWarning + If the first parameter is None then id or name must be defined and not be None. + UserWarning + If the first parameter is an integer then it is interpreted as the id and id must be + undefined or None. + UserWarning + If the first parameter is not None and neither an instance of Entity nor an integer it is + interpreted as the name and name must be undefined or None. """ pid = id