Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dkweiss31 committed Sep 27, 2024
1 parent 89b0193 commit 93027bc
Show file tree
Hide file tree
Showing 18 changed files with 2,101 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
# cancel previous runs of this workflow (only for the same pull request, not for main)
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python-version: [3.9]
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: List installed dependencies
run: python -m pip list

- name: Run CI checks
run: task ci
43 changes: 43 additions & 0 deletions .github/workflows/publish-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: publish-doc

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

concurrency:
# cancel previous runs of this workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: List installed dependencies
run: python -m pip list

- name: Build Docs
run: mkdocs build

- name: Publish website
run: mkdocs gh-deploy --force
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to floquet

We welcome your contribution, whether it be additional cost functions, new functionality, better documentation, etc.

## Requirements

The project was written using Python 3.10+, you must have a compatible version of Python (i.e. >= 3.10) installed on your computer.

## Setup

Clone the repository:

```shell
git clone [email protected]:dkweiss31/floquet.git
cd floquet
```

It is good practice to use a virtual environment to install the dependencies, such as conda. Once this environment has been activated, you can run

```shell
pip install -e .
```

to install the package and its dependencies. As a developer you also need to install the developer dependencies:

```shell
pip install -e ".[dev]"
```

## Code style

This project follows PEP8 and uses automatic formatting and linting tools to ensure that the code is compliant.

## Workflow

### Before submitting a pull request (run all tasks)

Run all tasks before each commit:

```shell
task all
```

### Build the documentation

The documentation is built using [MkDocs](https://www.mkdocs.org/) and the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme. MkDocs generates a static website based on the markdown files in the `docs/` directory.

To preview the changes to the documentation as you edit the docstrings or the markdown files in `docs/`, we recommend starting a live preview server, which will automatically rebuild the website upon modifications:

```shell
task docserve
```

Open <http://localhost:8000/> in your web browser to preview the documentation website.

You can build the static documentation website locally with:

```shell
task docbuild
```

This will create a `site/` directory with the contents of the documentation website. You can then simply open `site/index.html` in your web browser to view the documentation website.

### Run specific tasks

You can also execute tasks individually:

```shell
> task --list
lint lint the code (ruff)
format auto-format the code (ruff)
codespell check for misspellings (codespell)
clean clean the code (ruff + codespell)
test run the unit tests suite (pytest)
docbuild build the documentation website
docserve preview documentation website with hot-reloading
all run all tasks before a commit (ruff + codespell + pytest)
ci run all the CI checks
```
167 changes: 167 additions & 0 deletions docs/_static/custom_css.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/* Fix /page#foo going to the top of the viewport and being hidden by the navbar */
html {
scroll-padding-top: 50px;
}

/* Fit the Twitter handle alongside the GitHub one in the top right. */

div.md-header__source {
width: revert;
max-width: revert;
}

a.md-source {
display: inline-block;
}

.md-source__repository {
max-width: 100%;
}

/* Emphasise sections of nav on left hand side */

nav.md-nav {
padding-left: 5px;
}

nav.md-nav--secondary {
border-left: revert !important;
}

.md-nav__title {
font-size: 0.9rem;
}

.md-nav__item--section > .md-nav__link {
font-size: 0.9rem;
}

/* Indent autogenerated documentation */

div.doc-contents {
padding-left: 25px;
border-left: 4px solid rgba(230, 230, 230);
}

/* Increase visibility of splitters "---" */

[data-md-color-scheme="default"] .md-typeset hr {
border-bottom-color: rgb(0, 0, 0);
border-bottom-width: 1pt;
}

[data-md-color-scheme="slate"] .md-typeset hr {
border-bottom-color: rgb(230, 230, 230);
}

/* More space at the bottom of the page */

.md-main__inner {
margin-bottom: 1.5rem;
}

/* Remove prev/next footer buttons */

.md-footer__inner {
display: none;
}

/* Change font sizes */

html {
/* Decrease font size for overall webpage
Down from 137.5% which is the Material default */
font-size: 110%;
}

.md-typeset .admonition {
/* Increase font size in admonitions */
font-size: 100% !important;
}

.md-typeset details {
/* Increase font size in details */
font-size: 100% !important;
}

.md-typeset h1 {
font-size: 1.6rem;
}

.md-typeset h2 {
font-size: 1.5rem;
}

.md-typeset h3 {
font-size: 1.3rem;
}

.md-typeset h4 {
font-size: 1.1rem;
}

.md-typeset h5 {
font-size: 0.9rem;
}

.md-typeset h6 {
font-size: 0.8rem;
}

/* Bugfix: remove the superfluous parts generated when doing:
??? Blah
::: library.something
*/

.md-typeset details .mkdocstrings > h4 {
display: none;
}

.md-typeset details .mkdocstrings > h5 {
display: none;
}

/* Change default colours for <a> tags */

[data-md-color-scheme="default"] {
--md-typeset-a-color: rgb(0, 189, 164) !important;
}
[data-md-color-scheme="slate"] {
--md-typeset-a-color: rgb(0, 189, 164) !important;
}

/* Highlight functions, classes etc. type signatures. Really helps to make clear where
one item ends and another begins. */

[data-md-color-scheme="default"] {
--doc-heading-color: #DDD;
--doc-heading-border-color: #CCC;
--doc-heading-color-alt: #F0F0F0;
}
[data-md-color-scheme="slate"] {
--doc-heading-color: rgb(25,25,33);
--doc-heading-border-color: rgb(25,25,33);
--doc-heading-color-alt: rgb(33,33,44);
--md-code-bg-color: rgb(38,38,50);
}

h4.doc-heading {
/* NOT var(--md-code-bg-color) as that's not visually distinct from other code blocks.*/
background-color: var(--doc-heading-color);
border: solid var(--doc-heading-border-color);
border-width: 1.5pt;
border-radius: 2pt;
padding: 0pt 5pt 2pt 5pt;
}
h5.doc-heading, h6.heading {
background-color: var(--doc-heading-color-alt);
border-radius: 2pt;
padding: 0pt 5pt 2pt 5pt;
}

/* Make errors in notebooks have scrolling */
.output_error > pre {
overflow: auto;
}
Loading

0 comments on commit 93027bc

Please sign in to comment.