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

Reset project in preparation of re-write #42

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 0 additions & 14 deletions .codecov.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM --platform=linux/x86_64 condaforge/mambaforge:latest

RUN apt update \
&& apt install -y git make build-essentials \
&& rm -rf /var/lib/apt/lists/*
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"build": { "dockerfile": "Dockerfile" },
"postCreateCommand": "make env"
}
42 changes: 0 additions & 42 deletions .github/CONTRIBUTING.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

60 changes: 15 additions & 45 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,32 @@
name: CI

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
push: { branches: [ "main" ] }
pull_request: { branches: [ "main" ] }

jobs:
test:

name: ${{ matrix.os }} python=${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7]
runs-on: ubuntu-latest
container: condaforge/mambaforge:latest

steps:
- uses: actions/checkout@v2.3.4

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2.1.1
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/meta.yaml

channels: conda-forge,defaults

activate-environment: test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true

- name: Install Package
shell: bash -l {0}
run: |
python setup.py develop --no-deps

- name: Conda Environment Information
shell: bash -l {0}
run: |
conda info
conda list
- uses: actions/checkout@v3.3.0

- name: Run Tests
shell: bash -l {0}
run: |
pytest -v --cov=descent --cov-report=xml --color=yes descent/tests/
apt update && apt install -y git make

make env
make lint
make test

- name: CodeCov
uses: codecov/codecov-action@v2.0.3
uses: codecov/codecov-action@v3.1.1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
47 changes: 0 additions & 47 deletions .github/workflows/lint.yaml

This file was deleted.

9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ ENV/
# There are reports this comes from LLVM profiling, but also Xcode 9.
*profraw

# PyCharm
.idea

# OSX
*DS_Store
.DS_Store

# PyCharm
.idea
# Local development
scratch
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repos:
- repo: local
hooks:
- id: isort
name: "[Package] Import formatting"
language: system
entry: isort
files: \.py$

- id: black
name: "[Package] Code formatting"
language: system
entry: black
files: \.py$

- id: flake8
name: "[Package] Linting"
language: system
entry: flake8
files: \.py$

- id: isort-examples
name: "[Examples] Import formatting"
language: system
entry: nbqa isort
files: examples/.+\.ipynb$

- id: black-examples
name: "[Examples] Code formatting"
language: system
entry: nbqa black
files: examples/.+\.ipynb$

- id: flake8-examples
name: "[Examples] Linting"
language: system
entry: nbqa flake8 --ignore=E402
files: examples/.+\.ipynb$
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

MIT License

Copyright (c) 2021 Simon Boothroyd
Copyright (c) 2023 Simon Boothroyd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PACKAGE_NAME := descent
CONDA_ENV_RUN := conda run --no-capture-output --name $(PACKAGE_NAME)

.PHONY: pip-install env lint format test test-examples

pip-install:
$(CONDA_ENV_RUN) pip install --no-build-isolation --no-deps -e .

env:
mamba create --name $(PACKAGE_NAME)
mamba env update --name $(PACKAGE_NAME) --file devtools/envs/base.yaml
$(CONDA_ENV_RUN) pip install --no-build-isolation --no-deps -e .
$(CONDA_ENV_RUN) pre-commit install || true

lint:
$(CONDA_ENV_RUN) isort --check-only $(PACKAGE_NAME)
$(CONDA_ENV_RUN) black --check $(PACKAGE_NAME)
$(CONDA_ENV_RUN) flake8 $(PACKAGE_NAME)
$(CONDA_ENV_RUN) nbqa isort --check-only examples
$(CONDA_ENV_RUN) nbqa black --check examples
$(CONDA_ENV_RUN) nbqa flake8 --ignore=E402 examples

format:
$(CONDA_ENV_RUN) isort $(PACKAGE_NAME)
$(CONDA_ENV_RUN) black $(PACKAGE_NAME)
$(CONDA_ENV_RUN) flake8 $(PACKAGE_NAME)
$(CONDA_ENV_RUN) nbqa isort examples
$(CONDA_ENV_RUN) nbqa black examples
$(CONDA_ENV_RUN) nbqa flake8 --ignore=E402 examples

test:
$(CONDA_ENV_RUN) pytest -v --cov=$(PACKAGE_NAME) --cov-report=xml --color=yes $(PACKAGE_NAME)/tests/
12 changes: 5 additions & 7 deletions descent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""
DESCENT
descent

Optimize force field parameters against QC data using `pytorch`
Optimize classical force field parameters against reference data
"""

from ._version import get_versions
from . import _version

versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
__version__ = _version.get_versions()["version"]
__all__ = ["__version__"]
Loading