Skip to content

Conversation

@b-s-code
Copy link
Collaborator

@b-s-code b-s-code commented Sep 8, 2025

Problem

While reading some age structure code, I encountered an unexpected XML attribute.

This attribute is related to population growth.

For at least 10 years, OpenMalaria has just thrown an exception if this attribute is used with any nonzero value. So the code is not really useful.

Solution

This PR removes schema-level support for the XML attribute and deletes code related to it.

Testing

(macOS CI fails but this is addressed in a separate PR #437)

Nonzero values for the growthRate attribute were not supported before this PR anyway.

Before:

When one added growthRate="0.1" to the node in the example, XML, the output when running OpenMalaria is:
Error: Population growth rate provided.
In: example_scenario.xml

After:

Now, if one adds growthRate="0.1" to the node in the example, XML, the output when running OpenMalaria is:
XSD error: instance document parsing failed
:29:83 error: attribute 'growthRate' is not declared for element 'demography'

Documentation

Wiki docs are already consistent with the behaviour before and after this PR, no update is needed.

https://github.com/SwissTPH/openmalaria/wiki/ModelDemography

The simulations also run with constant population sizes

Notes

I chose to leave a variable called rho instead of just hardcoding a value of 0 everywhere it's used because that seems more readable to me.

Nonzero values for this attribute were not supported anyway.
E.g. when one adds growthRate="0.1" to the <demography> node in the example, XML, the output is:
Error: Population growth rate provided.
In: example_scenario.xml
@b-s-code
Copy link
Collaborator Author

b-s-code commented Sep 8, 2025

@acavelan could I please get a review?

@melissapenny @nakul7 FYI

@b-s-code b-s-code merged commit c4f331c into SwissTPH:main Sep 10, 2025
5 of 8 checks passed
@b-s-code b-s-code deleted the bs_popgrowth branch September 10, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants