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

Incorporating Balochistan workflow to master #59

Closed
wants to merge 287 commits into from

Conversation

mathijshenquet
Copy link

@mathijshenquet mathijshenquet commented May 12, 2020

Resolves epidemics/covid#452

  • Allow overwriting region names in config.yml
  • Add Balochistan data to sites/balochistan/
  • Moves data to generated the main site to sites/main/
  • Made it possible to specify in config.yaml and estimates.csv when the model was updated/when the estimates were made.

NB: The sites/ directory would be how I would organize the different sites going forward.

Blocked by #49

@lgtm-com
Copy link

lgtm-com bot commented May 14, 2020

This pull request introduces 2 alerts when merging f426f16 into fa06024 - view on LGTM.com

new alerts:

  • 2 for Unused import

@hnykda
Copy link

hnykda commented May 21, 2020

I believe this is superseded by switching to luigi. The way how this could be changed is by providing a different data-dir (or just it outputs directory) https://epidemicforecasting.slack.com/archives/CV93A58G7/p1590040992047800?thread_ts=1590019434.047600 . You can then have a config per site (or just provide the parameter on CLI)

Should I document it?

hnykda and others added 2 commits May 22, 2020 21:29
@hnykda
Copy link

hnykda commented May 22, 2020

I tried to document how to have config per locations: 02883a7 .

Other than that, I think that the PR looks generally good. Does anyone have resources to rebase it to current master with luigi? I think the steps would be to:

  1. move the data to https://github.com/epidemics/epimodel/tree/master/data-dir/inputs, directory balochistan (sites is also fine, but ideally consistent...)
  2. move the parameters from config.yaml to a luigi-compatible balochistan.cfg as documented in the commit above (e.g. gleam_resample and so on)
  3. keep the actual business logic changes as is in this PR

@mathijshenquet
Copy link
Author

I will do that

@hnykda
Copy link

hnykda commented May 25, 2020

Cool. Any ETAs?

witzatom and others added 7 commits May 26, 2020 13:45
* fix test that results in a dtype of int64

* change types_to_json to be more architecture independent

* make luigi and other shell scripts check out with LF
* parse spreadsheet based on colab code.

* fix df-parsing issues

* load gsheet with single url parameter

* xml definition: minor refactor + add definitions for everything, properly scaled

* xml definition: more getters/setters

* add logic to import Gleam definition from a DataFrame

* make separate class to generate definition from df

* add scenario cartesian product

* add support for definition param multipliers

* rename scenario generation file

* rows with no class are applied to all scenarios

* store Regions in ScenarioGenerator df to avoid passing down rds

* refactor/rename scenario classes

* get first unittest.TestCase working

* get pytest fixtures working with unittest

* improve test compatibility with numpy

* fix broken gleam definition tests

* test region-based lookup

* test foretold integration using mocks

* separate out colab functions

* add test for SimulationSet

* fix SimulationSet bug

* start testing DefinitionGenerator

* DefinitionGenerator: test all global parameters

* DefinitionGenerator: test compartment variables

* DefinitionGenerator: fix issues with exception aggregation & add validation

* DefinitionGenerator: finish testing exceptions

* DefinitionGenerator: test multipliers

* scenario integration testing + support name & id params

* test that scenario xml output is correct

* fix test error

* ScenarioSet holds DefinitionGenerators, which manage filenames

* integrate scenario with batch

* make tests pass again

* add config as input to SimulationSet

* fix failing tests + better xml formatting

* black formatting

* start work on adding estimates to gleam definitions

* parse and add estimates in scenario

* update GleamDefinition interface for seeds

* update most tests to handle estimates

* add/update tests for estimates

* estimates parsing & setting fully tested & functional

* fix minor formatting bug in xml

* move multi-seed setting logic to GleamDefinition

* fix branch lgtm issues

* use test default.xml + add initialCompartments

* convert GleamDefinition tests to unittest + test xml output

* fix lgtm alerts

* client version in xml is 7.0

* test scenario Batch integration

* scenario takes name from config, not params

* add context manager for default xml path

* move generate_simulations code to scenario & use new classes

* fix test isolation problem with tmp_path

* update dependencies & fix CI test failure

* change GenerateGleamBatch task to use new logic

* fix lint

* move sims generation to Batch & change sims storage params

* update config for new scenarios

* enable GleamDefinition parse from string

* update WebExport for new config & simulations format

* fix lint

* don't pickle RegionsDataset

* bugfix + remove dill from dependencies

* rename GenerateSimulationDefinitions => ExportSimulationDefinitions since it doesn't actually generate them

* define Gleam parameters file in luigi config

* clean up traces of old luigi tasks

* gleam stores initial compartments in tenths

* Use population to fill in susceptible initial compartment

And XML stopped alphebetizing attrs for some reason

* move part of ParseInput _get_region method to RegionDataset

* web-export bugfixes

* fix ExportSimulationDefinitions success file bug

* update/refactor example-run.sh

* fix gleam results path expansion issue + test config

* add docs for manual inputs in readme
* the single_result parameters is actually interpreted as pointing to the result directory and not the actual result file

* do not append the web-export directory name to the gcs path

* change the GleamvizResults to be easier to configure
add a r estimation script and integrate with luigi
@lgtm-com
Copy link

lgtm-com bot commented May 28, 2020

This pull request introduces 8 alerts when merging 03e1b4e into 671562b - view on LGTM.com

new alerts:

  • 3 for Unused import
  • 2 for Wrong name for an argument in a call
  • 2 for Testing equality to None
  • 1 for Module is imported with 'import' and 'import from'

@mathijshenquet
Copy link
Author

mathijshenquet commented May 28, 2020

With this commit it has become impossible to reproduce the website builds using the hdf5 files in fixtures. The reason is the reworking of how the trace/group names work and how it expects the traces to be named in hdf5 and how it puts them in the exported json file.

The breakage for the normal site, renamed main here, is limited and I will make a issue about it - epidemics/covid#459. For balochistan it might be more severe and I have no idea how to approach it at this point.

@hnykda
Copy link

hnykda commented May 28, 2020

And do we still need it?

* add a way to have a overrides config to contain configurable secrets

* rename overrides to secrets
# Conflicts:
#	README.md
#	epimodel/tasks.py
@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2020

This pull request introduces 8 alerts when merging 43c4db1 into 6131ea8 - view on LGTM.com

new alerts:

  • 3 for Unused import
  • 2 for Wrong name for an argument in a call
  • 2 for Testing equality to None
  • 1 for Module is imported with 'import' and 'import from'

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.

Problem: Balochistan customsite does not have a reproducable build
10 participants