Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add linter for markdown, yaml, CSS, html #2176

Merged
merged 7 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 69 additions & 68 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,94 @@
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^reacnetgenerator/static/webpack/\.yarn/releases/.*$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# there are many log files in tests
# TODO: seperate py files and log files
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: ^conda/recipe/meta\.yaml$
- id: check-json
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: mixed-line-ending
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
- id: check-json
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: mixed-line-ending
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: ruff
args: ["--fix"]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
# numpydoc
- repo: https://github.com/Carreau/velin
- id: ruff
args: ["--fix"]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
hooks:
- id: velin
args: ["--write"]
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
- id: velin
args: ["--write"]
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.1
hooks:
- id: clang-format
# Cython
- repo: https://github.com/MarcoGorelli/cython-lint
- id: clang-format
# Cython
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.0
hooks:
- id: cython-lint
- id: double-quote-cython-strings
# CSS
- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
- id: cython-lint
- id: double-quote-cython-strings
# markdown, json, yaml, CSS, javascript, html
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: csslint
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
- id: prettier
types_or: [markdown, json, yaml, css, javascript, html]
# workflow files cannot be modified by pre-commit.ci
exclude: ^conda/recipe/meta\.yaml|\.github/workflows
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
# C++, js
- id: insert-license
# C++, js
- id: insert-license
files: \.(c|cc|cpp|js|ts)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- //
- --no-extra-eol
# CSS
- id: insert-license
- --license-filepath
- .license-header.txt
- --comment-style
- //
- --no-extra-eol
# CSS
- id: insert-license
files: \.(css|scss)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- /*| *| */
- --no-extra-eol
# Python
- id: insert-license
- --license-filepath
- .license-header.txt
- --comment-style
- /*| *| */
- --no-extra-eol
# Python
- id: insert-license
files: \.(py|pyx)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- "#"
- --no-extra-eol
# HTML
- id: insert-license
- --license-filepath
- .license-header.txt
- --comment-style
- "#"
- --no-extra-eol
# HTML
- id: insert-license
files: \.(html|vue|xml)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- <!--| ~| -->
- --no-extra-eol
- --license-filepath
- .license-header.txt
- --comment-style
- <!--| ~| -->
- --no-extra-eol
20 changes: 10 additions & 10 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src=docs/_static/reacnetgen.svg height=40/> ReacNetGenerator
# <img src=docs/_static/reacnetgen.svg height=40/> ReacNetGenerator

