Rener Oliveira (Ubuntu WSL) 1 år sedan
förälder
incheckning
00ee9e6b7b
5 ändrade filer med 74 tillägg och 23 borttagningar
  1. 7 0
      docs/ciphertext.rst
  2. 1 0
      docs/conf.py
  3. 2 0
      docs/index.rst
  4. 7 0
      docs/plaintext.rst
  5. 57 23
      include/docstrings/cryptocontext_docs.h

+ 7 - 0
docs/ciphertext.rst

@@ -0,0 +1,7 @@
+Ciphertet
+=============
+
+.. autoclass:: openfhe.Ciphertext
+    :members:
+    :undoc-members:
+    :show-inheritance:

+ 1 - 0
docs/conf.py

@@ -42,6 +42,7 @@ extensions = [
     'sphinx.ext.autodoc',
     'sphinx.ext.autosummary',
     'sphinx.ext.intersphinx',
+    'sphinx.ext.napoleon'
 ]
 
 # Add any paths that contain templates here, relative to this directory.

+ 2 - 0
docs/index.rst

@@ -11,6 +11,8 @@ Welcome to OpenFHE - Python's documentation!
    :caption: Contents:
       
    cryptocontext
+   ciphertext
+   plaintext
 
 
 Indices and tables

+ 7 - 0
docs/plaintext.rst

@@ -0,0 +1,7 @@
+Plaintext
+=============
+
+.. autoclass:: openfhe.Plaintext
+    :members:
+    :undoc-members:
+    :show-inheritance:

+ 57 - 23
include/docstrings/cryptocontext_docs.h

@@ -1,11 +1,21 @@
 #ifndef CRYPTOCONTEXT_DOCSTRINGS_H
 #define CRYPTOCONTEXT_DOCSTRINGS_H
 
-const char* cc_SetKeyGenLevel_docs = R"doc(
+#include "pybind11/pybind11.h"
+#include "pybind11/attr.h"
+
+namespace py = pybind11;
+
+// const char* cc_docs = R"doc(
+//     test
+// )doc";
+// auto cc_docs2 = py::doc(cc_docs);
+
+const char* cc_SetKeyGenLevel_docs = R"pbdoc(
     Parameters:
     ----------
         level (int): the level to set the key generation to
-)doc";
+)pbdoc";
 
 const char* cc_GetKeyGenLevel_docs = R"doc(
     Get the level used for key generation
@@ -65,17 +75,27 @@ const char* cc_EvalRotateKeyGen_docs = R"doc(
 )doc";
 
 // MakeStringPlaintext
-const char* cc_MakeStringPlaintext_docs = R"doc(
-    MakeStringPlaintext constructs a StringEncoding in this context
+// const char* cc_MakeStringPlaintext_docs = R"pbdoc(
+//     MakeStringPlaintext constructs a StringEncoding in this context
 
-    Parameters:
-    ----------
-        str (str): the string to convert
+//     Parameters
+//     ----------
+//     str : str
+//         the string to convert
 
-    Returns:
-    ----------
-        Plaintext: plaintext
-)doc";
+//     Returns
+//     --------
+//     Plaintext
+//         plaintext
+// )pbdoc";
+
+const char* cc_MakeStringPlaintext_docs = R"pbdoc(
+    MakeStringPlaintext constructs a StringEncoding in this context
+
+    :param str: the string to convert
+    :type str: str
+    :return: plaintext
+)pbdoc";
 
 //MakePackedPlaintext
 const char* cc_MakePackedPlaintext_docs = R"doc(
@@ -277,18 +297,32 @@ const char* cc_Encrypt_docs = R"doc(
 )doc";
 
 //Decrypt
-const char* cc_Decrypt_docs = R"doc(
-    Decrypt a single ciphertext into the appropriate plaintext
-
-    Parameters:
-    ----------
-        ciphertext (Ciphertext): ciphertext to decrypt
-        privateKey (PrivateKey): decryption key
-
-    Returns:
-    ----------
-        Plaintext: decrypted plaintext
-)doc";
+const char* cc_Decrypt_docs = R"pbdoc(
+Decrypt a single ciphertext into the appropriate plaintext
+
+Parameters
+----------
+ciphertext : openfhe.Ciphertext
+    ciphertext to decrypt.
+privateKey : PrivateKey
+    decryption key.
+
+Returns
+-------
+openfhe.Plaintext
+    decrypted plaintext.
+)pbdoc";
+
+// const char* cc_Decrypt_docs = R"pbdoc(
+//     Decrypt a single ciphertext into the appropriate plaintext
+
+//     :param ciphertext: ciphertext to decrypt
+//     :type ciphertext: Ciphertext
+//     :param privateKey: decryption key
+//     :type privateKey: PrivateKey
+//     :return: decrypted plaintext
+//     :rtype: Plaintext
+// )pbdoc";
 
 //EvalAdd
 const char* cc_EvalAdd_docs = R"doc(