From 5956cd0cd25f0296b23b615c2aaa39356634e276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Sun, 24 May 2020 20:13:27 +0200 Subject: [PATCH] Update google colab setup in notebooks Undate save_all in grapher to make dest. folder if it doesn't exist --- crcard_graphs.ipynb | 5 +---- setup.py | 5 ++--- stree/Strees_grapher.py | 2 ++ test.ipynb | 5 +---- test2.ipynb | 5 +---- test_graphs.ipynb | 5 +---- 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/crcard_graphs.ipynb b/crcard_graphs.ipynb index 0914319..6b6f21f 100644 --- a/crcard_graphs.ipynb +++ b/crcard_graphs.ipynb @@ -9,10 +9,7 @@ "#\n", "# Google Colab setup\n", "#\n", - "#import os\n", - "#os.chdir(\"/content\")\n", - "#!git clone https://github.com/Doctorado-ML/STree.git\n", - "#os.chdir(\"/content/STree\")" + "#!pip install git+https://github.com/doctorado-ml/stree" ] }, { diff --git a/setup.py b/setup.py index 565362b..e0bbd04 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import setuptools -__version__ = "0.9rc1" +__version__ = "0.9rc2" __author__ = "Ricardo Montañana Gómez" def readme(): @@ -12,7 +12,7 @@ setuptools.setup( name='STree', version=__version__, license='MIT License', - description='a python interface to oblique decision tree implementations', + description='Oblique decision tree with svm nodes', long_description=readme(), long_description_content_type='text/markdown', packages=setuptools.find_packages(), @@ -34,7 +34,6 @@ setuptools.setup( 'matplotlib', 'ipympl' ], - data_files=[('data', ['data/.gitignore'])], test_suite="stree.tests", zip_safe=False ) diff --git a/stree/Strees_grapher.py b/stree/Strees_grapher.py index ac5241b..19d2516 100644 --- a/stree/Strees_grapher.py +++ b/stree/Strees_grapher.py @@ -164,6 +164,8 @@ class Stree_grapher(Stree): :type save_folder: str, optional """ self._check_fitted() + if not os.path.isdir(save_folder): + os.mkdir(save_folder) seq = 1 for node in self: node.save_hyperplane(save_folder=save_folder, diff --git a/test.ipynb b/test.ipynb index 34b87f3..06d52a1 100644 --- a/test.ipynb +++ b/test.ipynb @@ -9,10 +9,7 @@ "#\n", "# Google Colab setup\n", "#\n", - "#import os\n", - "#os.chdir(\"/content\")\n", - "#!git clone https://github.com/Doctorado-ML/STree.git\n", - "#os.chdir(\"/content/STree\")" + "#!pip install git+https://github.com/doctorado-ml/stree" ] }, { diff --git a/test2.ipynb b/test2.ipynb index 59962f7..9e088c5 100644 --- a/test2.ipynb +++ b/test2.ipynb @@ -9,10 +9,7 @@ "#\n", "# Google Colab setup\n", "#\n", - "#import os\n", - "#os.chdir(\"/content\")\n", - "#!git clone https://github.com/Doctorado-ML/STree.git\n", - "#os.chdir(\"/content/STree\")" + "#!pip install git+https://github.com/doctorado-ml/stree" ] }, { diff --git a/test_graphs.ipynb b/test_graphs.ipynb index 355f486..25c58b8 100644 --- a/test_graphs.ipynb +++ b/test_graphs.ipynb @@ -9,10 +9,7 @@ "#\n", "# Google Colab setup\n", "#\n", - "#import os\n", - "#os.chdir(\"/content\")\n", - "#!git clone https://github.com/Doctorado-ML/STree.git\n", - "#os.chdir(\"/content/STree\")" + "#!pip install git+https://github.com/doctorado-ml/stree" ] }, {