Skip to content

Commit

Permalink
Merge branch 'main' into refactoring_apr2024
Browse files Browse the repository at this point in the history
  • Loading branch information
rieder authored May 3, 2024
2 parents 9c4375c + defdae2 commit f08a70e
Show file tree
Hide file tree
Showing 58 changed files with 2,000 additions and 825 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines and UTF-8 everywhere
[*]
end_of_line = lf
trim_trailing_whitespace = true
charset = utf-8

# 2 space indentation
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
2 changes: 1 addition & 1 deletion .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- mpich
- openmpi
os:
- ubuntu-22.04
# - ubuntu-22.04
- ubuntu-20.04
# macOS is not ready yet - needs other setup of prerequisites
# - macos-12
Expand Down
109 changes: 28 additions & 81 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ worker_code.cc
worker_code.pyx
worker_code.f90
src/amuse/community/aarsethzare/aarsethzare_worker
src/amuse/community/aarsethzare/aarsethzare_c.f90
src/amuse/community/aarsethzare/worker_code.f90
src/amuse/community/adaptb/adaptb_worker
src/amuse/community/adaptb/src/integrator_MS.exe
Expand All @@ -61,6 +62,7 @@ src/amuse/community/bhtree/bhtree_worker
src/amuse/community/bhtree/build/
src/amuse/community/bhtree/worker_code.cc
src/amuse/community/bhtree/worker_code.h
src/amuse/community/bonsai2/src
src/amuse/community/bse/bse_worker
src/amuse/community/bse/src/bse
src/amuse/community/bse/worker_code.f90
Expand All @@ -83,6 +85,7 @@ src/amuse/community/evtwin/worker_code.f90src/amuse/community/evtwin/evtwin_work
src/amuse/community/evtwin/src/trunk/code/ev
src/amuse/community/evtwin/src/trunk/code/svn_version.f90
src/amuse/community/evtwin/src/trunk/code/twin
src/amuse/community/evtwin/src/trunk/lib/
src/amuse/community/fastkick/fastkick_worker
src/amuse/community/fastkick/interface.gpuo
src/amuse/community/fastkick/worker_code.cc
Expand Down Expand Up @@ -141,10 +144,14 @@ src/amuse/community/gadget2/build/
src/amuse/community/gadget2/build_nogravity/
src/amuse/community/gadget2/build_periodic/
src/amuse/community/gadget2/build_periodic_nogravity/
src/amuse/community/gadget2/build_normal/Gadget2
src/amuse/community/gadget2/build_normal/Makefile
src/amuse/community/gadget2/build_normal/makefile_options
src/amuse/community/gadget2/gadget2_worker
src/amuse/community/gadget2/gadget2_worker_nogravity
src/amuse/community/gadget2/gadget2_worker_periodic
src/amuse/community/gadget2/gadget2_worker_periodic_nogravity
src/amuse/community/gadget2/gadget2_worker_normal
src/amuse/community/gadget2/interface.ngo
src/amuse/community/gadget2/interface.pngo
src/amuse/community/gadget2/interface.po
Expand Down Expand Up @@ -188,9 +195,10 @@ src/amuse/community/halogen/halogen_worker
src/amuse/community/halogen/src/halogen4muse
src/amuse/community/halogen/worker_code.cc
src/amuse/community/halogen/worker_code.h
src/amuse/community/hermite0/hermite_worker
src/amuse/community/hermite0/worker_code.cc
src/amuse/community/hermite0/worker_code.h
src/amuse/community/hermite/hermite_worker
src/amuse/community/hermite/worker_code.cc
src/amuse/community/hermite/worker_code.h
src/amuse/community/hermite_grx/src
src/amuse/community/higpus/worker_code.cc
src/amuse/community/higpus/worker_code.h
src/amuse/community/hop/hop_worker
Expand Down Expand Up @@ -234,10 +242,14 @@ src/amuse/community/mmc/interface_specs.tmp
src/amuse/community/mmc/mmc_worker
src/amuse/community/mmc/src/amuse_interface2.f
src/amuse/community/mmc/worker_code.f90
src/amuse/community/mobse/src/mobse
src/amuse/community/mosse/mosse_c.f90
src/amuse/community/mosse/src/mosse
src/amuse/community/mocassin/worker_code.f90
src/amuse/community/mpiamrvac/worker_code.f90
src/amuse/community/nbody6xx/worker_code.f90
src/amuse/community/nbody6xx/nbody6xx_worker
src/amuse/community/petar/src
src/amuse/community/pikachu/worker_code.cc
src/amuse/community/pikachu/worker_code.h
src/amuse/community/ph4/interface.h
Expand All @@ -256,20 +268,14 @@ src/amuse/community/ph4/src/scheduler.gpuo
src/amuse/community/ph4/src/two_body.gpuo
src/amuse/community/ph4/src/util.gpuo
src/amuse/community/ph4/worker_code.cc
src/amuse/community/phiGRAPE/build/
src/amuse/community/phiGRAPE/build_mpi/
src/amuse/community/phiGRAPE/glworker_code.f90
src/amuse/community/phiGRAPE/interface.mpio
src/amuse/community/phiGRAPE/phigrape_worker
src/amuse/community/phiGRAPE/phigrape_worker_mpi
src/amuse/community/phiGRAPE/worker_code.f90
src/amuse/community/ramses/build/
src/amuse/community/ramses/worker_code.f90
src/amuse/community/ramses/build_1d/
src/amuse/community/ramses/build_2d/
src/amuse/community/ramses/ramses_worker
src/amuse/community/ramses/ramses_worker_1d
src/amuse/community/ramses/ramses_worker_2d
src/amuse/community/phantom/src
src/amuse/community/phigrape/build/
src/amuse/community/phigrape/build_mpi/
src/amuse/community/phigrape/glworker_code.f90
src/amuse/community/phigrape/interface.mpio
src/amuse/community/phigrape/phigrape_worker
src/amuse/community/phigrape/phigrape_worker_mpi
src/amuse/community/phigrape/worker_code.f90
src/amuse/community/rebound/worker_code.cc
src/amuse/community/rebound/worker_code.h
src/amuse/community/sakura/sakura_worker
Expand All @@ -280,9 +286,9 @@ src/amuse/community/seba/src/Makefile.inc
src/amuse/community/seba/worker_code.cc
src/amuse/community/seba/worker_code.h
src/amuse/community/seba/seba_worker
src/amuse/community/seba/src/dstar/Makefile.inc
src/amuse/community/seba/src/rdc/Makefile.inc
src/amuse/community/seba/src/starev
src/amuse/community/seba/src
src/amuse/community/secularmultiple/worker_code
src/amuse/community/secularmultiple/worker_code.cc
src/amuse/community/sei/sei_worker
src/amuse/community/sei/worker_code.cc
src/amuse/community/sei/worker_code.h
Expand All @@ -297,12 +303,10 @@ src/amuse/community/smalln/smallN_worker
src/amuse/community/smalln/src/f2c.co
src/amuse/community/smalln/src/nstab.co
src/amuse/community/smalln/worker_code.cc
src/amuse/community/smalln/smalln_cython.c
src/amuse/community/smalln/smalln_cython.pyx
src/amuse/community/smalln/smalln_worker_cython
src/amuse/community/sphray/sphray_worker
src/amuse/community/sphray/sphray_worker.f90
src/amuse/community/sse/src/sse
src/amuse/community/sse/sse_c.f90
src/amuse/community/sse/sse_worker
src/amuse/community/sse/worker_code.f90
src/amuse/community/twobody/twobody_worker
Expand Down Expand Up @@ -347,56 +351,8 @@ doc/amuse_examples
/nbody6xx.input
/test_results
autom4te.cache/
src/amuse/community/hermite0/hermite0_cython.c
src/amuse/community/hermite0/hermite0_cython.pyx
src/amuse/community/hermite0/hermite0_worker
src/amuse/community/hermite0/hermite0_worker_cython
src/amuse/community/huayno/huayno_cython.c
src/amuse/community/huayno/huayno_cython.pyx
src/amuse/community/huayno/huayno_worker_cython
src/amuse/community/kepler/kepler_cython.cc
src/amuse/community/kepler/kepler_cython.pyx
src/amuse/community/kepler/kepler_worker_cython
src/amuse/community/rebound/rebound_cython.cc
src/amuse/community/rebound/rebound_cython.pyx
src/amuse/community/rebound/rebound_worker_cython
src/amuse/community/seba/seba_cython.cc
src/amuse/community/seba/seba_cython.pyx
src/amuse/community/seba/seba_worker_cython
src/amuse/community/bhtree/bhtree_cython.c
src/amuse/community/bhtree/bhtree_cython.pyx
src/amuse/community/bhtree/bhtree_worker_cython
src/amuse/community/aarsethzare/aarsethzare_c.f90
src/amuse/community/aarsethzare/aarsethzare_cython.c
src/amuse/community/aarsethzare/aarsethzare_cython.pyx
src/amuse/community/aarsethzare/aarsethzare_worker_cython
lib/sapporo_2/src/sapporo2-master
lib/sapporo_2/src/master.tgz
src/amuse/community/athena/athena_worker_cython
src/amuse/community/gadget2/build_normal/Gadget2
src/amuse/community/gadget2/build_normal/Makefile
src/amuse/community/gadget2/build_normal/makefile_options
src/amuse/community/gadget2/gadget2_cython_nogravity.c
src/amuse/community/gadget2/gadget2_cython_nogravity.pyx
src/amuse/community/gadget2/gadget2_cython_normal.c
src/amuse/community/gadget2/gadget2_cython_normal.pyx
src/amuse/community/gadget2/gadget2_cython_periodic.c
src/amuse/community/gadget2/gadget2_cython_periodic.pyx
src/amuse/community/gadget2/gadget2_cython_periodic_nogravity.c
src/amuse/community/gadget2/gadget2_cython_periodic_nogravity.pyx
src/amuse/community/gadget2/gadget2_worker_cython_nogravity
src/amuse/community/gadget2/gadget2_worker_cython_normal
src/amuse/community/gadget2/gadget2_worker_cython_periodic
src/amuse/community/gadget2/gadget2_worker_cython_periodic_nogravity
src/amuse/community/gadget2/gadget2_worker_normal
src/amuse/community/huayno/huayno_worker_cython_mp
src/amuse/community/sse/sse_c.f90
src/amuse/community/sse/sse_cython.c
src/amuse/community/sse/sse_cython.pyx
src/amuse/community/sse/sse_worker_cython
src/amuse/community/secularmultiple/worker_code
src/amuse/community/secularmultiple/worker_code.cc




