Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pypartmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ NB_MODULE(_PyPartMC, m) {
"Return a string with JSON representation of the object.")
.def("init_env_state", Scenario::init_env_state,
"Initialize the EnvState.")
.def("aero_emissions", Scenario::get_dist,
.def("aero_emissions", Scenario::get_aero_emission_dist,
"Return aero_emissions AeroDists at a given index.")
.def_prop_ro("aero_emissions_n_times", Scenario::get_emissions_n_times,
"Return the number of times specified for emissions.")
Expand Down
2 changes: 1 addition & 1 deletion src/scenario.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct Scenario {
);
}

static AeroDist* get_dist(const Scenario &self, const AeroData &aero_data, const int &idx) {
static AeroDist* get_aero_emission_dist(const Scenario &self, const AeroData &aero_data, const int &idx) {
// if (idx < 0 || idx >= AeroDist::get_n_mode(self))
// throw std::out_of_range("Index out of range");
AeroDist *ptr = new AeroDist();
Expand Down
7 changes: 6 additions & 1 deletion tests/test_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ def test_multi_mode(mode_names):
emissions.mode(i).name for i in range(emissions.n_mode)
)
assert mode_names == actual_mode_names
# TODO #223 : same for background

background = sut.aero_background(aero_data, 0)
actual_mode_names = tuple(
background.mode(i).name for i in range(background.n_mode)
)
assert mode_names == actual_mode_names

@staticmethod
@pytest.mark.parametrize("key", ("aero_emissions", "aero_background"))
Expand Down
Loading