Urban-Analytics-Technology-Platform / acbm

activity-based modelling pipeline (for transport demand models)
https://hackmd.io/w-m_OKaDT3GGBfSqFPpBjA
Apache License 2.0
4 stars 1 forks source link

Explore PAM for assigning activities to geographical locations #18

Closed Hussein-Mahfouz closed 1 month ago

Hussein-Mahfouz commented 5 months ago

PAM is a python package for activity sequence modelling. It has functions for spatial sampling of activity locations. See this notebook on basic sampling and this one on more complex sampling.

Hussein-Mahfouz commented 5 months ago

It's unclear what's the best way to install this library. From the installation, it recommends creating a separate virtual environment

We do not recommend trying to install PAM directly with pip (e.g. in a virtual environment) as you need to first install underlying native geospatial libraries, the method for which differs by operating system. If you choose to install into a virtual environment, ensure you have libgdal and libspatialindex installed on your device before installing with pip

Option 1: Ignore advice and try installing directly

I tried poetry add cml-pam, but got the following error

Exception: Python bindings of GDAL 3.8.5 require at least libgdal 3.8.5, but 3.4.1 was found

I tried updating libgdal through apt, but the latest version of libgdal on apt is 3.4.1 (even though gdal 3.8.5 has been released https://gdal.org/download.html)

TODO: figure out how to install libgdal and lispatialindex, updating the repo readme with instructions, and then using poetry add cml-pam to use pam through poetry

Option 2: Creating a virtual environment for pam and installing acbm in that virtual environment

I did the following and I now how a functioning virtual environment

It's unclear whether changes to acbm would reflect in this environment. I don't really like this approach but it means I can use the library for now

Hussein-Mahfouz commented 1 month ago

PAM added as a dependancy now through #42 , thanks @sgreenbury !