Expand Down Expand Up @@ -457,12 +413,6 @@ test_results/interface.f90
job_server
plummer_back_100.ini
pythonexe
src/amuse/community/evtwin/src/trunk/lib/
src/amuse/community/mobse/src/mobse
src/amuse/community/mosse/mosse_c.f90
src/amuse/community/mosse/mosse_cython.c
src/amuse/community/mosse/mosse_cython.pyx
src/amuse/community/mosse/src/mosse
test/core_tests/test.txt
test_concurrent
test_python_sockets_implementation
Expand All @@ -483,16 +433,13 @@ test_python_sockets_implementation

.idea

src/amuse/community/bonsai2/src
doc/interactive_tutorial/_version.py
src/amuse/test/suite/_version.py
src/amuse/community/*/_version.py
src/amuse/_version.py
src/amuse/community/petar/src
src/amuse/community/seba/src
packages/amuse*/dist
packages/dist
src/amuse/community/phantom/src


# standard directory for a virtualenv
env/
5 changes: 4 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
version: 2

# Build documentation in the docs/ directory with Sphinx
build:
os: ubuntu-22.04
tools:
python: "3.7"
sphinx:
configuration: doc/conf.py

Expand All @@ -18,6 +22,5 @@ formats: []

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc/requirements.txt
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ authors:
family-names: McMillan
given-names: Steve
-
affiliation: "Université de Genève"
affiliation: "KU Leuven"
family-names: Rieder
given-names: Steven
orcid: "https://orcid.org/0000-0003-3688-5798"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ in the package.
* Has the code been tested against previously existing codes in the same domain?

