From 9d979d577e9a4e27fea0de2f358552ca8dcb3eb1 Mon Sep 17 00:00:00 2001 From: Jakub Date: Mon, 7 Oct 2019 18:26:57 +0200 Subject: [PATCH] dropped get_filepaths from docs, added deprecation warning (#59) --- docs/conf.py | 2 +- docs/examples/code_snapshots.ipynb | 72 ------------------------------ docs/examples/examples_index.rst | 1 - neptunecontrib/api/utils.py | 8 ++++ setup.py | 2 +- 5 files changed, 10 insertions(+), 75 deletions(-) delete mode 100644 docs/examples/code_snapshots.ipynb diff --git a/docs/conf.py b/docs/conf.py index 5bb19f5..f726d2a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,7 +49,7 @@ # The short X.Y version version = '0.13' # The full version, including alpha/beta/rc tags -release = '0.13.4' +release = '0.13.5' # -- General configuration --------------------------------------------------- diff --git a/docs/examples/code_snapshots.ipynb b/docs/examples/code_snapshots.ipynb deleted file mode 100644 index 738ce4e..0000000 --- a/docs/examples/code_snapshots.ipynb +++ /dev/null @@ -1,72 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Snapshoting code\n", - "\n", - "Neptune keeps track of your `.git` commit to make sure you know on which code you ran your experiment.\n", - "But sometimes you don't want to commit everything and in those dirty, in between commit, situations you may want Neptune\n", - "to snapshot your code and save it with experiment.\n", - "\n", - "In that case you need to pass a list of files you want to snaphsot to the `upload_source_files` argument of `neptune.create_experiment` method.\n", - "We wrote a helper that lets you create this list getting all the names of files of certain extensions in your folder and subfolders." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import neptune\n", - "from neptunecontrib.api.utils import get_filepaths\n", - "\n", - "neptune.init('USER_NAME/PROJECT_NAME')\n", - "\n", - "with neptune.create_experiment(upload_source_files=get_filepaths(directory='.',extensions=['.py', '.yaml', '.yml'])):\n", - " neptune.set_property('code_snapshot','yes!')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now you can view your code snapshot in Neptune.\n", - "\n", - "Check [this example experiment](https://ui.neptune.ml/neptune-ml/credit-default-prediction/e/CRED-108/source-code?path=src%2Fmodels%2F&file=train_lgbm.py):\n", - " \n", - "![img](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/e08d47e0af278225142eaa849c86964adfa7abf0/code_snapshots.png)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/examples/examples_index.rst b/docs/examples/examples_index.rst index a4807c2..4d64d44 100644 --- a/docs/examples/examples_index.rst +++ b/docs/examples/examples_index.rst @@ -1,7 +1,6 @@ .. toctree:: Data versioning Interactive experiment run comparison - Code snapshoting Image directory snapshoting Hyper parameter comparison Log binary classification metrics diff --git a/neptunecontrib/api/utils.py b/neptunecontrib/api/utils.py index a54608c..e25e6ea 100644 --- a/neptunecontrib/api/utils.py +++ b/neptunecontrib/api/utils.py @@ -221,6 +221,14 @@ def get_filepaths(dirpath='.', extensions=None): neptune.send_metric('score', 0.97) """ + + msg = """get_filepaths() is deprecated. + Starting from neptune-client==4.9 you can pass ['**/*.py*', '**/*.yaml*', '**/*.yml*'] + to upload_source_files argument to upload all files with given extensions recursively. + Read more https://docs.neptune.ml/neptune-client/docs/project.html + """ + warnings.warn(msg, DeprecationWarning) + if not extensions: extensions = ['.py', '.yaml', 'yml'] files = [] diff --git a/setup.py b/setup.py index 9d55151..296c746 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def main(): setup( name='neptune-contrib', - version='0.13.4', + version='0.13.5', description='Neptune Python library contributions', author='neptune.ml', author_email='contact@neptune.ml',