From 272fc8fc56b04c6f6bc54ebbb95c8764b34c026b Mon Sep 17 00:00:00 2001
From: Alex <akreft@trineo.org>
Date: Wed, 15 Sep 2021 14:36:38 +0200
Subject: [PATCH] MAINT: Fix docstring

---
 src/caosdb/common/models.py | 48 +++++++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 13 deletions(-)

diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py
index bd28ca20..a6d085c1 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
-- 
GitLab