Skip to content

Commit

Permalink
Merge branch 'master' into type-hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
ralf-meyer authored Nov 11, 2023
2 parents dd92b55 + 4e6d826 commit 5369b24
Show file tree
Hide file tree
Showing 520 changed files with 74,429 additions and 6,854 deletions.
3 changes: 0 additions & 3 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[aliases]
test=pytest

[flake8]
max-complexity = 15
max-line-length = 127
55 changes: 55 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
# This follows https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

on:
push:
branches:
- "master"

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/molSimplify

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
41 changes: 28 additions & 13 deletions .github/workflows/CI.yaml → .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: CI
name: Pytest

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "master"
Expand All @@ -12,15 +9,10 @@ on:
branches:
- "master"
- "main"
# schedule:
# # Nightly tests run on master by default:
# # Scheduled workflows run on the latest commit on the default or base branch.
# # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
# - cron: "0 0 * * *"

jobs:
CI:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
pytest_conda:
name: Pytest (conda) on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -82,7 +74,7 @@ jobs:
- name: Run doctest
# For now still excluding several subfolders and files
run: |
pytest --doctest-modules --ignore=molSimplify/job_manager --ignore=molSimplify/Informatics/MOF --ignore=molSimplify/Informatics/protein --ignore=molSimplify/Scripts/in_b3lyp_usetc.py --ignore=molSimplify/Informatics/jupyter_vis.py --ignore=molSimplify/Informatics/macrocycle_synthesis.py --ignore=molSimplify/Informatics/organic_fingerprints.py molSimplify
pytest --doctest-modules --ignore=molSimplify/Informatics/MOF --ignore=molSimplify/Informatics/protein --ignore=molSimplify/Scripts/in_b3lyp_usetc.py --ignore=molSimplify/Informatics/jupyter_vis.py --ignore=molSimplify/Informatics/macrocycle_synthesis.py --ignore=molSimplify/Informatics/organic_fingerprints.py molSimplify
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
Expand All @@ -101,9 +93,32 @@ jobs:
#uses: ravsamhq/notify-slack-action@v1
uses: 8398a7/action-slack@v3
with:
job_name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
job_name: Pytest (conda) on ${{ matrix.os }}, Python ${{ matrix.python-version }}
fields: message,commit,author,workflow,job,took
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}}
#MATRIX_CONTEXT: ${{ toJson(matrix) }} # required

pytest_pip:
name: Pytest (pip) on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: |
pip install -e .[dev]
- name: Run pytest
run: |
pytest -v
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: '6.0.0'
rev: '6.1.0'
hooks:
- id: flake8
args: ['--select=E9,F63,F7,F82', '--exclude=fragment_classes.py,frag_functionalizer.py,bridge_functionalizer.py']
9 changes: 5 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
version: 2

conda:
environment: docs/environment.yaml
build:
os: ubuntu-22.04
tools:
python: "3.7"

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- rtd
- docs

sphinx:
builder: html
Expand Down
15 changes: 0 additions & 15 deletions MANIFEST.in

This file was deleted.

