Skip to content

Commit 32b10d6

Browse files
committed
tutorial guidelines
1 parent f623d72 commit 32b10d6

1 file changed

Lines changed: 128 additions & 0 deletions

File tree

tutorials/TUTORIAL_GUIDELINES.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# PINA Tutorial Guidelines
2+
3+
Welcome to the **PINA Tutorial Guidelines** — a guiding document that defines the structure, style, and pedagogical philosophy for all tutorials in the **PINA** package. The goal of this guideline is to ensure that all learning materials are **clear, consistent, pedagogically sound, and beginner-friendly**, while remaining powerful enough to support advanced use cases.
4+
5+
6+
## Purpose
7+
8+
The purpose of the PINA tutorials is to help users:
9+
10+
- Gaining a solid understanding of the PINA library and its core functionalities.
11+
- Learning how to work with the PINA modules.
12+
- Explore practical and advanced applications using consistent, hands-on code examples.
13+
14+
15+
## Guiding Principles
16+
17+
1. **Clarity Over Cleverness**
18+
Tutorials should aim to teach, not impress. Prioritize readable and understandable code and explanations.
19+
20+
2. **Progressive Disclosure of Complexity**
21+
Start simple and gradually introduce complexity. Avoid overwhelming users early on.
22+
23+
3. **Consistency is Key**
24+
All tutorials should follow a common structure (see below), use the same markdown and code formatting, and have a predictable flow.
25+
26+
4. **Real Applications, Real Problems**
27+
Ground tutorials in real Scientific Applications or datasets, wherever possible. Bridge theory and implementation.
28+
29+
30+
## Tutorial Structure
31+
32+
To ensure clarity, consistency, and accessibility, all PINA tutorials should follow the same standardized format.
33+
34+
### 1. Title
35+
36+
Each tutorial must begin with a clear and descriptive title in the following format: **Tutorial: TUTORIAL_TITLE**. The title should succinctly communicate the focus and objective of the tutorial.
37+
38+
### 2. Introducing the Topic
39+
40+
Immediately after the title, include a short introduction that outlines the tutorial's purpose and scope.
41+
42+
- Briefly explain what the tutorial covers and why it’s useful.
43+
- Link to relevant research papers, publications, or external resources if applicable.
44+
- List the core PINA components or modules that will be utilized.
45+
46+
### 3. Imports and Setup
47+
48+
Include a Python code cell with the necessary setup. This ensures that the tutorial runs both locally and on platforms like Google Colab.
49+
50+
```python
51+
## Routine needed to run the notebook on Google Colab
52+
try:
53+
import google.colab
54+
IN_COLAB = True
55+
except:
56+
IN_COLAB = False
57+
58+
if IN_COLAB:
59+
!pip install "pina-mathlab"
60+
61+
import torch # if used
62+
import matplotlib.pyplot as plt # if used
63+
import warnings # if needed
64+
65+
warnings.filterwarnings("ignore")
66+
67+
# Additional PINA and problem-specific imports
68+
...
69+
```
70+
71+
### 3. Data Generation or Loading
72+
* Describe how the data is generated or loaded.
73+
* Include commentary on data structure, format, and content.
74+
* If applicable, visualize key features of the dataset or simulation domain.
75+
76+
### 4. Main Body
77+
The core section of the tutorial should present the problem-solving process in a clear, structured, and pedagogical way. This is where the tutorial delivers the key learning objectives.
78+
79+
- Guide the user step-by-step through the PINA workflow.
80+
- Introduce relevant PINA components as they are used.
81+
- Provide context and explain the rationale behind modeling decisions.
82+
- Break down complex sections with inline comments and markdown explanations.
83+
- Emphasize the relevance of each step to the broader goal of the tutorial.
84+
85+
### 5. Results, Visualization and Error Analysis
86+
- Show relevant plots of results (e.g., predicted vs. ground truth).
87+
- Quantify performance using metrics like loss or relative error.
88+
- Discuss the outcomes: strengths, limitations, and any unexpected behavior
89+
90+
### 6. What's Next?
91+
All the tutorials are concluded with the **What's Next?** section,giving suggestions for further exploration. For this use the following format:
92+
```markdown
93+
## What's Next?
94+
95+
Congratulations on completing the ..., here are a few directions you can explore:
96+
97+
1. **Direction 1** — Suggestion ....
98+
99+
2. **Direction 2** — Suggestion ....
100+
101+
3. **...and many more!** — Other suggestions ....
102+
103+
For more resources and tutorials, check out the [PINA Documentation](https://mathlab.github.io/PINA/).
104+
```
105+
106+
## Writing Style
107+
108+
- Use **clear markdown headers** to segment sections.
109+
- Include **inline math** with `$...$` and display math with `$$...$$`.
110+
- Keep paragraphs short and focused.
111+
- Use **bold** and *italic* for emphasis and structure.
112+
- Include comments in code for clarity.
113+
114+
115+
## Testing Tutorials
116+
117+
Every tutorial should:
118+
- Be executable from top to bottom.
119+
- Use the `tutorial` requirements in the [`pyproject.toml`](https://github.com/mathLab/PINA/blob/6ed3ca04fee3ae3673d53ea384437ce270f008da/pyproject.toml#L40) file.
120+
121+
122+
## Contributing Checklist
123+
124+
We welcome contributions! If you’re writing a tutorial:
125+
1. The tutorial follows this guidelines for structure and tone.
126+
2. The tutorial is simple and modular — one tutorial per concept.
127+
3. The tutorial PRs contains only the `.ipynb` file, and the updated `README.md` file.
128+

0 commit comments

Comments
 (0)