From 9b4600db27375e2fc1a2e5acd511ce7db9f3e1cf Mon Sep 17 00:00:00 2001 From: Theodore-Chatziioannou Date: Wed, 24 May 2023 14:22:11 +0000 Subject: [PATCH] renaming --- examples/15_Advanced_Choice.ipynb | 22 +++++++++---------- pam/planner/{choice.py => choice_location.py} | 2 +- ....py => test_24_planner_choice_location.py} | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) rename pam/planner/{choice.py => choice_location.py} (99%) rename tests/{test_24_planner_choice.py => test_24_planner_choice_location.py} (98%) diff --git a/examples/15_Advanced_Choice.ipynb b/examples/15_Advanced_Choice.ipynb index 5c86a39e..7bd413c7 100644 --- a/examples/15_Advanced_Choice.ipynb +++ b/examples/15_Advanced_Choice.ipynb @@ -50,7 +50,7 @@ "source": [ "import pandas as pd\n", "from pam.read import read_matsim\n", - "from pam.planner import choice\n", + "from pam.planner import choice_location as choice\n", "from pam.operations.cropping import link_population\n", "from pam.planner.od import OD, Labels, ODMatrix, ODFactory\n", "import random\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "ddafc60f", + "id": "15027351", "metadata": {}, "outputs": [ { @@ -326,8 +326,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO:pam.planner.choice:Updated model configuration\n", - "INFO:pam.planner.choice:ChoiceConfiguration(u=None, scope=None, func_probabilities=, func_sampling=)\n" + "INFO:pam.planner.choice_location:Updated model configuration\n", + "INFO:pam.planner.choice_location:ChoiceConfiguration(u=None, scope=None, func_probabilities=, func_sampling=)\n" ] } ], @@ -361,8 +361,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO:pam.planner.choice:Updated model configuration\n", - "INFO:pam.planner.choice:ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=, func_sampling=)\n" + "INFO:pam.planner.choice_location:Updated model configuration\n", + "INFO:pam.planner.choice_location:ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=, func_sampling=)\n" ] } ], @@ -402,7 +402,7 @@ "output_type": "stream", "text": [ "Activities in scope: \n", - " [ChoiceIdx(pid='chris', hid='chris', seq=1, act=), ChoiceIdx(pid='fatema', hid='fatema', seq=1, act=), ChoiceIdx(pid='fred', hid='fred', seq=3, act=), ChoiceIdx(pid='gerry', hid='gerry', seq=3, act=), ChoiceIdx(pid='nick', hid='nick', seq=1, act=)]\n", + " [ChoiceIdx(pid='chris', hid='chris', seq=1, act=), ChoiceIdx(pid='fatema', hid='fatema', seq=1, act=), ChoiceIdx(pid='fred', hid='fred', seq=3, act=), ChoiceIdx(pid='gerry', hid='gerry', seq=3, act=), ChoiceIdx(pid='nick', hid='nick', seq=1, act=)]\n", "\n", "Alternatives: \n", " [ChoiceLabel(destination='a', mode='car'), ChoiceLabel(destination='a', mode='bus'), ChoiceLabel(destination='b', mode='car'), ChoiceLabel(destination='b', mode='bus')]\n", @@ -443,10 +443,10 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO:pam.planner.choice:Applying choice model...\n", - "INFO:pam.planner.choice:Configuration: \n", - "ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=, func_sampling=)\n", - "INFO:pam.planner.choice:Choice model application complete.\n" + "INFO:pam.planner.choice_location:Applying choice model...\n", + "INFO:pam.planner.choice_location:Configuration: \n", + "ChoiceConfiguration(u=\"[0,-1]+(np.array([0,2])*(person.attributes['subpopulation']=='poor'))+([-0.05,-0.07]*od['time',person.home.area])+(0.4*np.log(zones['jobs']))\\n\", scope=\"act.act=='work'\", func_probabilities=, func_sampling=)\n", + "INFO:pam.planner.choice_location:Choice model application complete.\n" ] }, { diff --git a/pam/planner/choice.py b/pam/planner/choice_location.py similarity index 99% rename from pam/planner/choice.py rename to pam/planner/choice_location.py index e05f2346..f91649fc 100644 --- a/pam/planner/choice.py +++ b/pam/planner/choice_location.py @@ -1,5 +1,5 @@ """ -Choice models for activity synthesis +Location and mode choice models for activity modelling """ from copy import deepcopy from dataclasses import dataclass diff --git a/tests/test_24_planner_choice.py b/tests/test_24_planner_choice_location.py similarity index 98% rename from tests/test_24_planner_choice.py rename to tests/test_24_planner_choice_location.py index b2e08ff7..33ab4d66 100644 --- a/tests/test_24_planner_choice.py +++ b/tests/test_24_planner_choice_location.py @@ -3,7 +3,7 @@ import random from tests.test_22_planner_od import data_od, labels, od from tests.test_23_planner_zones import data_zones -from pam.planner.choice import ChoiceModel, ChoiceMNL, ChoiceSet, \ +from pam.planner.choice_location import ChoiceModel, ChoiceMNL, ChoiceSet, \ ChoiceConfiguration from pam.planner.utils_planner import sample_weighted import os