Skip to content

Commit fdf0468

Browse files
committed
This compiles, but does not run
This compiles, i.e. "./setup install sapporo_light" and "./setup install amuse-ph4" will complete without error. However, Erwan's script with an additional "print(f"{code.get_nj_max() = }, ")" will yield " TypeError: ph4Interface.get_nj_max() takes 0 positional arguments but 1 was given "
1 parent 7c9bb63 commit fdf0468

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/amuse_ph4/interface.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,3 +936,10 @@ int get_id_of_updated_particle(int index, int * index_of_particle, int * status)
936936
*status = jd->UpdatedParticles[index].status;
937937
return 0;
938938
}
939+
940+
extern "C" int g6_get_nj_max_();
941+
942+
int get_nj_max()
943+
{
944+
return g6_get_nj_max_();
945+
}

src/amuse_ph4/interface.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,10 @@ def recompute_timesteps():
464464
function.result_type = 'int32'
465465
return function
466466

467-
def get_nj_max(self):
468-
"""
469-
Returns the maximum number of particles supported by Sapporo Light.
470-
"""
467+
def get_nj_max():
471468
function = LegacyFunctionSpecification()
472-
return function(
473-
returns=int,
474-
)
469+
function.result_type = 'int32'
470+
return function
475471

476472
class ph4(GravitationalDynamics,GravityFieldCode):
477473

0 commit comments

Comments
 (0)