Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2940593
Produce pkgconfig info for libpyorbit.
woodtp Jun 18, 2026
e1b6ad2
Fix runtime dlopen errors by decoupling PyORBIT core logic from wrapp…
woodtp Jun 19, 2026
b4f9a7b
Restore comments and deleted header that I thought wasn't necessary.
woodtp Jun 19, 2026
401b388
attempt to fix linking on linux
woodtp Jun 19, 2026
da49351
fix(bunch): retain MPI communicator ownership
woodtp Sep 11, 2026
9dc6c51
build(core): package standalone core library
woodtp Sep 11, 2026
d4f62b1
refactor(headers): use canonical include paths
woodtp Sep 11, 2026
6398ee0
refactor(core): isolate MPI and SyncPart from Python
woodtp Sep 11, 2026
085ba0c
refactor(bunch): move wrapper identity to bindings
woodtp Sep 11, 2026
80f9767
refactor(trackerrk4): detach tracker from Python
woodtp Sep 11, 2026
16ec89e
refactor(utils): remove unused Python wrapper state
woodtp Sep 11, 2026
30a1cab
refactor(linac): remove unused Python wrapper state
woodtp Sep 11, 2026
67b5fc4
refactor(rfcavities): remove Python wrapper state
woodtp Sep 11, 2026
fe472fe
refactor(bunch): detach analysis helpers from Python
woodtp Sep 11, 2026
2672132
refactor(tracking): remove unused Python wrapper state
woodtp Sep 11, 2026
da05516
refactor(spacecharge): detach solver bases from Python
woodtp Sep 11, 2026
424b726
refactor(spacecharge): remove calculator wrapper state
woodtp Sep 11, 2026
111defa
refactor(impedances): remove wrapper state
woodtp Sep 11, 2026
75358f7
refactor(apertures): remove element wrapper state
woodtp Sep 11, 2026
483da48
refactor(spacecharge): make grid ownership explicit
woodtp Sep 11, 2026
e76b46a
refactor(fields): move ownership to bindings
woodtp Sep 11, 2026
0174d93
fix(fields): initialize transform copy indices
woodtp Sep 11, 2026
56cbb3e
refactor(rk4): move effect ownership to bindings
woodtp Sep 11, 2026
90b6d53
fix(rk4): pass preparation time to callback
woodtp Sep 11, 2026
569835e
refactor(apertures): move shape ownership to bindings
woodtp Sep 11, 2026
46379ca
refactor(spacecharge): move ellipsoid ownership to bindings
woodtp Sep 11, 2026
18f65ff
refactor(core): remove obsolete Python wrapper base
woodtp Sep 11, 2026
1701713
build(core): make Python bindings optional
woodtp Sep 13, 2026
82c3c9d
fix(style): restore consistent CRLF endings
woodtp Sep 13, 2026
a70d308
fix(orbit): include C string declarations
woodtp Sep 13, 2026
526cba1
refactor(core): qualify standard library symbols
woodtp Sep 13, 2026
86f95f4
fix(utils): qualify elliptic integral math
woodtp Sep 13, 2026
e68cd46
bump python version
woodtp Sep 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pyorbit
channels:
- conda-forge
dependencies:
- python=3.10
- python>=3.11
- fftw
- numpy
- scipy
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ project('PyORBIT',
)

subdir('src')
subdir('py/orbit')
if get_option('BUILD_PYTHON')
subdir('py/orbit')
endif
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
option('USE_MPI', type: 'string', value: 'auto', description: 'Choose MPI implementation (mpich, openmpi, none, auto)')
option('BUILD_PYTHON', type: 'boolean', value: true, description: 'Build and install Python bindings')
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = ['meson-python', "setuptools>=45", "wheel", "setuptools_scm"]
name = 'PyORBIT'
dynamic = ["version"]
description = 'Use meson-python to build c++ anf python modules.'
requires-python = '>=3.9'
requires-python = '>=3.11'
#dependencies = [
#'setuptools',
#'setuptools-scm'
Expand Down
2 changes: 1 addition & 1 deletion src/core/aperture_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_aperture.hh"
#include "orbit/Apertures/wrap_aperture.hh"
PyMODINIT_FUNC PyInit_aperture(void) {
return wrap_aperture::initaperture();
}
2 changes: 1 addition & 1 deletion src/core/bunch_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_bunch.hh"
#include "orbit/wrap_bunch.hh"
PyMODINIT_FUNC PyInit_bunch(void) {
return wrap_orbit_bunch::initbunch();
}
2 changes: 1 addition & 1 deletion src/core/collimator_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# include "wrap_collimator.hh"
# include "orbit/MaterialInteractions/wrap_collimator.hh"
PyMODINIT_FUNC PyInit_collimator(void) {
return wrap_collimator::initcollimator();
}
2 changes: 1 addition & 1 deletion src/core/error_base_init.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <Python.h>
# include "wrap_errorbase.hh"
# include "orbit/Errors/wrap_errorbase.hh"
PyMODINIT_FUNC PyInit_error_base(void) {
return wrap_errorbase::initerrorbase();
}
2 changes: 1 addition & 1 deletion src/core/field_sources_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_field_sources_module.hh"
#include "utils/field_sources/wrap_field_sources_module.hh"
PyMODINIT_FUNC PyInit_field_sources(void) {
return wrap_field_sources_module::initFieldSourcesModule();
}
2 changes: 1 addition & 1 deletion src/core/fieldtracker_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_fieldtracker.hh"
#include "orbit/FieldTracker/wrap_fieldtracker.hh"
PyMODINIT_FUNC PyInit_fieldtracker(void) {
return wrap_fieldtracker::initfieldtracker();
}
2 changes: 1 addition & 1 deletion src/core/foil_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_foil.hh"
#include "orbit/MaterialInteractions/wrap_foil.hh"
PyMODINIT_FUNC PyInit_foil(void) {
return wrap_foil::initfoil();
}
2 changes: 1 addition & 1 deletion src/core/impedances_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_impedances.hh"
#include "orbit/Impedances/wrap_impedances.hh"
PyMODINIT_FUNC PyInit_impedances(void) {
return wrap_impedances::initimpedances();
}
2 changes: 1 addition & 1 deletion src/core/linac_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_linacmodule.hh"
#include "linac/wrap_linacmodule.hh"
PyMODINIT_FUNC PyInit_linac(void) {
return wrap_linac::initlinac();
}
6 changes: 3 additions & 3 deletions src/core/mpi_init.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Python.h"
#include "wrap_orbit_mpi.hh"
#include <Python.h>
#include "mpi/wrap_orbit_mpi.hh"

