diff --git a/requirements.txt b/requirements.txt index de8cdc0..6e163f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +numpy<1.24 aequilibrae shapely>=2.0 geopandas diff --git a/tradesman/model.py b/tradesman/model.py index fdca7e6..afb1bbc 100644 --- a/tradesman/model.py +++ b/tradesman/model.py @@ -113,6 +113,11 @@ def import_population(self, overwrite=False): *overwrite* (:obj:`bool`): Deletes pre-existing population_source_import. Defaults to False """ + fields = self._project.zoning.fields + if "population" not in fields.all_fields(): + fields.add("population", "Total population", "INTEGER") + fields.save() + import_population( self._project, self._project.about.country_name, self.__population_source, overwrite=overwrite ) diff --git a/tradesman/model_creation/delete_links_and_nodes.py b/tradesman/model_creation/delete_links_and_nodes.py index bc69472..42d9087 100644 --- a/tradesman/model_creation/delete_links_and_nodes.py +++ b/tradesman/model_creation/delete_links_and_nodes.py @@ -97,7 +97,7 @@ def delete_links_and_nodes(model_place, project: Project): del_links = list(links[~links.link_id.isin(inner_gdf.link_id)][["link_id"]].itertuples(index=False, name=None)) - remove_triggers(project.conn, project.logger) + remove_triggers(project.conn, project.logger, "network") project.conn.executemany("DELETE FROM links WHERE link_id=?", del_links) project.conn.commit() @@ -111,4 +111,4 @@ def delete_links_and_nodes(model_place, project: Project): project.conn.execute(nodes_query) project.conn.commit() - add_triggers(project.conn, project.logger) + add_triggers(project.conn, project.logger, "network")