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

Update country_specific.py #24

Closed
2 tasks done
yalinli2 opened this issue Aug 4, 2022 · 3 comments
Closed
2 tasks done

Update country_specific.py #24

yalinli2 opened this issue Aug 4, 2022 · 3 comments

Comments

@yalinli2
Copy link
Member

yalinli2 commented Aug 4, 2022

I was trying to run all the systems together for different countries, it worked perfectly for the first country, then failed as it transitioned into the second country.

The error seems to be related to impact items, essentially the impact items for the second system weren't loaded, but I'm not sure why this error could occur, I can think of ways to bypass this (e.g., force reload all impact items), but that'll lead to creation of more objects which will certainly slow the speed.

Looking back at the code - current a new model is create for each system for each country, but transitioning between countries doesn't need a new model, we can just update the model parameter values, so I'd like to update the country_specific.py module for this, I think the followings should be done:

  • Only update parameter values (baseline/distribution) when changing countries, the create_country_specific_model func should only create a new model when it's not provided, if a model is provided, it can just update the values
  • Move the input_dct to a centralized place (as a standalone spreadsheet) - I just realized all the input_dct in different systems are the same (and they should be), moving to one place will make sure that updates can be reflected across modules - users can provide different input_dct if they want
@haclohman
Copy link
Member

I think that all sounds good to me! Eventually I will probably do more than the original 5 counties we have in the input dictionary (China, India, Senegal, South Africa, and Uganda). Would it be better if we transition to having all the data in a single spreadsheet and then pulling the values based on the country instead of adding it manually to the input dictionary? Similar to what we are doing for the location database in DMsan.

@yalinli2
Copy link
Member Author

yalinli2 commented Aug 4, 2022

yep if you want to do more than 5 countries then a spreadsheet might be easier for you/users to manage the data, I'll convert the data into a spreadsheet instead of the dictionary

in fact, I'll keep the five countries input_dct in EXPOsan as a demo on how country-specific analysis can be performed, and put the spreadsheet (which will have more data) in DMsan since that's where we gonna do the actual analysis

@yalinli2
Copy link
Member Author

yalinli2 commented Aug 6, 2022

@yalinli2 yalinli2 closed this as completed Aug 6, 2022
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

No branches or pull requests

2 participants