Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
86a2a6b
Create pylint.yml
rieder Apr 15, 2021
c53df79
Create python-package.yml
rieder Apr 15, 2021
6dc0e6a
Update pylint.yml
rieder Apr 15, 2021
1e6d4c3
Merge branch 'main' of github.com:amusecode/amuse into rieder-main
rieder Apr 22, 2021
0aa7171
Update python-package.yml
rieder Apr 22, 2021
1556132
Merge branch 'main' into rieder-main
rieder Apr 22, 2021
876dd5c
Merge branch 'main' of github.com:rieder/amuse into rieder-main
rieder Apr 22, 2021
ca63efd
Update pylint.yml
rieder Apr 22, 2021
2edc295
Update pylint.yml
rieder Apr 22, 2021
8a64e2e
Update pylint.yml
rieder May 11, 2021
85ef0f8
Update pylint.yml
rieder May 11, 2021
ebe8e9e
Update pylint.yml
rieder May 11, 2021
a5005e2
Update pylint.yml
rieder May 11, 2021
8d9efc2
Update pylint.yml
rieder May 11, 2021
9ad9623
Update pylint.yml
rieder May 11, 2021
f2eac55
Update pylint.yml
rieder May 11, 2021
942c9f4
Test change
rieder May 11, 2021
4820e85
Update and rename pylint.yml to lint.yml
rieder May 11, 2021
4a70e64
Update lint.yml
rieder May 11, 2021
05087ec
Innocent change
rieder May 11, 2021
a52c2ee
Update plot.py
rieder May 11, 2021
3ac3b6b
Update lint.yml
rieder May 11, 2021
4a1bfb9
Update lint.yml
rieder May 11, 2021
a3adec0
Update lint.yml
rieder May 11, 2021
b7af2a7
Update lint.yml
rieder May 11, 2021
3a4ab42
Update lint.yml
rieder May 11, 2021
62398f5
Update plot.py
rieder May 11, 2021
c85d728
Merge branch 'main' into rieder-patch-1
rieder May 11, 2021
c705c56
Update lint.yml
rieder May 11, 2021
ab783ee
Update plot.py
rieder May 11, 2021
6ef715a
Update plot.py
rieder May 11, 2021
356d444
Update plot.py
rieder May 11, 2021
7640313
Delete plot.py
rieder May 11, 2021
7ceaefd
Update codes.py
rieder May 11, 2021
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
51 changes: 51 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pylint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
py-version:
#- 3.5
#- 3.6
- 3.7
#- 3.8
#- 3.9
py-arch:
- x64
mpi:
#- mpich
- openmpi
os:
- ubuntu-latest
#- ubuntu-18.04
#- ubuntu-20.04
#- macos-10.15
#- macos-latest

steps:
- uses: actions/checkout@v2
- uses: jitterbit/get-changed-files@v1
id: files
with:
format: space-delimited
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
architecture: ${{ matrix.py-arch }}
- name: Install dependencies
run: python -m pip install pylint
- name: Analysing the code with pylint
run: |
pylint ${{ steps.files.outputs.added_modified }}
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
30 changes: 16 additions & 14 deletions src/amuse/codes.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@

"""AMUSE codes
"""
import sys

_CODES = [
'athena', 'capreole', 'cachedse', 'gadget2', 'mesa', 'octgrav', 'twobody',
'capreole', 'hermite0', 'mocassin', 'phiGRAPE',
'athena', 'evtwin', 'hop', 'seba',
'bhtree', 'evtwin2sse', 'interface', 'smallN',
'bse', 'fi', 'mercury', 'sse',
'athena', 'capreole', 'cachedse', 'gadget2', 'mesa',
'octgrav', 'twobody', 'capreole', 'hermite0', 'mocassin',
'phiGRAPE', 'athena', 'evtwin', 'hop', 'seba',
'bhtree', 'evtwin2sse', 'interface', 'smallN', 'bse',
'fi', 'mercury', 'sse',
]

__all__ = []


def _import_modules():

for x in _CODES:
modulename = 'amuse.legacy.' + x + '.interface'
for code in _CODES:
modulename = 'amuse.legacy.' + code + '.interface'
try:
__import__(modulename)
globals()[x] = sys.modules[modulename]
__all__.append(x)
globals()[code] = sys.modules[modulename]
__all__.append(code)
except ImportError as ex:
modulename = 'amuse.legacy.' + x + '.' + x
modulename = 'amuse.legacy.' + code + '.' + code
try:
__import__(modulename)
globals()[x] = sys.modules[modulename]
__all__.append(x)
globals()[code] = sys.modules[modulename]
__all__.append(code)
except ImportError as ex:
pass


_import_modules()

Loading