Commit 75e4cc3f authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Create a tutorial_template with consisten naming

parent 697ff86c
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
.idea
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# 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.)
## Tips and tricks
- 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.
- the namo of th jupyter notebook could be the same as the name of repository.
## 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
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
{
"authors": [
"Surname, First name",
"Surname, First name",
"Surname, First name"
],
"email": "user@domain.com",
"title": "Title of the tutorial",
"description": "In this tutorial we will ...",
"notebook_name": "tutorial_template.ipynb",
"url": "https://gitlab.mpcdf.mpg.de/nomad-lab/analytics-tutorial-template",
"link": "https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/tutorial_template.ipynb",
"link_public": "https://analytics-toolkit.nomad-coe.eu/public/user-redirect/notebooks/tutorials/tutorial_template.ipynb",
"link_paper": "https://.../.pdf",
"link_doi_paper": "https://www.nature.com/articles/...",
"updated": "2020-04-09",
"flags":{
"featured": true,
"top_of_list": false,
"paper": true
},
"labels": {
"application_section": [
"Keyword",
],
"application_system": [
"System_property_1",
"System_property_2",
"System_property_n"
],
"category": [
"keyword"
],
"ai_methods": [
"AI_method_1",
"AI_method_2",
"AI_method_n"
],
"platform": [
"jupyter"
]
}
}
\ No newline at end of file
import json
from setuptools import setup, find_packages
with open('metainfo.json') as file:
metainfo = json.load(file)
setup(
name='template_tutorial',
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'],
)
%% Cell type:markdown id: tags:
<img src="assets/tutorial_template/header.jpg" width="900">
%% Cell type:markdown id: tags:
<img style="float: left;" src="assets/tutorial_template/logo_NOMAD.png" width=300>
<img style="float: right;" src="assets/tutorial_template/logo_MPG.png" width=170>
%% Cell type:markdown id: tags:
This interactive notebook ...
%% Cell type:markdown id: tags:
# Markdown cheatsheet
## Headings
```
# Heading 1
# Heading 2
## Heading 2.1
## Heading 2.2
```
## Emphasis
- Bold: __string__ or **string**
- Italic: _string_ or *string*
- Indented quoting:
> Hello world!
## Bullets/Numbered lists
- item1
- item2
- subitem1
- subitem2
1. item1
2. item2
1. subitem1
2. subitem2
## Links
- Internal: [section title](#Import-modules)
- External: [Nomad Analytics](https://www.nomad-coe.eu/index.php?page=bigdata-analyticstoolkit)
## Graphics
<img width="25%" src="https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png" title="Title text" >
## Mathematical symbols:
- Inline: $e^{i\pi} + 1 = 0$ or
$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$
## Emeded code
```python
def f(x):
"""a docstring"""
return x**2
```
or refering to a `function`.
## Table
| This | is |
|------|------|
| a | table|
## Horizontal lines
***
or
---
%% Cell type:markdown id: tags:
## Import modules
%% Cell type:code id: tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
```
%% Cell type:code id: tags:
``` python
```
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment