Skip to content

Commit 2f592b6

Browse files
authored
Setup the structure of tutorials and several CI pipelines. (#1)
1 parent 2c57858 commit 2f592b6

File tree

16 files changed

+257
-59
lines changed

16 files changed

+257
-59
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Checklist
2+
Thank you for contributing to Tutorials for Quantum Toolbox in `Julia`! Please make sure you have finished the following tasks before opening the PR.
3+
4+
- [ ] Please read [Contributing to QuantumToolbox.jl](https://qutip.org/QuantumToolbox.jl/stable/resources/contributing).
5+
- [ ] All tutorials were able to render locally by running: `make render`.
6+
7+
Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a [Draft Pull Request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to let the others know this on-going work.
8+
9+
## Description
10+
Describe the proposed change here.
11+
12+
## Related issues or PRs
13+
Please mention the related issues or PRs here. If the PR fixes an issue, use the keyword close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved followed by the issue id, e.g. fix #[id]
14+
15+
## Additional context

.github/workflows/SpellCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/[email protected]

.github/workflows/publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Quarto Build
2+
3+
on: # either one of the following four cases
4+
workflow_dispatch: # manually trigger
5+
6+
schedule:
7+
- cron: '0 0 * * 0' # weekly (every Sunday)
8+
9+
push:
10+
branches: main
11+
12+
pull_request:
13+
branches:
14+
- main
15+
types:
16+
- opened
17+
- reopened
18+
- synchronize
19+
- ready_for_review
20+
21+
jobs:
22+
build-deploy:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
actions: write # needed to allow julia-actions/cache to delete old caches that it has created
26+
contents: write # needed for Quarto render
27+
if: ${{ !github.event.pull_request.draft }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Quarto
31+
uses: quarto-dev/quarto-actions/setup@v2
32+
- uses: julia-actions/setup-julia@v2
33+
with:
34+
version: '1'
35+
- uses: julia-actions/cache@v2
36+
- uses: julia-actions/julia-buildpkg@v1
37+
with:
38+
precompile: true
39+
- uses: cardinalby/export-env-action@v1
40+
with:
41+
envFile: '_environment'
42+
expand: 'true'
43+
- name: Quarto Render
44+
uses: quarto-dev/quarto-actions/render@v2
45+
with:
46+
to: html
47+
- name: Quarto Publish
48+
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
49+
uses: quarto-dev/quarto-actions/publish@v2
50+
with:
51+
render: 'false' # rendered in the previous step already
52+
target: gh-pages
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
.DS_Store
2+
13
# Files generated by invoking Julia with --code-coverage
24
*.jl.cov
35
*.jl.*.cov
4-
5-
# Files generated by invoking Julia with --track-allocation
66
*.jl.mem
77

8+
Manifest.toml
9+
10+
.vscode
11+
812
# System-specific files and directories generated by the BinaryProvider and BinDeps packages
913
# They contain absolute paths specific to the host computer, and so should not be committed
1014
deps/deps.jl
@@ -13,17 +17,14 @@ deps/downloads/
1317
deps/usr/
1418
deps/src/
1519

16-
# Build artifacts for creating documentation generated by the Documenter package
17-
docs/build/
18-
docs/site/
19-
20-
# File generated by Pkg, the package manager, based on a corresponding Project.toml
21-
# It records a fixed state of all packages used by the project. As such, it should not be
22-
# committed for packages, but should be committed for applications that require a static
23-
# environment.
24-
# Manifest.toml
20+
.ipynb_checkpoints
21+
*.ipynb
2522

2623
pyenv/
2724
/.quarto/
25+
/_freeze/
2826
/_site/
2927
/_output/
28+
*.html
29+
*.json
30+
/site_libs/

CODE_OF_CONDUCT.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the Contributor Covenant , version 1.2.0, available at https://www.contributor-covenant.org/version/1/2/0/code-of-conduct.html
23+
24+
[homepage]: https://contributor-covenant.org
25+
[version]: https://contributor-covenant.org/version/1/2/

LICENSE

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
MIT License
1+
BSD 3-Clause License
22

3-
Copyright (c) 2025 QuTiP
3+
Copyright (c) 2025, QuTiP developers and contributors.
4+
All rights reserved.
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
118

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
1411

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its contributors
17+
may be used to endorse or promote products derived from this software without
18+
specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
24+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
JULIA:=julia
2+
QUARTO:=quarto
3+
4+
include _environment
5+
6+
default: help
7+
8+
render:
9+
${JULIA} --project=@. -e 'import Pkg; Pkg.instantiate(); Pkg.resolve(); Pkg.precompile(); using QuantumToolbox, HierarchicalEOM;'
10+
${JULIA} --project=@. -e 'using QuantumToolbox, HierarchicalEOM;'
11+
${QUARTO} render
12+
13+
preview:
14+
${QUARTO} preview
15+
16+
all: render preview
17+
18+
help:
19+
@echo "The following make commands are available:"
20+
@echo " - make render: render the tutorial files"
21+
@echo " - make preview: start a local site of tutorials"
22+
@echo " - make all: run every commands in the above order"
23+
24+
.PHONY: default render preview all help

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[deps]
2+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
3+
HierarchicalEOM = "a62dbcb7-80f5-4d31-9a88-8b19fd92b128"
4+
QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Jaynes Cummings Model"
3+
# subtitle: ""
4+
author: Alberto Mercurio
5+
6+
engine: julia
7+
---
8+
9+
```{julia}
10+
using QuantumToolbox
11+
12+
QuantumToolbox.versioninfo()
13+
```

0 commit comments

Comments
 (0)