Repository: AI-SDC/SACRO-ML (language: python)

Issue:
Remove underscore from data_preprocessing
Remove the underscore in the module name. Update all imports.


Discussion / hints:

Fix patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 89f29d4d..16a87846 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -35,7 +35,7 @@ Data Interface
  
 An example Python Notebook is available  `Here <https://github.com/jim-smith/GRAIMatter/blob/main/WP2/wrapper/wrapper-concept.ipynb>`_
  
-.. automodule:: data_preprocessing.datainterface
+.. automodule:: preprocessing.loaders
    :members:
 ```
 
@@ -131,6 +131,18 @@ It is possible to include images like this
     :alt: alternate text
 ```
 
+Generating docs locally
+=======================
+
+It is useful to be able to generate your docs locally (to check for bugs etc)
+
+In linux, navigate to the `docs` folder and then issue the command
+`make html`
+
+In windows, navigate to the `docs` folder than then issue the command
+`sphinx-build source _build`
+
+The generated html will be in the folder `docs/_build` and can be opened in any browser.
 
 
 
diff --git a/docs/source/attacks.rst b/docs/source/attacks.rst
index 65ade9ef..7944d622 100644
--- a/docs/source/attacks.rst
+++ b/docs/source/attacks.rst
@@ -1,7 +1,13 @@
 Attacks
 =======
 
-.. automodule:: metrics.py
-.. automodule:: mia_extremecase.py
-.. automodule:: worst_case_attack.py
-.. automodule:: report.py
+.. automodule:: attacks.metrics
+    :members:
+.. automodule:: attacks.mia_extremecase
+    :members:
+.. automodule:: attacks.worst_case_attack
+    :members:
+.. automodule:: attacks.report
+    :members:
+.. automodule:: attacks.likelihood_test
+    :members:
diff --git a/docs/source/datainterface.rst b/docs/source/datainterface.rst
deleted file mode 100644
index f0781fbb..00000000
--- a/docs/source/datainterface.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Data Interface
-================
-
-      
-.. automodule:: data_preprocessing.data_interface
-   :members:
-
diff --git a/docs/source/index.rst b/docs/source/index.rst
index e2d5ed78..474f434a 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -16,7 +16,7 @@ This is the class and function reference for safemodel.
    :caption: Contents:
    
    introduction
-   datainterface
+   preprocessing
    attacks
    safemodel
    safedecisiontree
diff --git a/docs/source/preprocessing.rst b/docs/source/preprocessing.rst
new file mode 100644
index 00000000..5381e267
--- /dev/null
+++ b/docs/source/preprocessing.rst
@@ -0,0 +1,8 @@
+
+Preprocessing
+================
+
+      
+.. automodule:: preprocessing.loaders
+   :members:
+
diff --git a/data_preprocessing/data_interface.py b/preprocessing/loaders.py
similarity index 99%
rename from data_preprocessing/data_interface.py
rename to preprocessing/loaders.py
index 36976c24..7704be50 100644
--- a/data_preprocessing/data_interface.py
+++ b/preprocessing/loaders.py
@@ -1,5 +1,5 @@
 '''
-data_interface.py
+loaders.py
 A set of useful handlers to pull in datasets common to the project and perform the appropriate
 pre-processing
 '''
diff --git a/safemodel/classifiers/__pycache__/__init__.cpython-39.pyc b/safemodel/classifiers/__pycache__/__init__.cpython-39.pyc
index 79a6d87d..6513fc58 100644
Binary files a/safemodel/classifiers/__pycache__/__init__.cpython-39.pyc and b/safemodel/classifiers/__pycache__/__init__.cpython-39.pyc differ
diff --git a/safemodel/classifiers/__pycache__/dp_svc.cpython-39.pyc b/safemodel/classifiers/__pycache__/dp_svc.cpython-39.pyc
index b0d6571b..8d577fde 100644
Binary files a/safemodel/classifiers/__pycache__/dp_svc.cpython-39.pyc and b/safemodel/classifiers/__pycache__/dp_svc.cpython-39.pyc differ
diff --git a/safemodel/classifiers/__pycache__/safedecisiontreeclassifier.cpython-39.pyc b/safemodel/classifiers/__pycache__/safedecisiontreeclassifier.cpython-39.pyc
index 8d3d1d08..9bf2f893 100644
Binary files a/safemodel/classifiers/__pycache__/safedecisiontreeclassifier.cpython-39.pyc and b/safemodel/classifiers/__pycache__/safedecisiontreeclassifier.cpython-39.pyc differ
diff --git a/safemodel/classifiers/__pycache__/safekeras.cpython-39.pyc b/safemodel/classifiers/__pycache__/safekeras.cpython-39.pyc
index 119df21d..a2e99845 100644
Binary files a/safemodel/classifiers/__pycache__/safekeras.cpython-39.pyc and b/safemodel/classifiers/__pycache__/safekeras.cpython-39.pyc differ
diff --git a/safemodel/classifiers/__pycache__/saferandomforestclassifier.cpython-39.pyc b/safemodel/classifiers/__pycache__/saferandomforestclassifier.cpython-39.pyc
index a0b9885a..2d209316 100644
Binary files a/safemodel/classifiers/__pycache__/saferandomforestclassifier.cpython-39.pyc and b/safemodel/classifiers/__pycache__/saferandomforestclassifier.cpython-39.pyc differ
diff --git a/safemodel/classifiers/__pycache__/safesvc.cpython-39.pyc b/safemodel/classifiers/__pycache__/safesvc.cpython-39.pyc
index 876dff0e..4c32f99a 100644
Binary files a/safemodel/classifiers/__pycache__/safesvc.cpython-39.pyc and b/safemodel/classifiers/__pycache__/safesvc.cpython-39.pyc differ
diff --git a/safemodel/classifiers/rf_binned_output_probs.py b/safemodel/classifiers/rf_binned_output_probs.py
index ae078c6e..3953c1b7 100644
--- a/safemodel/classifiers/rf_binned_output_probs.py
+++ b/safemodel/classifiers/rf_binned_output_probs.py
@@ -75,7 +75,7 @@ def original_predict_proba(self, X: np.ndarray) -> np.ndarray:
 
 if __name__ == '__main__':
     rr = RFNoiseOutput(noise_var=10)
-    from data_preprocessing.data_interface import get_data_sklearn
+    from preprocessing.loaders import get_data_sklearn
     X, y = get_data_sklearn('mimic2-iaccd')
     rr.fit(X.values, y.values.flatten())
 


Test patch:
diff --git a/tests/test_data_interface.py b/tests/test_data_interface.py
index 33f2626e..93da1dee 100644
--- a/tests/test_data_interface.py
+++ b/tests/test_data_interface.py
@@ -4,7 +4,7 @@
 
 import unittest
 import pandas as pd
-from data_preprocessing.data_interface import get_data_sklearn, UnknownDataset  # pylint: disable = import-error
+from preprocessing.loaders import get_data_sklearn, UnknownDataset  # pylint: disable = import-error
 
 
 class TestLoaders(unittest.TestCase):