From 1421083c27eb227bc8e5758c1e9bf0ce3cb709da Mon Sep 17 00:00:00 2001 From: Adam Fekete <adam.fekete@kcl.ac.uk> Date: Fri, 31 Jan 2020 13:12:13 +0000 Subject: [PATCH] sample structure --- README.md | 19 +++++++++++++++++++ assets/.gitignore | 4 ++++ data/.gitignore | 4 ++++ metainfo.json | 39 +++++++++++++++++++++++++++++++++++++++ setup.py | 17 +++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 assets/.gitignore create mode 100644 data/.gitignore create mode 100644 metainfo.json create mode 100644 setup.py diff --git a/README.md b/README.md index fe5ee6e..3f6eb6f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ # analytics-tutorial-template +This repository contains a skeleton of a tutorial with all of the templates. + +To create/integrate a new tutorial there are a few requirements that has to be fulfilled. +Each tutorial has to have a to be installable. + +File structure af a tutorial: +- `metainfo.json`: contains some data about the tutorial. This file is used to update the information on the website. The same data can be used for the python packeage as well. +- `setup.py`: provides an easy way to access any code available in the python environments. Most importantly it should contain all of the dependencies of the tutorial +- `data`: folder that stores all the data required in this folder. +- `assets`: folder for storing any additional materials (logos, figure, etc.) + +Please note that during the deployment these folders (`data`, `assets`) from other tutorials will be merged so if you want to be on the safe side you can use sub-folders as well. + + + +## Notes + +- More information about the python `setup.py` file: https://docs.python.org/3/distutils/setupscript.html +- `json` vs. `yaml`: Yaml looks nicer but currently only the json format is supported natively by Python. \ No newline at end of file diff --git a/assets/.gitignore b/assets/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/assets/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/metainfo.json b/metainfo.json new file mode 100644 index 0000000..dbc4bba --- /dev/null +++ b/metainfo.json @@ -0,0 +1,39 @@ +{ + "authors": [ + "John, Doe", + "Bob, Alice", + ], + "email": "user@domain.com", + "title": "Title of the tutorial", + "description": "In this tutorial we will ...", + "url": "https://gitlab.mpcdf.mpg.de/nomad-lab/analytics-tutorial-template", + "link": "https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/Welcome.ipynb", + "created": "", + "updated": "", + "flags":{ + "isPublic": false, + "featured": false, + "top_of_list": false + }, + "labels": { + "application_keyword": [ + "keyword1", + "keyword2" + ], + "application_section": [ + "Materials property prediction" + ], + "application_system": [ + "System" + ], + "category": [ + "Tutorial" + ], + "data_analytics_method": [ + "Clustering" + ], + "platform": [ + "jupyter" + ] + } +} \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9de81df --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +import json +from setuptools import setup, find_packages + +with open('metainfo.json') as file: + metainfo = json.load(file) + +setup( + name='tutorial_template', + version='1.0', + author=', '.join(metainfo['authors']), + author_email=metainfo['email'], + url=metainfo['url'], + description=metainfo['title'], + long_description=metainfo['description'], + packages=find_packages(), + install_requires=['numpy', 'scipy'], +) -- GitLab