Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/pytest-cov-4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JiQi535 authored Apr 4, 2024
2 parents c39457c + e959d96 commit 439a95b
Show file tree
Hide file tree
Showing 344 changed files with 20,488 additions and 30,646 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,21 +22,19 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt --quiet
- name: mypy
run: |
mypy maml
- name: pydocstyle
run: |
pydocstyle --count maml
- name: pylint
- name: ruff
run: |
pylint maml
ruff --version
ruff . --ignore D
- name: black
run: |
black --version
black --check --diff --color maml
- name: flake8
- name: mypy
run: |
flake8 --count --show-source --statistics maml
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics maml
mypy --version
rm -rf .mypy_cache
mypy maml
73 changes: 0 additions & 73 deletions .github/workflows/release.yml

This file was deleted.

80 changes: 53 additions & 27 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
name: Testing

on: [push, pull_request]
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
workflow_dispatch:
inputs:
task:
type: choice
options: [tests, release]
default: tests
description: Only run tests or release a new version to PyPI after tests pass.

jobs:
build:
test:

strategy:
max-parallel: 20
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9]
os: [ubuntu-latest]
python-version: ["3.9", "3.10"]

runs-on: ${{ matrix.os }}
env:
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
cache-dependency-path: '**/requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -43,11 +45,35 @@ jobs:
pip install -r requirements-optional.txt
pip install -e .
- name: pytest
env:
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
run: |
pytest maml --cov=maml
- name: Coveralls Python
continue-on-error: true
pytest tests --cov=maml
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
uses: AndreMiras/coveralls-python-action@v20201129
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

release:
if: github.event.name == 'release'
needs: test
runs-on: ubuntu-latest
permissions:
# For pypi trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
- run: |
python -m pip install build
pip install -e .
pip wheel -w dist .
- name: Build sdist
run: python -m build --sdist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*.pyd
dist
_build
_site
build
Gemfile.lock
.project
.pydevproject
.settings
Expand Down
50 changes: 27 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
exclude: ^(docs)
exclude: ^(docs|.*test_files|cmd_line|tasks.py)

ci:
autoupdate_schedule: monthly
skip: [mypy]
autofix_commit_msg: pre-commit auto-fixes
autoupdate_commit_msg: pre-commit autoupdate

repos:
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: autoflake

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
hooks:
- id: pyupgrade
args: [--py38-plus]
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
exclude: pymatgen/analysis/vesta_cutoffs.yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.9.0
hooks:
- id: mypy

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
stages: [commit, commit-msg]
exclude_types: [html]
additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.0
hooks:
- id: cython-lint
args: [--no-pycodestyle]
- id: double-quote-cython-strings
37 changes: 15 additions & 22 deletions CHANGES.rst → CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
Change log
==========
# Change log

v2022.9.20
----------
## v2023.9.9
* Added DIRECT sampling approach in `maml.sampling`.

## v2022.9.20
* Bug fix for BOWSR failing because of indexing in some instances.

v2021.1.28
----------
## v2021.1.28
* Fix SNAP stress components
* Fix unexpected test outcome in BOWSR and symbolic regression

v2021.12.13
-----------
## v2021.12.13

* Update dependencies
* Fix bugs

v2021.10.13
-----------
## v2021.10.13
* add bowsr

v2021.3.2
---------
## v2021.3.2
* Set up namespace package architecture for maml.apps. The RFXAS package is now available as a separate package
`maml-apps.rfxas`. Usage remains similar.

v2021.2.27
----------
## v2021.2.27
* maml is now compatible with both mlip-2 and mlip-dev

v0.0.4
------
## v0.0.4
* bug fix
* compatibility with new n2p2 and mlip software
* upgrade rfxas

v0.0.3
------
## v0.0.3
* bug fix
* add atomsets models

v0.0.2
------
## v0.0.2
* major refactor
* move mlearn potential energy surfaces to apps
* fix potential problem of rotated structure in lammps
* add rfxas app
* add initial symbolic regression app
* add megnet-based describers

v0.0.1
------
## v0.0.1
* initial release
19 changes: 19 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cff-version: 1.2.0
message: |
If you use maml in your research, please consider citing the following.
authors:
- family-names: Chen
given-names: Chi
- family-names: Zuo
given-names: Yunxing
- family-names: Ye
given-names: Weike
- family-names: Ji
given-names: Qi
- family-names: Ong
given-names: Shyue Ping
orcid: https://orcid.org/0000-0001-5726-2587
title: 'Materials Machine Learning (maml)'
version: 2022.9.20 # replace with whatever version you use
date-released: 2022-09-20
url: https://github.com/materialsvirtuallab/maml
Loading

0 comments on commit 439a95b

Please sign in to comment.