Skip to content

Move "def from_X" module methods to classmethods of Demographics and use cls() #30

@ckirkman-IDM

Description

@ckirkman-IDM

This is to allow proper class inheritance in emod_api/emodpy/emodpy-malaria class hierarchy. Right now, emod_api from_XYZ() functions only return emod-api Demographics objects even when called from emodpy-malaria layer (should return an emodpy-malaria Demographics object).

emod_api.demographics module contains functions e.g.:

def from_template_node(lat=0, lon=0, pop=1000000, name="Erewhon", forced_id=1):

They all build Demographics objects and should be located inside the Demographics class as @classmethod .

All related tests will need to be updated.

emodpy-hiv will be affected as well as emodpy-malaria

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions