Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 737de6c

Browse files
committed
CI: add mdformat
1 parent c1f093b commit 737de6c

File tree

7 files changed

+55
-40
lines changed

7 files changed

+55
-40
lines changed

.actions/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
scripts for generating notebooks
22

33
**GHA here**
4+
45
- generate notebooks
56
- flow to ban any added notebook in PR (fail if changes in .notebooks)
67

78
**PL side**
9+
810
- git submodule with these examples
911
- gha cron to update submodule head

.github/CONTRIBUTING.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ As a researcher, you can't have any part of your code going wrong. So, make thor
2727

2828
PyTorch Lightning Tutorials is highly interoperable with PyTorch Lightning and PyTorch.
2929

30-
---
30+
______________________________________________________________________
3131

3232
## Contribution Types
3333

@@ -38,25 +38,23 @@ A lot of good work has already been done in project mechanics (requirements/base
3838
### Bug Fixes:
3939

4040
1. If you find a bug please submit a GitHub issue. Make sure the title explains the issue.
41+
1. Try to fix it or recommend a solution.
42+
1. Submit a PR!
4143

42-
2. Try to fix it or recommend a solution.
43-
44-
3. Submit a PR!
45-
46-
_**Note**, even if you do not find the solution, sending a PR with a test covering the issue is a valid contribution, and we can help you or finish it with you :]_
44+
_**Note**, even if you do not find the solution, sending a PR with a test covering the issue is a valid contribution, and we can help you or finish it with you :\]_
4745

4846
### New Models:
4947

5048
PyTorch Lightning Tutorials shows several research models for ready usage. Following are general guidelines for adding new models.
5149

5250
1. Workflows which are standard baselines
53-
2. Whose results are reproduced properly either by us or by authors.
54-
3. Do not reinvent the wheel, natively support torchvision, torchtext, torchaudio models.
55-
4. Use open source licensed models.
51+
1. Whose results are reproduced properly either by us or by authors.
52+
1. Do not reinvent the wheel, natively support torchvision, torchtext, torchaudio models.
53+
1. Use open source licensed models.
5654

5755
Please raise an issue before adding a new tutorial. There are tons of models that keep coming. It is very difficult to support every peace.
5856

59-
---
57+
______________________________________________________________________
6058

6159
## Guidelines
6260

@@ -74,10 +72,10 @@ In case you adding new dependencies, make sure that they are compatible with the
7472

