def region(name): return covid.region(name)
template.format(href="http://fce.unb.br/", name="UnB/FCE"), template.format(href="http://www.butantan.gov.br/", name="Butantã"), template.format(href="http://www.matogrossodosul.fiocruz.br/", name="Fiocruz"), template.format(href="https://famed.ufms.br/", name="FAMED"), ] links = _("Support: {institutions}").format(institutions=", ".join(institutions)) styles = "text-align: center; margin: 5rem 0 -5rem 0;" html(f'<div style="{styles}">{links}</div>') def fatality_rate(fs, dt=1): fs = fs.copy() fs.iloc[:-1] -= fs.values[1:] fs /= -dt fs.iloc[-1] = fs.iloc[-2] return fs.apply(lambda x: round(x, 1)) def write_css(): html(asset("custom.html")) if __name__ == "__main__": region = covid.region("Brazil") model = SEICHAR(region=region, prob_symptomatic=0.5, seed=1000) model.run(180) write_css() app = Output(model) app.run()
def test_city(self): sp = region("Brazil/São Paulo") assert sp.population_size == 11_253_503
def test_country(self): br = region("Brazil") assert br.population_size == 212_559_000
def test_metro_area(self): sp = region("Brazil/Metropolitana de São Paulo") assert sp.population_size == 21_154_988
def get_region(ref): region = covid.region(ref) if ref.lower().startswith("brazil/"): region.demography = DEMOGRAPHY_CORRECTION return region