27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
![](./molSimplify/icons/logo.png)
[![CI](https://github.com/hjkgrp/molSimplify/actions/workflows/CI.yaml/badge.svg)](https://github.com/hjkgrp/molSimplify/actions/workflows/CI.yaml)
[![Pytest](https://github.com/hjkgrp/molSimplify/actions/workflows/pytest.yaml/badge.svg)](https://github.com/hjkgrp/molSimplify/actions/workflows/pytest.yaml)
[![Documentation Status](https://readthedocs.org/projects/molsimplify/badge/?version=latest)](http://molsimplify.readthedocs.io/?badge=latest)
[![Linter](https://github.com/hjkgrp/molSimplify/actions/workflows/python-linter.yaml/badge.svg)](https://github.com/hjkgrp/molSimplify/actions/workflows/python-linter.yaml)

molSimplify is an open source toolkit for the automated, first-principles screening and discovery of new inorganic molecules and intermolecular complexes. molSimplify is developed by the [Kulik Group](http://hjkgrp.mit.edu) in the [Department of Chemical Engineering](http://web.mit.edu/cheme/) at [MIT](http://web.mit.edu). The software can generate a variety of coordination complexes of metals coordinated by ligands in a mono- or multi-dentate fashion. The code can build a coordination complex directly from a central atom or functionalize a more complex structure (e.g. a porphyrin or other metal-ligand complex) by including additional ligands or replacing existing ones. molSimplify also generates inter-molecular complexes for evaluating binding interactions and generating candidate reactants and intermediates for catalyst reaction mechanism screening. molSimplify also ships neural network models that can predict the [metal-ligand bond lengths](https://pubs.rsc.org/en/content/articlehtml/2017/sc/c7sc01247k), [spin-splitting energy](https://pubs.acs.org/doi/abs/10.1021/acs.jpca.7b08750), [frontier orbital energies](https://pubs.acs.org/doi/abs/10.1021/acs.iecr.8b04015), [spin-state dependent reaction energies](https://pubs.acs.org/doi/abs/10.1021/acscatal.9b02165), and [simulation outcomes](https://pubs.acs.org/doi/abs/10.1021/acs.jctc.9b00057) for octahedral transition metal complexes. See the Tutorials at the [Kulik group webpage](http://hjkgrp.mit.edu/molSimplify-tutorials) for a more complete list of jobs molSimplify can do.

## Installation

### via conda
### via conda, from GitHub
We currently recommend installation via the [Conda](https://conda.io/docs/) package management system.
1. Prerequisite: have [Anaconda or miniconda](https://www.anaconda.com/distribution/) installed on your system. **For M1 Macs, please use [Miniforge](https://github.com/conda-forge/miniforge) for Mac OSX arm64.** (We do not recommend simultaneously installing Anaconda and Miniforge - only install Miniforge.)

Expand Down Expand Up @@ -37,14 +37,33 @@ We currently recommend installation via the [Conda](https://conda.io/docs/) pack
pytest
```

### via conda, from Anaconda
Releases of molSimplify are also available on Anaconda on the [conda-forge channel](https://anaconda.org/conda-forge/molsimplify) and the [hjkgroup channel](https://anaconda.org/hjkgroup/molsimplify).

### via pip, from GitHub
1. Clone molSimplify source from github and change into the directory.

```bash
git clone https://github.com/hjkgrp/molSimplify.git
cd molSimplify
```
2. Locally install the molSimplify package using pip.
```bash
pip install -e .[dev]
```
3. To test your installation, you can run the command below at the root directory of molSimplify. You are good to go if all the tests are passed! Note, some test will be skipped because none of the optional dependencies are installed this way.
```bash
pytest
```

### via docker
We also maintain an active [docker image on dockerhub](https://hub.docker.com/repository/docker/hjkgroup/molsimplify) for plug-and-play use.

For line by line instructions on an installation via docker, please visit [molSimplify installation webpage of Kulik group](http://hjkgrp.mit.edu/content/installing-molsimplify).

## Tutorials

A set of tutorials covering common use cases is available at the [Kulik group webpage](http://hjkgrp.mit.edu/molSimplify-tutorials).
A set of tutorials covering common use cases is available at the [Kulik group webpage](http://hjkgrp.mit.edu/molSimplify-tutorials). Note that the GUI is no longer supported, so users are encouraged to generate structures through the command line or using the Python command [startgen_pythonic](molSimplify/Scripts/generator.py).

## Documentation

Expand Down Expand Up @@ -82,6 +101,6 @@ year = {2018},
}
```

If you use any machine learning (ML) models in molSimplify that results in a publication, please cite the corresponding reference in [this MLmodel reference page](https://github.com/hjkgrp/molSimplify/blob/master/MLmodel-reference.md).
If you use any machine learning (ML) models in molSimplify that results in a publication, please cite the corresponding reference in [this ML model reference page](https://github.com/hjkgrp/molSimplify/blob/master/MLmodel-reference.md).

**Note that we have disabled developers' supports for Python 2.7 and will only release conda builds on Python 3.**
27 changes: 0 additions & 27 deletions devtools/conda-envs/README.md

This file was deleted.

1 change: 0 additions & 1 deletion devtools/conda-envs/install_tensorflow_m1.sh

This file was deleted.

6 changes: 4 additions & 2 deletions devtools/conda-envs/mols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ dependencies:
- pandas
- scipy
- libffi
- importlib_resources
- pip
- pip:
- pytest
- pytest-resource-path

# Optional
# GUI / plotting
- pyqt
- qt
# - pyqt
# - qt
- matplotlib
# Database
- pymongo
Expand Down
Loading

0 comments on commit 5369b24

Please sign in to comment.