Skip to content

Commit

Permalink
Ignore Simulation::getSimulationConfig from python/swig wrapping
Browse files Browse the repository at this point in the history
Closes #689
  • Loading branch information
ptheywood committed Sep 8, 2021
1 parent 1999bb1 commit 485d7c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion swig/python/flamegpu.i
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class FLAMEGPURuntimeException : public std::exception {
// Ignore const'd accessors for configuration structs, which were mutable in python.
%ignore flamegpu::CUDASimulation::getCUDAConfig;
%ignore flamegpu::CUDAEnsemble::getConfig;
// %ignore flamegpu::Simulation::getConfig; // This doesn't currently exist
%ignore flamegpu::Simulation::getSimulationConfig; // This doesn't currently exist

// Ignore the detail namespace, as it's not intended to be user-facing
%ignore flamegpu::detail;
Expand Down
8 changes: 8 additions & 0 deletions tests/swig/python/gpu/test_cuda_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,11 @@ def test_AgentID_MultipleStatesUniqueIDs(self):

assert len(ids_original) == len(pop_out_a) + len(pop_out_b)
assert len(ids_copy) == len(pop_out_a) + len(pop_out_b)


# Ensure that Simulation::getSimulationConfig() is disabled, as it would be mutable
def test_ignored_getSimulationConfig(self):
m = pyflamegpu.ModelDescription("test_ignored_getSimulationConfig")
c = pyflamegpu.CUDASimulation(m)
with pytest.raises(AttributeError):
c.getSimulationConfig()

0 comments on commit 485d7c4

Please sign in to comment.