Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group by discrete variables #405

Closed
wants to merge 2 commits into from
Closed
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
22 changes: 11 additions & 11 deletions src/HealthGPS/analysis_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,41 +276,41 @@
auto current_time = static_cast<unsigned int>(context.time_now());
for (const auto &entity : context.population()) {
auto age = entity.age;
auto gender = entity.gender;
auto over_18 = entity.over_18;

Check failure on line 279 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

cannot convert ‘hgps::Person::over_18’ from type ‘bool (hgps::Person::)() const noexcept’ to type ‘bool (hgps::Person::*)() const noexcept’

Check failure on line 279 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

cannot convert ‘hgps::Person::over_18’ from type ‘bool (hgps::Person::)() const noexcept’ to type ‘bool (hgps::Person::*)() const noexcept’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: reference to non-static member function must be called; did you mean to call it with no arguments? [clang-diagnostic-error]

Suggested change
auto over_18 = entity.over_18;
auto over_18 = entity.over_18();


if (!entity.is_active()) {
if (!entity.is_alive() && entity.time_of_death() == current_time) {
series(gender, "deaths").at(age)++;
auto expcted_life = definition_.life_expectancy().at(context.time_now(), gender);
series(gender, "yll").at(age) += std::max(expcted_life - age, 0.0f) * DALY_UNITS;
series(over_18, "deaths").at(age)++;

Check failure on line 283 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [7])’

Check failure on line 283 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [7])’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

                series(over_18, "deaths").at(age)++;
                ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

auto expcted_life = definition_.life_expectancy().at(context.time_now(), over_18);

Check failure on line 284 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no matching function for call to ‘hgps::GenderTable<int, float>::at(int, bool (hgps::Person::*&)() const noexcept) const’

Check failure on line 284 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no matching function for call to ‘hgps::GenderTable<int, float>::at(int, bool (hgps::Person::*&)() const noexcept) const’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching member function for call to 'at' [clang-diagnostic-error]

                auto expcted_life = definition_.life_expectancy().at(context.time_now(), over_18);
                                                                  ^
Additional context

src/HealthGPS/gender_table.h:72: candidate function not viable: no known conversion from 'bool' to 'const core::Gender' for 2nd argument

    const TYPE &at(const ROW row, const core::Gender gender) const {
                ^

src/HealthGPS/gender_table.h:63: candidate function not viable: 'this' argument has type 'const GenderTable<int, float>', but method is not marked const

    TYPE &at(const ROW row, const core::Gender gender) {
          ^

series(over_18, "yll").at(age) += std::max(expcted_life - age, 0.0f) * DALY_UNITS;

Check failure on line 285 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [4])’

Check failure on line 285 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [4])’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

                series(over_18, "yll").at(age) += std::max(expcted_life - age, 0.0f) * DALY_UNITS;
                ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

}

if (entity.has_emigrated() && entity.time_of_migration() == current_time) {
series(gender, "migrations").at(age)++;
series(over_18, "migrations").at(age)++;

Check failure on line 289 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [11])’

Check failure on line 289 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [11])’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

                series(over_18, "migrations").at(age)++;
                ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

}

continue;
}

series(gender, "count").at(age)++;
series(over_18, "count").at(age)++;

Check failure on line 295 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [6])’

Check failure on line 295 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [6])’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

        series(over_18, "count").at(age)++;
        ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^


for (const auto &factor : context.mapping().entries()) {
series(gender, factor.key().to_string()).at(age) +=
series(over_18, factor.key().to_string()).at(age) +=

Check failure on line 298 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const std::string&)’

Check failure on line 298 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const std::string&)’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

            series(over_18, factor.key().to_string()).at(age) +=
            ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

entity.get_risk_factor_value(factor.key());
}

for (const auto &[disease_name, disease_state] : entity.diseases) {
if (disease_state.status == DiseaseStatus::active) {
series(gender, "prevalence_" + disease_name.to_string()).at(age)++;
series(over_18, "prevalence_" + disease_name.to_string()).at(age)++;

Check failure on line 304 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, std::__cxx11::basic_string<char>)’

Check failure on line 304 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, std::__cxx11::basic_string<char>)’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

                series(over_18, "prevalence_" + disease_name.to_string()).at(age)++;
                ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

if (disease_state.start_time == context.time_now()) {
series(gender, "incidence_" + disease_name.to_string()).at(age)++;
series(over_18, "incidence_" + disease_name.to_string()).at(age)++;

Check failure on line 306 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, std::__cxx11::basic_string<char>)’

Check failure on line 306 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, std::__cxx11::basic_string<char>)’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

                    series(over_18, "incidence_" + disease_name.to_string()).at(age)++;
                    ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

}
}
}

auto dw = calculate_disability_weight(entity);
series(gender, "disability_weight").at(age) += dw;
series(gender, "yld").at(age) += (dw * DALY_UNITS);
series(over_18, "disability_weight").at(age) += dw;

Check failure on line 312 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [18])’

Check failure on line 312 in src/HealthGPS/analysis_module.cpp

View workflow job for this annotation

GitHub Actions / Build and test (linux, ubuntu-22.04, gcc-latest, false)

no match for call to ‘(hgps::DataSeries) (bool (hgps::Person::*&)() const noexcept, const char [18])’
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

        series(over_18, "disability_weight").at(age) += dw;
        ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^

series(over_18, "yld").at(age) += (dw * DALY_UNITS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no matching function for call to object of type 'hgps::DataSeries' [clang-diagnostic-error]

        series(over_18, "yld").at(age) += (dw * DALY_UNITS);
        ^
Additional context

src/HealthGPS/data_series.h:29: candidate function not viable: no known conversion from 'bool' to 'core::Gender' for 1st argument

    std::vector<double> &operator()(core::Gender gender, const std::string &key);
                         ^


classify_weight(series, entity);
}
Expand Down
Loading