7573
All help is extremely welcome - reporting bugs, fixing documentation, etc. To solve some issues you can start with label [good first issue](https://github.com/PyTorchLightning/lightning-bolts/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or chose something close to your domain with label. Before you start to implement anything check that the issue description that it is clear and self-assign the task to you (if it is not possible, just comment that you take it, and we assign it to you...).
7674

77-
2. **Is there a recommendation for branch names?**
75+
1. **Is there a recommendation for branch names?**
7876

7977
We do not rely on the name convention so far you are working with your own fork. Anyway it would be nice to follow this convention `<type>/<issue-id>_<short-name>` where the types are: `bugfix`, `ipynb`, `docs`, ...
8078

81-
3. **I have a model in other framework than PyTorch, how do I add it here?**
79+
1. **I have a model in other framework than PyTorch, how do I add it here?**
8280

8381
Since PL Tutorials are aiming at Pytorch Lightning implementations we encourage staying with it.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: ''
55
labels: bug / fix, help wanted
66
assignees: ''
7-
87
---
98

109
## 🐛 Bug
@@ -16,9 +15,9 @@ assignees: ''
1615
Steps to reproduce the behavior:
1716

1817
1. Go to '...'
19-
2. Run '....'
20-
3. Scroll down to '....'
21-
4. See error
18+
1. Run '....'
19+
1. Scroll down to '....'
20+
1. See error
2221

2322
<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->
2423

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ about: Suggest an idea for this project
44
title: ''
55
labels: enhancement, help wanted
66
assignees: ''
7-
87
---
98

109
## 🚀 Feature
10+
1111
<!-- A clear and concise description of the feature proposal -->
1212

1313
### Motivation

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
- [ ] Did you write any new necessary tests?
66

77
## What does this PR do?
8+
89
Fixes # (issue).
910

1011
## PR review
12+
1113
Anyone in the community is free to review the PR once the tests have passed.
1214
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
1315

1416
## Did you have fun?
17+
1518
Make sure you had fun coding 🙃

.pre-commit-config.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,21 @@ repos:
3939
hooks:
4040
- id: yapf
4141

42-
- repo: https://github.com/PyCQA/flake8
43-
rev: 3.9.2
44-
hooks:
45-
- id: flake8
46-
4742
- repo: https://github.com/asottile/yesqa
4843
rev: v1.2.3
4944
hooks:
5045
- id: yesqa
46+
47+
- repo: https://github.com/executablebooks/mdformat
48+
rev: 0.7.7
49+
hooks:
50+
- id: mdformat
51+
additional_dependencies:
52+
- mdformat-gfm
53+
- mdformat-black
54+
- mdformat_frontmatter
55+
56+
- repo: https://github.com/PyCQA/flake8
57+
rev: 3.9.2
58+
hooks:
59+
- id: flake8

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,44 @@
77

88
This is the Lightning Library - collection of Lightning related notebooks which are pulled back to the main repo as submodule and rendered inside the main documentations.
99
The key features/highlights:
10-
* we keep the repo **light-weighted** - notebooks are stored in rich script format
11-
* all scripts/notebooks are tested to be **fully executable**
12-
* fully **reproducible** by saving runtime env. details
10+
11+
- we keep the repo **light-weighted** - notebooks are stored in rich script format
12+
- all scripts/notebooks are tested to be **fully executable**
13+
- fully **reproducible** by saving runtime env. details
1314

1415
For more details read our blogpost - [Best Practices for Publishing PyTorch Lightning Tutorial Notebooks](https://devblog.pytorchlightning.ai/publishing-lightning-tutorials-cbea3eaa4b2c)
1516

1617
## Adding/Editing notebooks
1718

1819
This repo in main branch contain only python scripts with markdown extensions, and notebooks are generated in special publication branch, so no raw notebooks are accepted as PR.
1920
On the other hand we highly recommend creating a notebooks and convert it script with [jupytext](https://jupytext.readthedocs.io/en/latest/) as
21+
2022
```bash
2123
jupytext --set-formats ipynb,py:percent my-notebook.ipynb
2224
```
2325

2426
### Contribution structure
2527

2628
The addition has to formed as new folder
29+
2730
- the folder name is used for the future notebooks
2831
- single python scripts with converted notebooks (name does not matter)
2932
- metadata named `.meta.yaml` including following info:
30-
```yaml
31-
title: Sample notebooks
32-
author: [User](contact)
33-
created: YYYY-MM-DD
34-
updated: YYYY-MM-DD
35-
license: CC BY-SA
36-
# multi-line
37-
description: |
38-
This notebook will walk you through ...
39-
requirements:
40-
- package # with version if needed
41-
# define supported - CPU|GPU|TPU
42-
accelerator:
43-
- CPU
44-
```
33+
```yaml
34+
title: Sample notebooks
35+
author: [User](contact)
36+
created: YYYY-MM-DD
37+
updated: YYYY-MM-DD
38+
license: CC BY-SA
39+
# multi-line
40+
description: |
41+
This notebook will walk you through ...
42+
requirements:
43+
- package # with version if needed
44+
# define supported - CPU|GPU|TPU
45+
accelerator:
46+
- CPU
47+
```
4548
4649
### Suggestions
4750
@@ -56,6 +59,7 @@ The addition has to formed as new folder
5659
## Meantime notes
5760

5861
On the back side of publishing workflow you can find in principle these three steps
62+
5963
```bash
6064
# 1) convert script to notebooks
6165
jupytext --set-formats ipynb,py:percent notebook.py

0 commit comments

Comments
 (0)