Skip to content

Commit

Permalink
fix: fixed scipy dependency and noxfile cleanup (#47)
Browse files Browse the repository at this point in the history
* fix: fixed scipy dependency and noxfile cleanup

* fix: add precommit

* fix: make pre-commit pass

* chore: bump version to 1.0.10

* fix: wrong version
  • Loading branch information
f3rmion authored Sep 14, 2023
1 parent 34bad57 commit b65ef42
Show file tree
Hide file tree
Showing 51 changed files with 1,457 additions and 389 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/black.yml

This file was deleted.

20 changes: 10 additions & 10 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox --sessions tests-3.8 coverage
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ["3.10", "3.11"]
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox --sessions tests-3.8 coverage
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ['3.8']
python-version: ["3.10", "3.11"]
name: Python ${{ matrix.python-version }} OS ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox
52 changes: 52 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
exclude: .github
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
hooks:
- id: prettier
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Expand Down
22 changes: 8 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ evaluating changes, and helping you handle your pull requests.

## Reporting a Bug

A bug is a *demonstratable problem* caused by the code in this repository.
A bug is a _demonstratable problem_ caused by the code in this repository.

Before opening a bug report:

Expand All @@ -23,7 +23,6 @@ A good bug report should not leave others needing to chase you up for more
information. So please try to be as detailed as possible in your report,
answer at least these questions:


1. Which version of `kallisto` are you using? The current version is always
a subject to change, so be more specific.
2. What is your environment (your laptop, the cluster of the university)?
Expand All @@ -34,46 +33,41 @@ answer at least these questions:

All these details will help people to fix any potential bugs.


## Suggesting a New Feature

Feature requests are welcome. But take a moment to find out if your idea fits
the scope and goals of the project. It is up to you to provide a strong
argument to convince the project's developers of the benefits of this feature.
Please provide as much detail and context as possible.


## Implementing a New Feature


Contributions are welcome via Github pull requests.


- Each pull request should implement *one* feature or fix *one* bug.
- Each pull request should implement _one_ feature or fix _one_ bug.
If you want to add or fix more than one thing, submit more than one
pull request.
- Do not commit changes to files that are irrelevant to your feature or
bugfix (*e.g.* `.gitignore`).
bugfix (_e.g._ `.gitignore`).
- Be willing to accept criticism and work on improving your code.
- Do not add third-party dependencies, the `kallisto` program should be usable as
standalone.
- Make sure the tests run successful on more than
your local machine (*e.g.* on cluster of your university).
your local machine (_e.g._ on cluster of your university).

Please sign-off your commits



### For New Contributors

If you never created a pull request before you can learn how to do this
If you never created a pull request before you can learn how to do this
from [this great tutorial](https://app.egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)

Don't know where to start?
You can start by looking through these [help-wanted issues](https://github.com/f3rmion/kallisto/labels/help%20wanted).

## Sign Your Work

The sign-off is a simple line at the end of the explanation for a commit. All
The sign-off is a simple line at the end of the explanation for a commit. All
commits needs to be signed. Your signature certifies that you wrote the patch or
otherwise have the right to contribute the material. The rules are pretty simple,
if you can certify the below (from [developercertificate.org](https://developercertificate.org/)):
Expand Down
54 changes: 25 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@

# Introduction

We developed the `kallisto` program for the efficient and robust calculation of atomic features using molecular geometries either in a ``xmol`` or a ``Turbomole`` format.
Furthermore, several modelling tools are implemented, e.g., to calculate root-mean squared deviations via quaternions (including rotation matrices), sorting of molecular geometries and many more. All features of ``kallisto`` are described in detail within our [documentation](https://ehjc.gitbook.io/kallisto/) ([GitBook repository](https://github.com/f3rmion/gitbook-kallisto)).
We developed the `kallisto` program for the efficient and robust calculation of atomic features using molecular geometries either in a `xmol` or a `Turbomole` format.
Furthermore, several modelling tools are implemented, e.g., to calculate root-mean squared deviations via quaternions (including rotation matrices), sorting of molecular geometries and many more. All features of `kallisto` are described in detail within our [documentation](https://ehjc.gitbook.io/kallisto/) ([GitBook repository](https://github.com/f3rmion/gitbook-kallisto)).

Main dependencies
-----------------
## Main dependencies

```bash
click 7.1.2 Composable command line interface toolkit
Expand All @@ -43,101 +42,100 @@ scipy 1.6.0 SciPy: Scientific Library for Python

For a list of all dependencies have a look at the pyproject.toml file.

Installation from PyPI
----------------------
## Installation from PyPI

To install `kallisto` via `pip` use our published PyPI package

To install ``kallisto`` via `pip` use our published PyPI package
```bash
pip install kallisto
```

Installation from Source
------------------------
## Installation from Source

Requirements to install `kallisto`from sources:

Requirements to install ``kallisto``from sources:
- [poetry](https://python-poetry.org/docs/#installation)
- [pyenv](https://github.com/pyenv/pyenv#installation) or [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)
- python >=3.7

First check that ``poetry`` is running correctly (v1.0.10 at the time of writing)
First check that `poetry` is running correctly (v1.0.10 at the time of writing)

```bash
> poetry --version
Poetry version 1.0.10
```

Create a virtual environment (via ``pyenv`` or ``conda``) and activate it. Afterwards, clone the ``kallisto`` project from GitHub and install it using ``poetry``
Create a virtual environment (via `pyenv` or `conda`) and activate it. Afterwards, clone the `kallisto` project from GitHub and install it using `poetry`

```bash
> git clone [email protected]:AstraZeneca/kallisto.git
> cd kallisto
> poetry install
```

Testing suite
-------------
## Testing suite

The ``kallisto`` project uses [nox](https://nox.thea.codes/en/stable/tutorial.html#installation) as an automated unit test suite, which is therefore an additional dependency.
The `kallisto` project uses [nox](https://nox.thea.codes/en/stable/tutorial.html#installation) as an automated unit test suite, which is therefore an additional dependency.

### Default nox session

The default session includes: linting (lint), type checks (mypy, pytype), and unit tests (tests).
The default session includes: linting (lint), type checks (mypy, pytype), and unit tests (tests).

```bash
> nox
```

When everything runs smoothly through, you are ready to go! After one successful nox run, we can reuse the created virtual environment via the ``-r`` flag.
When everything runs smoothly through, you are ready to go! After one successful nox run, we can reuse the created virtual environment via the `-r` flag.

```bash
> nox -r
```

Different unit test sessions are implemented (check the noxfile.py). They can be called separately via the run session ``-rs`` flag.
Different unit test sessions are implemented (check the noxfile.py). They can be called separately via the run session `-rs` flag.

### Tests

Run all unit tests that are defined in the /tests directory.

```bash
```bash
> nox -rs tests
```

### Lint

``kallisto`` uses the [flake8](https://flake8.pycqa.org/en/latest/) linter (check the .flake8 config file).
`kallisto` uses the [flake8](https://flake8.pycqa.org/en/latest/) linter (check the .flake8 config file).

```bash
> nox -rs lint
```

### Black

``kallisto`` uses the [black](https://github.com/psf/black) code formatter.
`kallisto` uses the [black](https://github.com/psf/black) code formatter.

```bash
```bash
> nox -rs black
```

### Safety

``kallisto`` checks the security of dependencies via [safety](https://pyup.io/safety/).
`kallisto` checks the security of dependencies via [safety](https://pyup.io/safety/).

```bash
> nox -rs safety
```

### Mypy

``kallisto`` checks for static types via [mypy](https://github.com/python/mypy) (check the mypy.ini config file).
`kallisto` checks for static types via [mypy](https://github.com/python/mypy) (check the mypy.ini config file).

```bash
> nox -rs mypy
```

### Pytype

``kallisto`` furthermore uses [pytype](https://github.com/google/pytype) for type checks.
`kallisto` furthermore uses [pytype](https://github.com/google/pytype) for type checks.

```bash
> nox -rs pytype
Expand All @@ -147,17 +145,15 @@ Run all unit tests that are defined in the /tests directory.

Unit test [coverage](https://coverage.readthedocs.io/en/coverage-5.4/) can be checked as well.


```bash
> nox -rs coverage
```

Reference
---------
## Reference

Always cite:

Eike Caldeweyher, J. Open Source Softw., *2021*, 6, 3050. DOI: [10.21105/joss.03050](https://doi.org/10.21105/joss.03050)
Eike Caldeweyher, J. Open Source Softw., _2021_, 6, 3050. DOI: [10.21105/joss.03050](https://doi.org/10.21105/joss.03050)

```
@article{Caldeweyher2021,
Expand Down
Loading

0 comments on commit b65ef42

Please sign in to comment.