Closed hannorein closed 5 years ago
I am also trying to define a style and naming convention for functions and variables. I don't plant to implement this across the entire codebase right now, but it can serve as a reverence whenever a particular module gets updated. Some of this takes inspiration from PEP8. The C and python syntax should be as close as possible. I will put the final conventions in the documentation, but post it here first in case anyone has any suggestions.
Functions (c):
reb_
reb_simulation_create()
and reb_simulation_free()
reb_integrator_whfast_kepler_step()
. This might get long, but note that this is only really required for functions intended for general use. Internal functions can be static and do not need to include the prefix.Variables (c):
reb_
prefix.N
is capitalized.Objects (python):
reb_
prefix. For example struct reb_particle
is Particle
.reb_
prefix and the noun
from the corresponding c function. For example reb_simulation_move_to_com()
becomes Simulation.move_to_com()
. Specific function names (c):
reb_simulation_create()
reb_integrator_ias15_reset()
.Header files (c):
rebound.h
.integrator_whfast.h
. Indentation:
Closed via a1e1b73a
I'm working on an update to the Hybrid Symplectic Integrator in REBOUND. Currently there are two of these integrators MERCURIUS and HERMES. It now seems more and more as if there is no case where HERMES is superior to MERCURIUS. I will therefore remove HERMES to avoid confusion and help maintainability. There will also be a few minor syntax changes for MERCURIUS. Also, MERCURIUS will work more reliably in simulations where physical collisions might occur. The current development is done on the
mercuriusrelease
branch.