PyMODINIT_FUNC PyInit_orbit_mpi(void) {
return wrap_orbit_mpi::initorbit_mpi();
}
}
2 changes: 1 addition & 1 deletion src/core/rfcavities_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_rfcavities.hh"
#include "orbit/RFCavities/wrap_rfcavities.hh"
PyMODINIT_FUNC PyInit_rfcavities(void) {
return wrap_rfcavities::initrfcavities();
}
2 changes: 1 addition & 1 deletion src/core/spacecharge_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_spacecharge.hh"
#include "spacecharge/wrap_spacecharge.hh"
PyMODINIT_FUNC PyInit_spacecharge(void) {
return initspacecharge();
}
6 changes: 3 additions & 3 deletions src/core/teapot_base_init.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <Python.h>
#include "wrap_orbit_mpi.hh"
#include "wrap_teapotbase.hh"
#include "wrap_errorbase.hh"
#include "mpi/wrap_orbit_mpi.hh"
#include "teapot/wrap_teapotbase.hh"
#include "orbit/Errors/wrap_errorbase.hh"

PyMODINIT_FUNC PyInit_teapot_base(void) {
return wrap_teapotbase::initteapotbase();
Expand Down
2 changes: 1 addition & 1 deletion src/core/trackerrk4_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_trackerrk4.hh"
#include "trackerrk4/wrap_trackerrk4.hh"
PyMODINIT_FUNC PyInit_trackerrk4(void) {
return inittrackerrk4();
}
68 changes: 68 additions & 0 deletions src/core/type_accessors.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include <Python.h>

#include "orbit/wrap_bunch.hh"
#include "spacecharge/wrap_spacecharge.hh"
#include "mpi/wrap_mpi_comm.hh"
#include "utils/wrap_utils.hh"
#include "trackerrk4/wrap_trackerrk4.hh"

extern "C" {

namespace {

PyObject* getModuleAttribute(const char* module_name, const char* name){
PyObject* module = PyImport_ImportModule(module_name);
if(module == NULL){
return NULL;
}
PyObject* attribute = PyDict_GetItemString(PyModule_GetDict(module), name);
Py_DECREF(module);
if(attribute == NULL){
PyErr_Format(PyExc_AttributeError, "module '%s' has no attribute '%s'", module_name, name);
}
return attribute;
}

}

namespace wrap_orbit_bunch {

PyObject* getBunchType(const char* name){
return getModuleAttribute("orbit.core.bunch", name);
}

}

PyObject* getSpaceChargeType(const char* name){
return getModuleAttribute("orbit.core.spacecharge", name);
}

namespace wrap_orbit_mpi_comm {

PyObject* getMPI_CommType(const char* name){
PyObject* mpi_comm_module = getModuleAttribute("orbit.core.orbit_mpi", "mpi_comm");
if(mpi_comm_module == NULL){
return NULL;
}
PyObject* type = PyDict_GetItemString(PyModule_GetDict(mpi_comm_module), name);
if(type == NULL){
PyErr_Format(PyExc_AttributeError, "module 'mpi_comm' has no attribute '%s'", name);
}
return type;
}

}

namespace wrap_orbit_utils {

PyObject* getOrbitUtilsType(const char* name){
return getModuleAttribute("orbit.core.orbit_utils", name);
}

}

PyObject* getTrackerRK4Type(const char* name){
return getModuleAttribute("orbit.core.trackerrk4", name);
}

}
2 changes: 1 addition & 1 deletion src/core/utils_init.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wrap_utils.hh"
#include "utils/wrap_utils.hh"
PyMODINIT_FUNC PyInit_orbit_utils(void) {
return wrap_orbit_utils::initutils();
}
12 changes: 6 additions & 6 deletions src/linac/rfgap/BaseRfGap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ A. Shishlo, J. Holmes,
ORNL Tech. Note ORNL/TM-2015/247, June 2015
*/

#include "BaseRfGap.hh"
#include "ParticleMacroSize.hh"
#include "linac/rfgap/BaseRfGap.hh"
#include "orbit/ParticlesAttributes/ParticleMacroSize.hh"

#include <iostream>
#include <cmath>

#include "Bunch.hh"
#include "bessel.hh"
#include "OrbitConst.hh"
#include "orbit/Bunch.hh"
#include "utils/bessel.hh"
#include "orbit/OrbitConst.hh"

using namespace OrbitUtils;

// Constructor
BaseRfGap::BaseRfGap(): CppPyWrapper(NULL)
BaseRfGap::BaseRfGap()
{
}

Expand Down
9 changes: 3 additions & 6 deletions src/linac/rfgap/BaseRfGap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@
#define BASE_RF_GAP_H

//MPI Function Wrappers
#include "orbit_mpi.hh"
#include "wrap_mpi_comm.hh"
#include "mpi/orbit_mpi.hh"

#include <cstdlib>
#include <cmath>

//ORBIT bunch
#include "Bunch.hh"
#include "orbit/Bunch.hh"

//pyORBIT utils
#include "CppPyWrapper.hh"

using namespace std;

/**
This class represents a 2D rectangular grid.
*/

class BaseRfGap: public OrbitUtils::CppPyWrapper
class BaseRfGap
{
public:

Expand Down
12 changes: 6 additions & 6 deletions src/linac/rfgap/BaseRfGap_slow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ so the name of the class has the word slow in the name.

*/

#include "BaseRfGap_slow.hh"
#include "ParticleMacroSize.hh"
#include "linac/rfgap/BaseRfGap_slow.hh"
#include "orbit/ParticlesAttributes/ParticleMacroSize.hh"

#include <iostream>
#include <cmath>

#include "Bunch.hh"
#include "bessel.hh"
#include "OrbitConst.hh"
#include "orbit/Bunch.hh"
#include "utils/bessel.hh"
#include "orbit/OrbitConst.hh"

using namespace OrbitUtils;

// Constructor
BaseRfGap_slow::BaseRfGap_slow(): CppPyWrapper(NULL)
BaseRfGap_slow::BaseRfGap_slow()
{
}

Expand Down
9 changes: 3 additions & 6 deletions src/linac/rfgap/BaseRfGap_slow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,22 @@
#define BASE_RF_GAP_SLOW_H

//MPI Function Wrappers
#include "orbit_mpi.hh"
#include "wrap_mpi_comm.hh"
#include "mpi/orbit_mpi.hh"

#include <cstdlib>
#include <cmath>

//ORBIT bunch
#include "Bunch.hh"
#include "orbit/Bunch.hh"

//pyORBIT utils
#include "CppPyWrapper.hh"

using namespace std;

/**
This class represents a 2D rectangular grid.
*/

class BaseRfGap_slow: public OrbitUtils::CppPyWrapper
class BaseRfGap_slow
{
public:

Expand Down
12 changes: 6 additions & 6 deletions src/linac/rfgap/MatrixRfGap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ A. Shishlo, J. Holmes,
ORNL Tech. Note ORNL/TM-2015/247, June 2015
*/

#include "MatrixRfGap.hh"
#include "ParticleMacroSize.hh"
#include "linac/rfgap/MatrixRfGap.hh"
#include "orbit/ParticlesAttributes/ParticleMacroSize.hh"

#include "Bunch.hh"
#include "bessel.hh"
#include "OrbitConst.hh"
#include "orbit/Bunch.hh"
#include "utils/bessel.hh"
#include "orbit/OrbitConst.hh"

#include <iostream>
#include <cmath>

using namespace OrbitUtils;

// Constructor
MatrixRfGap::MatrixRfGap(): CppPyWrapper(NULL)
MatrixRfGap::MatrixRfGap()
{
}

Expand Down
9 changes: 3 additions & 6 deletions src/linac/rfgap/MatrixRfGap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,22 @@ For this RF gap we know the E0TL, frequency, and phase only.
#define MATRIX_RF_GAP_H

//MPI Function Wrappers
#include "orbit_mpi.hh"
#include "wrap_mpi_comm.hh"
#include "mpi/orbit_mpi.hh"

#include <cstdlib>
#include <cmath>

//ORBIT bunch
#include "Bunch.hh"
#include "orbit/Bunch.hh"

//pyORBIT utils
#include "CppPyWrapper.hh"

using namespace std;

/**
This class represents a RF gap as transport matrix. No nonlinear effects.
*/

class MatrixRfGap: public OrbitUtils::CppPyWrapper
class MatrixRfGap
{
public:

Expand Down
Loading
Loading