[![DOI:10.1039/C9CP05091D](https://img.shields.io/badge/DOI-10.1039%2FC9CP05091D-blue)](https://doi.org/10.1039/C9CP05091D)
[![Citations](https://citations.njzjz.win/10.1039/C9CP05091D)](https://doi.org/10.1039/C9CP05091D)
Expand All @@ -12,11 +12,11 @@ [email protected] (Jinzhe Zeng), [email protected] (Tong Zhu)

## Features

- Processing of MD trajectory containing atomic coordinates or bond orders
- Hidden Markov Model (HMM) based noise filtering
- Isomers identifying accoarding to SMILES
- Generation of reaction network for visualization using force-directed algorithm
- Parallel computing
- Processing of MD trajectory containing atomic coordinates or bond orders
- Hidden Markov Model (HMM) based noise filtering
- Isomers identifying accoarding to SMILES
- Generation of reaction network for visualization using force-directed algorithm
- Parallel computing

## Guide and Tutorial

Expand All @@ -31,10 +31,12 @@ reacnetgenerator -h
See [the guide](https://docs.deepmodeling.com/projects/reacnetgenerator/en/latest/guide/) to learn how to install and use ReacNetGenerattor. We also provide [a series of tutorials](https://docs.deepmodeling.com/projects/reacnetgenerator/en/latest/tutorial/) to help you learn ReacNetGenerator.

## Awards
* The First Prize in 2019 (the 11th Session) Shanghai Computer Application Competition for College Students
* The First Prize in 2019 (the 12th Session) Chinese Computer Design Competition for College Students

- The First Prize in 2019 (the 11th Session) Shanghai Computer Application Competition for College Students
- The First Prize in 2019 (the 12th Session) Chinese Computer Design Competition for College Students

## Acknowledge
* National Natural Science Foundation of China (Grants No. 91641116)
* National Innovation and Entrepreneurship Training Program for Undergraduate (201910269080)
* ECNU Multifunctional Platform for Innovation (No. 001)

- National Natural Science Foundation of China (Grants No. 91641116)
- National Innovation and Entrepreneurship Training Program for Undergraduate (201910269080)
- ECNU Multifunctional Platform for Innovation (No. 001)
85 changes: 44 additions & 41 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,72 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
.bilitube iframe {
width: 100%;
aspect-ratio: 1.2877;
width: 100%;
aspect-ratio: 1.2877;
}

.hero {
text-align: center;
text-align: center;
}

.hero .action, .hero p, .hero img, .hero h1 {
margin: 1.8rem auto;
.hero .action,
.hero p,
.hero img,
.hero h1 {
margin: 1.8rem auto;
}

.hero img {
max-width: 100%;
max-height: 280px;
display: block;
margin: 3rem auto 1.5rem;
background: none!important;
max-width: 100%;
max-height: 280px;
display: block;
margin: 3rem auto 1.5rem;
background: none !important;
}

.hero p {
max-width: 35rem;
font-size: 1.6rem;
line-height: 1.3;
color: #6a8bad;
max-width: 35rem;
font-size: 1.6rem;
line-height: 1.3;
color: #6a8bad;
}

.hero .action-button {
display: inline-block;
font-size: 1.2rem;
color: #fff;
background-color: #3eaf7c;
padding: .8rem 1.6rem;
border-radius: 4px;
transition: background-color .1s ease;
box-sizing: border-box;
border-bottom: 1px solid #389d70;
display: inline-block;
font-size: 1.2rem;
color: #fff;
background-color: #3eaf7c;
padding: 0.8rem 1.6rem;
border-radius: 4px;
transition: background-color 0.1s ease;
box-sizing: border-box;
border-bottom: 1px solid #389d70;
}

.features {
border-top: 1px solid #eaecef;
padding: 1.2rem 0;
margin-top: 2.5rem;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: stretch;
justify-content: space-between;
border-top: 1px solid #eaecef;
padding: 1.2rem 0;
margin-top: 2.5rem;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: stretch;
justify-content: space-between;
}

.features section {
flex-grow: 1;
flex-basis: 30%;
max-width: 30%;
flex-grow: 1;
flex-basis: 30%;
max-width: 30%;
}

@media (max-width: 719px) {
.features {
flex-direction: column;
}
.features {
flex-direction: column;
}

.features section {
max-width: 100%;
padding: 0 2.5rem;
}
.features section {
max-width: 100%;
padding: 0 2.5rem;
}
}
2 changes: 2 additions & 0 deletions docs/guide/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ Then build ReacNetGenerator with one of the following guides:
## Installing via pip

Use `pip` to install in the main directory of ReacNetGenerator. Note that a C/C++ compiler must be installed.

```bash
# upgrade pip as old pip may not be supported
pip install -U pip
pip install .
```

Test installation by

```bash
reacnetgenerator -h
```
Expand Down
1 change: 1 addition & 0 deletions docs/guide/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ After a [trajectory file](format.md) is prepared, you can process the file using
```bash
reacnetgenerator --type dump -i dump.reaxc -a C H O --nohmm
```

where C, H, and O are atomic names in the input file.
`--type` decides the [format](format.md) of the trajectory file `dump.reaxc`.
`--nohmm` controls whether [HMM filter](hmm.md) is enabled.
Expand Down
12 changes: 7 additions & 5 deletions docs/overall.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ reacnetgenerator -h
See [the guide](guide/index) to learn how to install and use ReacNetGenerattor. We also provide [a series of tutorials](tutorial/index) to help you learn ReacNetGenerator.

# Awards
* The First Prize in 2019 (the 11th Session) Shanghai Computer Application Competition for College Students
* The First Prize in 2019 (the 12th Session) Chinese Computer Design Competition for College Students

- The First Prize in 2019 (the 11th Session) Shanghai Computer Application Competition for College Students
- The First Prize in 2019 (the 12th Session) Chinese Computer Design Competition for College Students

# Acknowledge
* National Natural Science Foundation of China (Grants No. 91641116)
* National Innovation and Entrepreneurship Training Program for Undergraduate (201910269080)
* ECNU Multifunctional Platform for Innovation (No. 001)

- National Natural Science Foundation of China (Grants No. 91641116)
- National Innovation and Entrepreneurship Training Program for Undergraduate (201910269080)
- ECNU Multifunctional Platform for Innovation (No. 001)
Loading
Loading