-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #391 from ellisonbg/remove-notebooks
Remove tutorial notebooks
- Loading branch information
Showing
14 changed files
with
7 additions
and
8,088 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
|
||
|
||
import os | ||
import shutil | ||
from warnings import warn | ||
|
||
_msg = """ | ||
The Altair Jupyter notebooks have been moved to this repository: | ||
SRC_PATH = os.path.join( | ||
os.path.split(os.path.abspath(__file__) | ||
)[0], 'notebooks') | ||
|
||
DEST_PATH = './AltairTutorial' | ||
|
||
def copy_tutorial(overwrite=False): | ||
"""Copy the Altair tutorial notebooks into ./AltairTutorial.""" | ||
if os.path.isdir(DEST_PATH) and overwrite: | ||
print('Removing old tutorial directory: {}'.format(DEST_PATH)) | ||
shutil.rmtree(DEST_PATH, ignore_errors=True) | ||
if os.path.isdir(DEST_PATH): | ||
raise RuntimeError('{} already exists, run with overwrite=True to discard existing files'.format(DEST_PATH)) | ||
print('Copying notebooks into fresh tutorial directory: {}'.format(DEST_PATH)) | ||
shutil.copytree(SRC_PATH, DEST_PATH) | ||
https://github.com/altair-viz/altair_notebooks | ||
This repository has static versions of the notebooks and a live version deployed using binder. | ||
""" | ||
|
||
def tutorial(overwrite=False): | ||
"""Copy the Altair tutorial notebooks into ./AltairTutorial and show a link in the notebook.""" | ||
copy_tutorial(overwrite=overwrite) | ||
print('Click on the following notebooks to explore the tutorial:') | ||
from IPython.display import FileLinks, display | ||
display(FileLinks(DEST_PATH)) | ||
warn(_msg) |