Repository: great-expectations/great_expectations

Issue:
Use cleaner solution for non-truncating division in python 2
Prefer `from __future__ import division` to `1.*x/y`


Discussion:
Done inline during improve_partitions push.

Resolving patch:
diff --git a/great_expectations/render/renderer/site_builder.py b/great_expectations/render/renderer/site_builder.py
--- a/great_expectations/render/renderer/site_builder.py
+++ b/great_expectations/render/renderer/site_builder.py
@@ -131,6 +131,15 @@ def __init__(
                 plugins_directory, "custom_data_docs", "styles"
             )
 
+        # set custom_views_directory if present
+        custom_views_directory = None
+        if plugins_directory and os.path.isdir(
+            os.path.join(plugins_directory, "custom_data_docs", "views")
+        ):
+            custom_views_directory = os.path.join(
+                plugins_directory, "custom_data_docs", "views"
+            )
+
         if site_index_builder is None:
             site_index_builder = {"class_name": "DefaultSiteIndexBuilder"}
 
@@ -195,6 +204,7 @@ def __init__(
                     "data_context": data_context,
                     "target_store": self.target_store,
                     "custom_styles_directory": custom_styles_directory,
+                    "custom_views_directory": custom_views_directory,
                     "data_context_id": self.data_context_id,
                     "show_how_to_buttons": self.show_how_to_buttons,
                 },
@@ -217,6 +227,7 @@ def __init__(
             runtime_environment={
                 "data_context": data_context,
                 "custom_styles_directory": custom_styles_directory,
+                "custom_views_directory": custom_views_directory,
                 "show_how_to_buttons": self.show_how_to_buttons,
                 "target_store": self.target_store,
                 "site_name": self.site_name,
@@ -293,6 +304,7 @@ def __init__(
         target_store,
         source_store_name,
         custom_styles_directory=None,
+        custom_views_directory=None,
         show_how_to_buttons=True,
         run_name_filter=None,
         validation_results_limit=None,
@@ -338,7 +350,10 @@ def __init__(
         module_name = view.get("module_name") or module_name
         self.view_class = instantiate_class_from_config(
             config=view,
-            runtime_environment={"custom_styles_directory": custom_styles_directory},
+            runtime_environment={
+                "custom_styles_directory": custom_styles_directory,
+                "custom_views_directory": custom_views_directory,
+            },
             config_defaults={"module_name": module_name},
         )
         if not self.view_class:
@@ -458,6 +473,7 @@ def __init__(
         data_context,
         target_store,
         custom_styles_directory=None,
+        custom_views_directory=None,
         show_how_to_buttons=True,
         validation_results_limit=None,
         renderer=None,
@@ -505,7 +521,10 @@ def __init__(
         module_name = view.get("module_name") or module_name
         self.view_class = instantiate_class_from_config(
             config=view,
-            runtime_environment={"custom_styles_directory": custom_styles_directory},
+            runtime_environment={
+                "custom_styles_directory": custom_styles_directory,
+                "custom_views_directory": custom_views_directory,
+            },
             config_defaults={"module_name": module_name},
         )
         if not self.view_class:
diff --git a/great_expectations/render/view/view.py b/great_expectations/render/view/view.py
--- a/great_expectations/render/view/view.py
+++ b/great_expectations/render/view/view.py
@@ -55,8 +55,9 @@ class DefaultJinjaView(object):
 
     _template = NoOpTemplate
 
-    def __init__(self, custom_styles_directory=None):
+    def __init__(self, custom_styles_directory=None, custom_views_directory=None):
         self.custom_styles_directory = custom_styles_directory
+        self.custom_views_directory = custom_views_directory
 
     def render(self, document, template=None, **kwargs):
         self._validate_document(document)
@@ -80,6 +81,8 @@ def _get_template(self, template):
 
         if self.custom_styles_directory:
             loaders.append(FileSystemLoader(self.custom_styles_directory))
+        if self.custom_views_directory:
+            loaders.append(FileSystemLoader(self.custom_views_directory))
 
         env = Environment(
             loader=ChoiceLoader(loaders),


Test patch: