Skip to content

Commit

Permalink
create docs
Browse files Browse the repository at this point in the history
  • Loading branch information
teddygroves committed Aug 22, 2024
1 parent 968843f commit 280d769
Show file tree
Hide file tree
Showing 13 changed files with 752 additions and 22 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"ci": {
"collect": {
"staticDistDir": "./site/",
"settings": {
"skipAudits": [
"canonical"
]
}
},
"assert": {
"assertions": {
"categories:performance": [
"error",
{
"minScore": 0.8
}
],
"categories:accessibility": [
"error",
{
"minScore": 0.8
}
],
"categories:best-practices": [
"error",
{
"minScore": 0.8
}
],
"categories:seo": [
"error",
{
"minScore": 0.7
}
]
}
}
}
}
35 changes: 35 additions & 0 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow tests whether the documentation builds correctly and runs a
# lighthouse audit.

name: Docs check

on:
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
docs:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: install enzax with development packages
run: pip install -e .\[docs\]
- name: build docs with mkdocs
run: mkdocs build
- name: Audit with Lighthouse
uses: treosh/lighthouse-ci-action@v10
with:
configPath: ".github/workflows/lighthouserc.json"
temporaryPublicStorage: true
uploadArtifacts: true
runs: 3 # Multiple runs to reduce variance
79 changes: 79 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behaviour that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behaviour include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behaviour and will take appropriate and fair corrective action in response to any behaviour that they deem inappropriate, threatening, offensive, or harmful.

Community leaders 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, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behaviour deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behaviour was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behaviour. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behaviour.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behaviour, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# How to contribute to enzax

All contributions are very welcome!

Make sure to read the [code of conduct](https://github.com/dtu-qmcm/CODE_OF_CONDUCT.md) and follow its recommendations.

If you have a specific suggestion for how enzax could be improved, or if you find a bug then please file an issue or submit a pull request.

Alternatively, if you have any more general thoughts or questions, please post them in the [discussions page](https://github.com/dtu-qmcmc/enzax/discussions).

If you would like to contribute code changes, just follow the normal [GitHub workflow](https://docs.github.com/en/get-started/quickstart/github-flow): make a local branch with the changes then create a pull request.

## Developing enzax locally

To develop enzax locally you will probably need to install it with development dependencies. Here is how to do so:

```sh
$ pip install enzax'[dev]'
```

You can see what these dependencies are by checking the `[tool.pdm.dev-dependencies]` table in enzax's [`pyproject.toml` file](https://github.com/dtu-qmcm/enzax/blob/main/pyproject.toml).

## Releasing new versions of enzax

To release a new version of enzax, edit the field `version` in `pyproject.toml`, e.g. to `0.2.1` then make a pull request with this change.

Once the changes are merged into the `origin/main` branch, add a tag whose name begins with `v`, followed by the new version number to your local `main` branch, for example like this:

```sh
$ git tag v0.2.1
```

Now push the new tag to GitHub:

```sh
$ git push origin "v0.2.1"
```
36 changes: 36 additions & 0 deletions docs/accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Accessibility

The enzax developers want as many people as possible to be able to use this
website. For example, that means you should be able to:

- change colours, contrast levels and fonts

- zoom in up to 300% without the text spilling off the screen

- navigate most of the website using just a keyboard

- navigate most of the website using speech recognition software

- listen to most of the website using a screen reader

- We’ve also made the website text as simple as possible to understand.

## How accessible this website is

We know some parts of this website are not fully accessible:

- Some images in [this vignette](_static/report.html) have no text
descriptions.

## Feedback and contact information

If you need information on this website in a different format like accessible
PDF, large print, easy read, audio recording or braille, please contact us by
[email](mailto:[email protected]) or raise an issue on the [enzax GitHub repository](https://github.com/dtu-qmcm/enzax/).

## Reporting accessibility problems with this website

We’re always looking to improve the accessibility of this website. If you find
any problems not listed on this page or think we’re not meeting accessibility
requirements, contact us by [email](mailto:[email protected]) or raise
an issue on our [GitHub repository](https://github.com/dtu-qmcm/enzax/).
15 changes: 15 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Enzax's python api

Enzax provides some Python classes and functions that you can use! This page
describes them.

## ::: enzax.kinetic_model
options:
show_root_heading: true
filters:
- "!check"
members:
- KineticModel
- UnparameterisedKineticModel
- KineticModelParameters
- KineticModelStructure
1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "CONTRIBUTING.md"
Empty file added docs/getting_started.md
Empty file.
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Welcome to enzax's documentation!

Enzax is a library of kinetic models of enzyme-catalysed reaction networks. It supports automatic differentiation using [JAX](https://jax.readthedocs.io/en/latest/), allowing you to find your models' gradients, as required for e.g. Hamiltonian Monte Carlo or neural network models.

The [getting started](getting_started.md) page explains how to install enzax and use it to find and differentiate the steady states of an example model.

For reference information, check out the [api](api.md) page.

If you would like to contribute to enzax, the [contributing](contributing.md)
page has some useful information.

See the [accessibility](accessibility.md) page for how we try to make enzax as
useable as possible for everyone.
44 changes: 44 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
site_name: "Enzax"
site_description: Differentiable models of enzyme-catalysed reaction networks, with JAX
use_directory_urls: False
theme:
name: "material"
features:
- content.tabs.link
- content.code.annotate
- content.code.copy
- announce.dismiss
- navigation.sections
# logo: '_static/bibat-light.svg'
# favicon: '_static/bibat-light.svg'
repo_url: https://github.com/dtu-qmcm/enzax
plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [src/enzax]
options:
show_bases: false
docstring_style: sphinx
members_order: source
group_by_category: false
filters: ["!^_"]
docstring_options:
warn_unknown_params: false

markdown_extensions:
- admonition
- pymdownx.keys
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.tabbed
- attr_list
- md_in_html

nav:
- Home: 'index.md'
- Getting started: 'getting_started.md'
- API: 'api.md'
- Contributing: 'contributing.md'
- Accessibility: 'accessibility.md'
Loading

0 comments on commit 280d769

Please sign in to comment.