**Code Quality**
* Is the code compatible with Python >=2.7?
* Is the code compatible with Python >=3.7?
* Are there dependencies other than AMUSE, MPI, the Python Standard
Library, and NumPy?
* For compatibility reasons we prefer code that also works on older
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/stellar_dynamics_interface_specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ functions must get or set one scalar property (1 argument) or a vector property


.. autoclass:: amuse.community.interface.gd.GravitationalDynamicsInterface
:members: get_mass, set_mass, get_position, set_position, set_acceleration, get_acceleration, get_potential
:members: get_mass, set_mass, get_position, set_position, get_acceleration, get_potential


Model evolution
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ matplotlib
pandoc
rst2pdf
Sphinx>=3.0
sphinx-rtd-theme==0.5.2
sphinx-rtd-theme
2 changes: 0 additions & 2 deletions doc/tutorial/simplegrav/interface_1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ int get_total_radius (double *radius) { return -2; }

int get_acceleration (int index_of_the_particle, double *ax, double *ay, double *az) { return -2; }

int set_acceleration (int index_of_the_particle, double ax, double ay, double az) { return -2; }

int get_potential (int index_of_the_particle, double *potential) { return -2; }

int get_kinetic_energy (double *kinetic_energy) { return -1; }
Expand Down
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
setuptools>=65
setuptools_scm>=6
wheel>=0.30
docutils>=0.18
numpy>=1.18
pytest>=3.0
mpi4py>=3.0
h5py>=3.0
# These are requirements for the AMUSE framework. Other versions *might* be ok.
setuptools >= 65, < 70
setuptools_scm >= 6
wheel >= 0.30
docutils >= 0.18
numpy >= 1.18
pytest >= 3.0
mpi4py >= 3.0
h5py >= 3.0
26 changes: 18 additions & 8 deletions src/amuse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,49 @@
or (directly from the terminal):
> pydoc amuse.ic
"""

import sys
import os
import numpy

_AMUSE_ROOT = os.path.abspath(os.path.dirname(__file__))


def numpy_fix():
try:
numpy.set_printoptions(legacy='1.13')
numpy.set_printoptions(legacy="1.13")
except TypeError:
pass



numpy_fix()

class NoConfig(object):

class NoConfig:
def __init__(self, message):
self._message=message
self._message = message

def __getattr__(self, attr):
raise AttributeError(self._message)


try:
from . import config
except Exception as ex:
message="Configuration not read in - or configuration invalid, exception:\n"+str(ex)
config=NoConfig(message)
except FileNotFoundError as ex:
message = (
"Configuration not read in - or configuration invalid, exception:\n" + str(ex)
)
config = NoConfig(message)


# always report AMUSE reference information
try:
from amuse.support.literature import TrackLiteratureReferences

TrackLiteratureReferences.default()
except:
pass


def get_data(path):
return os.path.join(_AMUSE_ROOT, 'data', path)
return os.path.join(_AMUSE_ROOT, "data", path)
1 change: 0 additions & 1 deletion src/amuse/community/adaptb/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,5 +443,4 @@ int get_kinetic_energy(double* ek){return -2;}
int get_potential_energy(double* ep){return -2;}
int get_center_of_mass_velocity(double* vx, double* vy, double* vz){return -2;}
int get_acceleration(int id, double* ax, double* ay, double* az){return -2;}
int set_acceleration(int id, double ax, double ay, double az){return -2;}

Loading

0 comments on commit f08a70e

Please sign in to comment.