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

DiseasyActivity: Use non-informative activity by default #108

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

RasmusSkytte
Copy link
Contributor

@RasmusSkytte RasmusSkytte commented Jun 12, 2024

Intent

This PR expands DiseasyActivity to provide non-informative activity information by default.

That way, a new instance created with DiseasyActivity$new() can directly be used to generate contact matrices and openness.

Approach

$get_scenario_openness() and $get_scenario_contacts() now checks if a scenario is loaded.

If no scenario is loaded, it will provided non-informative activity information.

If the contact_basis is set, it will use the age groups from here by default.
If not, it will only have the "0+" age group.

Non-informative activity information means:

  • Openness is always 1
  • The contact matrices are uniform and, when summed, the largest eigenvalue is 1

Known issues

N/A

Checklist

  • The PR passes all local unit tests
  • I have documented any new features introduced
  • If the PR adds a new feature, please add an entry in NEWS.md
  • A reviewer is assigned to this PR

@RasmusSkytte RasmusSkytte self-assigned this Jun 12, 2024
@RasmusSkytte RasmusSkytte added the enhancement New feature or request label Jun 12, 2024
@RasmusSkytte RasmusSkytte marked this pull request as ready for review June 12, 2024 10:17
@RasmusSkytte RasmusSkytte requested review from a team, SofiaOtero and LasseEngboChr and removed request for a team June 12, 2024 10:17
Copy link
Contributor

@LasseEngboChr LasseEngboChr left a comment

Choose a reason for hiding this comment

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

Wouldn't it be smarter to make the initializer so that this is resolved?

@RasmusSkytte
Copy link
Contributor Author

Wouldn't it be smarter to make the initializer so that this is resolved?

I am not sure this would be easier.

As far as I could tell, to achieve unit scenario_openness, we would then do the following.

  • By default, set the scenario_matrix to have an acitivity which corresponds the unit activity

  • Set the default activity_units with a unit corresponding to unit activity.

  • Both of these would have to respect the value of direction to ensure that we get unit values when we compute the openess.

  • Set a default risk_matrix

This would give us a openness that we could use in the remaining computation and which should hopefully resolve to a unit openness.

This would however also be fragile in principle.
That is, if a user changes the activity units but does not configure a full scenario (using $change_activity), it would fail.

The current solution keeps a unit scenario until a new scenario is fully configured.

The steps to achieve unit scenario_contacts would be similar but there may be more pitfalls here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants