Skip to content

Commit

Permalink
Merge pull request #17 from scientificcomputing/final-fixes
Browse files Browse the repository at this point in the history
Final fixes
  • Loading branch information
finsberg authored Nov 22, 2023
2 parents e6e23af + 075cf03 commit 46a3dca
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 39 deletions.
25 changes: 15 additions & 10 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,29 @@ Henrik Finsberg, Jørgen Dokken and Min Ragan-Kelley
* We write code to **run simulations**
* We write code to create figures and tables (**post-processing**)

* Whenever you publish a paper, you need to have recipe for how to reproduce the results in the paper
- Many journals require that you make your code available

---


*Whenever you publish a paper, you need to have recipe for how to reproduce the results in the paper*

* Many journals require that you make your code available

---

## Goal of this workshops

- 11.15 - 11.45: Code and data repositories (Henrik)
- 11.45 - 12.15: Reproducible environments (Min)
- 12.15 - 12.45: Lunch
- 12.45 - 13.15: Linters, formatters and continuous integration (Henrik + Jørgen)
- 13.15 - 13.45: Documentation (Jørgen)
- 13.45 - 14.00: Break
- 14.00 - 14.30: A paper with code (Henrik)
- 11.00 - 11.30: Code and data repositories (Henrik)
- 11.30 - 12.00: Reproducible environments (Min)
- 12.00 - 12.30: Lunch
- 12.30 - 13.00: Linters, formatters and continuous integration (Henrik + Jørgen)
- 13.00 - 13.30: Documentation (Jørgen)
- 13.30 - 13.45: Break
- 13.45 - 14.15: A paper with code (Henrik)

---

## Material from the workshop

- https://github.com/scientificcomputing/seminar-23-11-2023
- https://scientificcomputing.github.io/seminar-23-11-2023/README.html
- https://scientificcomputing.github.io/seminar-23-11-2023
12 changes: 12 additions & 0 deletions docs/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ Several ways to do this:
* Ideally you should share the data on Zenodo (https://zenodo.org) when publishing the paper. This will make sure you get a DOI for the data.
- It is also possible to upload data with restricted data on Zenodo
* Create a script for downloading data
- https://github.com/scientificcomputing/example-paper-fenics
- Dropbox: Use `?dl=1`
- Google drive: `https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID`
---
## Make sure to create a tag / release
Expand All @@ -134,3 +138,11 @@ You should create a tag (and a release) of the code
- Citation information
- Write a `CITATION.cff`
---
## Next steps
- Check out the material at https://github.com/scientificcomputing/seminar-23-11-2023
- Ask us for help - email, slack or in the office
55 changes: 29 additions & 26 deletions docs/repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ Henrik Finsberg

## Setting up your first project

- Cookiecutters
- Script that generate the files based on a few questions
- https://github.com/scientificcomputing/generate-paper
- https://github.com/scientific-python/cookie
- https://www.cookiecutter.io/templates
- Templates
- Copy all files from an existing repository
- https://github.com/scientificcomputing/example-paper
- https://github.com/scientificcomputing/example-paper-fenics

- Cookiecutters
- Script that generate the files based on a few questions
- https://github.com/scientificcomputing/generate-paper
- https://github.com/scientific-python/cookie
- https://www.cookiecutter.io/templates

---

Expand Down Expand Up @@ -90,12 +90,6 @@ research_paper_1

---

![bg w:50%](https://the-turing-way.netlify.app/_images/healthy-research-tree.jpg)
<style scoped>section { justify-content: end; }</style>
<p class="small-text">Image is used under a CC-BY 4.0 licence. DOI: 10.5281/zenodo.3332807.</p>

---

## Code review process

* Open issue describing the problem. Use the issue tracker to discuss whether this needs to be solved.
Expand All @@ -112,13 +106,7 @@ If you work alone and don't work on multiple things at the same time, the it is

---

# Demo

- Create a new branch and open a pull request

---

# Exercise
# Demo / Exercise

- Create a new repo on GitHub (ex: `example-paper`)
- Run the cookiecutter and add all the files in a single commit
Expand Down Expand Up @@ -152,7 +140,8 @@ If you work alone and don't work on multiple things at the same time, the it is
## Versioning
* When you think that your code is ready for external users, it is time to create your first release
* Your code should get a version number
* Your code should get a version number.
* Create a release when you submit your paper.
* `MAJOR.MINOR.MICRO`
* Specify the version number in `pyproject.toml`
* Semantic or Calendar based versioning
Expand All @@ -177,7 +166,7 @@ https://calver.org
https://semver.org
- `major.minor.micro` e.g `0.1.2`
- Bump patch: Bug fixes not affecting the API
- Bump micro / patch: Bug fixes not affecting the API
- Bump minor: Backward compatible API additions/changes
- Bump major: Backward incompatible API changes
- Typically start with `0` major version and bump to `1` when ready for users.
Expand Down Expand Up @@ -216,11 +205,7 @@ https://semver.org
---
Demo: Creating a new release
---
## Exercise: bump the version
## Demo / Exercise: bump the version
- Change the version of your paper
- Create a new tag and release
Expand Down Expand Up @@ -248,14 +233,32 @@ https://choosealicense.com
## Exercise:
You would like to implement a new feature in dolfinx:
You want to use dolfinx:
https://github.com/FEniCS/dolfinx
What license do you need to use?
---
You can choose if you want to use GPL or LGPL.
- If you choose GPL, you need to use GPL license
- If you choose LGPL, you can choose another license
---
## Exercise:
You would like to implement a new feature in dolfinx and use it in your code:
https://github.com/FEniCS/dolfinx
What license do you need to use?
* GPL or LGPL
---
Are you allowed to copy code from a repo with MIT license into your own repo?
```
Expand Down
6 changes: 3 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
theme: default
paginate: true
header: 'Best Practices in Modern Software Development: Linters, formatters and pre-commit hooks'
footer: '23.11.23 - Henrik Finsberg and Jørgen Dokken'
footer: '23.11.23 - Henrik Finsberg'
size: 16:9
style: |
.small-text {
Expand All @@ -15,7 +15,7 @@ marp: true
# Linters, formatters and pre-commit hooks
Best Practices in Modern Software Development: 23.11.23

Henrik Finsberg and Jørgen Dokken
Henrik Finsberg

---

Expand All @@ -31,7 +31,7 @@ Henrik Finsberg and Jørgen Dokken
- [`flake8`](https://github.com/PyCQA/flake8): points out general problems
- [`ruff`](https://github.com/astral-sh/ruff): similar to `flake8` only more and faster (recommended). `ruff` also include features from `isort`, `pyupgrade`, `black`, ...

* You can install them with `pip` or `pipx` [FIXME: Talk about `pipx`?]
* You can install them with `pip` or `pipx`

---

Expand Down

0 comments on commit 46a3dca

Please sign in to comment.