Bug: populationsim.util does not exist
majthehero opened this issue · 3 comments
I tried to run the examples according to the online documentation.
Currently, the examples do not work:
Traceback (most recent call last):
File ".\run_populationsim.py", line 15, in <module>
from populationsim.util import setting
ModuleNotFoundError: No module named 'populationsim.util'
I have checked what the problem is and implemented the function setting(attribute_name)
that should be in the util
module.
I have successfully managed to run the examples by replacing the import from populationsim.util import setting
with a function pasted below:
import yaml
def setting(attribute_name):
# read settings.yaml located in ./configs/
with open("./configs/settings.yaml", 'r') as stream:
try:
settingsObj = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print("oh no, no settings.yaml file in ./configs")
print(exc)
try:
return settingsObj[attribute_name]
except:
print("oh not, attribute " + attribute_name + " does not exist in settings.yaml")
I suspect that the util
module is deprecated and the examples need to be updated.
Hi. I cannot recreate this issue. What version of populationsim and activitysim do you have installed? And what command are you using to run the example? Thanks.
I had the same issue, following the installation guide here: https://activitysim.github.io/populationsim/getting_started.html#installation#150
@majthehero solution worked here
I wonder if updating the example #90 - will resolve this issue by making it obsolete