pycityagent 2.0.0a54__cp310-cp310-macosx_11_0_arm64.whl → 2.0.0a56__cp310-cp310-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,6 +70,9 @@ class Simulator:
70
70
  - grpc client of simulator
71
71
  """
72
72
  else:
73
+ raise ValueError(
74
+ f"Passing Traffic Simulation address is not supported!"
75
+ )
73
76
  self._client = CityClient(config["simulator"]["server"], secure=False)
74
77
  else:
75
78
  logger.warning(
@@ -173,6 +176,7 @@ class Simulator:
173
176
  return formatted_time
174
177
  else:
175
178
  return int(now["t"])
179
+
176
180
  async def pause(self):
177
181
  await self._client.pause_service.pause()
178
182
 
@@ -20,6 +20,7 @@ logger = logging.getLogger("mlflow")
20
20
 
21
21
  def init_mlflow_connection(
22
22
  config: dict,
23
+ experiment_uuid: str,
23
24
  mlflow_run_name: Optional[str] = None,
24
25
  experiment_name: Optional[str] = None,
25
26
  experiment_description: Optional[str] = None,
@@ -43,6 +44,7 @@ def init_mlflow_connection(
43
44
  experiment_tags = {}
44
45
  if experiment_description is not None:
45
46
  experiment_tags["mlflow.note.content"] = experiment_description
47
+ experiment_tags["experiment_id"] = experiment_uuid
46
48
 
47
49
  uri = config["mlflow_uri"]
48
50
  client = mlflow.MlflowClient(tracking_uri=uri)
@@ -75,6 +77,7 @@ class MlflowClient:
75
77
  def __init__(
76
78
  self,
77
79
  config: dict,
80
+ experiment_uuid: str,
78
81
  mlflow_run_name: Optional[str] = None,
79
82
  experiment_name: Optional[str] = None,
80
83
  experiment_description: Optional[str] = None,
@@ -89,6 +92,7 @@ class MlflowClient:
89
92
  self._run_uuid,
90
93
  ) = init_mlflow_connection(
91
94
  config=config,
95
+ experiment_uuid=experiment_uuid,
92
96
  mlflow_run_name=mlflow_run_name,
93
97
  experiment_name=experiment_name,
94
98
  experiment_description=experiment_description,
@@ -85,9 +85,14 @@ class AgentSimulation:
85
85
  self._simulator = Simulator(config["simulator_request"])
86
86
  if enable_economy:
87
87
  self._economy_env = self._simulator._sim_env
88
- _req_dict = self.config["simulator_request"]
88
+ _req_dict: dict = self.config["simulator_request"]
89
89
  if "economy" in _req_dict:
90
- _req_dict["economy"]["server"] = self._economy_env.sim_addr
90
+ if "server" in _req_dict["economy"]:
91
+ raise ValueError(
92
+ f"Passing Economy Simulation address is not supported!"
93
+ )
94
+ else:
95
+ _req_dict["economy"]["server"] = self._economy_env.sim_addr
91
96
  else:
92
97
  _req_dict["economy"] = {
93
98
  "server": self._economy_env.sim_addr,
@@ -129,15 +134,17 @@ class AgentSimulation:
129
134
 
130
135
  # mlflow
131
136
  _mlflow_config: dict[str, Any] = config.get("metric_request", {}).get("mlflow")
132
- mlflow_run_id, _ = init_mlflow_connection(
133
- config=_mlflow_config,
134
- mlflow_run_name=f"EXP_{self.exp_name}_{1000*int(time.time())}",
135
- experiment_name=self.exp_name,
136
- )
137
137
  if _mlflow_config:
138
138
  logger.info(f"-----Creating Mlflow client...")
139
+ mlflow_run_id, _ = init_mlflow_connection(
140
+ config=_mlflow_config,
141
+ experiment_uuid=self.exp_id,
142
+ mlflow_run_name=f"EXP_{self.exp_name}_{1000*int(time.time())}",
143
+ experiment_name=self.exp_name,
144
+ )
139
145
  self.mlflow_client = MlflowClient(
140
146
  config=_mlflow_config,
147
+ experiment_uuid=self.exp_id,
141
148
  mlflow_run_name=f"EXP_{exp_name}_{1000*int(time.time())}",
142
149
  experiment_name=exp_name,
143
150
  run_id=mlflow_run_id,
@@ -526,6 +533,7 @@ class AgentSimulation:
526
533
  _mlflow_config = self.config.get("metric_request", {}).get("mlflow")
527
534
  if _mlflow_config:
528
535
  mlflow_run_id, _ = init_mlflow_connection(
536
+ experiment_uuid=self.exp_id,
529
537
  config=_mlflow_config,
530
538
  mlflow_run_name=f"{self.exp_name}_{1000*int(time.time())}",
531
539
  experiment_name=self.exp_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pycityagent
3
- Version: 2.0.0a54
3
+ Version: 2.0.0a56
4
4
  Summary: LLM-based city environment agent building library
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>, Junbo Yan <yanjb20thu@gmali.com>, Jun Zhang <zhangjun990222@gmali.com>
6
6
  License: MIT License
@@ -1,7 +1,7 @@
1
1
  pycityagent/pycityagent-sim,sha256=1Nu-QYC0AuZyVWciGNa2XkYsUntbwAS15Bo7l-y6eok,35449490
2
2
  pycityagent/__init__.py,sha256=PUKWTXc-xdMG7px8oTNclodsILUgypANj2Z647sY63k,808
3
3
  pycityagent/pycityagent-ui,sha256=cHZjqtrQ4Fh4qtRahFNCNbT2DNHLmUexiDAa-72Z3RQ,40333378
4
- pycityagent/metrics/mlflow_client.py,sha256=g_tHxWkWTDijtbGL74-HmiYzWVKb1y8-w12QrY9jL30,4449
4
+ pycityagent/metrics/mlflow_client.py,sha256=bTrqYsRfNfjJd6l91hU8vN7JXzJC7DHiM2XbkhMuXIU,4613
5
5
  pycityagent/metrics/__init__.py,sha256=X08PaBbGVAd7_PRGLREXWxaqm7nS82WBQpD1zvQzcqc,128
6
6
  pycityagent/metrics/utils/const.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  pycityagent/economy/__init__.py,sha256=aonY4WHnx-6EGJ4WKrx4S-2jAkYNLtqUA04jp6q8B7w,75
@@ -22,7 +22,7 @@ pycityagent/memory/utils.py,sha256=oJWLdPeJy_jcdKcDTo9JAH9kDZhqjoQhhv_zT9qWC0w,8
22
22
  pycityagent/memory/const.py,sha256=6zpJPJXWoH9-yf4RARYYff586agCoud9BRn7sPERB1g,932
23
23
  pycityagent/memory/faiss_query.py,sha256=V3rIw6d1_xcpNqZBbAYz3qfjVNE7NfJ7xOS5SibPtVU,13180
24
24
  pycityagent/memory/state.py,sha256=TYItiyDtehMEQaSBN7PpNrnNxdDM5jGppr9R9Ufv3kA,5134
25
- pycityagent/simulation/simulation.py,sha256=mgzghIaud8M-gUjTlA8vRZ7X7l3UJgXBRm68cT0Fy18,32781
25
+ pycityagent/simulation/simulation.py,sha256=3wFJEiYSNGVnEMOgKBhp566M-jm1l-kwFKXau2QJFSQ,33161
26
26
  pycityagent/simulation/__init__.py,sha256=P5czbcg2d8S0nbbnsQXFIhwzO4CennAhZM8OmKvAeYw,194
27
27
  pycityagent/simulation/agentgroup.py,sha256=ANTQA2OFQpuNZBz2VRhy60pTPUM1lXHFJLzFgK1SvxQ,31633
28
28
  pycityagent/simulation/storage/pg.py,sha256=xRshSOGttW-p0re0fNBOjOpb-nQ5msIE2LsdT79_E_Y,8425
@@ -47,7 +47,7 @@ pycityagent/workflow/prompt.py,sha256=6jI0Rq54JLv3-IXqZLYug62vse10wTI83xvf4ZX42n
47
47
  pycityagent/workflow/block.py,sha256=4QufS8XnyP6SYp8g1gDODW-H0nAHA7lvivrPGUq1p-w,9922
48
48
  pycityagent/workflow/trigger.py,sha256=Df-MOBEDWBbM-v0dFLQLXteLsipymT4n8vqexmK2GiQ,5643
49
49
  pycityagent/environment/__init__.py,sha256=MyZBwsweDIHOKSX2iSZs748foNtaiyEcyg6sc747T2g,263
50
- pycityagent/environment/simulator.py,sha256=gqkECMzhXRh4WHTyLFEL1_X1R7F1aX4g9881zUFv7DI,12136
50
+ pycityagent/environment/simulator.py,sha256=yDh3oa2WfgYm4zhTNizlADhI4I1WyNcXfLh99ItqiSA,12265
51
51
  pycityagent/environment/message/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  pycityagent/environment/utils/port.py,sha256=3OM6kSUt3PxvDUOlgyiendBtETaWU8Mzk_8H0TzTmYg,295
53
53
  pycityagent/environment/utils/grpc.py,sha256=6EJwKXXktIWb1NcUiJzIRmfrY0S03QAXXGcCDHqAT00,1998
@@ -97,9 +97,9 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=xWbARMfJ3-6fddrW3VOUKJrXfM
97
97
  pycityagent/survey/models.py,sha256=YE50UUt5qJ0O_lIUsSY6XFCGUTkJVNu_L1gAhaCJ2fs,3546
98
98
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
99
99
  pycityagent/survey/manager.py,sha256=S5IkwTdelsdtZETChRcfCEczzwSrry_Fly9MY4s3rbk,1681
100
- pycityagent-2.0.0a54.dist-info/RECORD,,
101
- pycityagent-2.0.0a54.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
102
- pycityagent-2.0.0a54.dist-info/WHEEL,sha256=ezfKMaDztqf77C8lvQ0NCnZxkTaOaKLprqJ8q932MhU,109
103
- pycityagent-2.0.0a54.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
104
- pycityagent-2.0.0a54.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
105
- pycityagent-2.0.0a54.dist-info/METADATA,sha256=rziSp1wXuaGcNbO3WTqNx6s7JqARZxLvFeNLvsChKUo,9110
100
+ pycityagent-2.0.0a56.dist-info/RECORD,,
101
+ pycityagent-2.0.0a56.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
102
+ pycityagent-2.0.0a56.dist-info/WHEEL,sha256=ezfKMaDztqf77C8lvQ0NCnZxkTaOaKLprqJ8q932MhU,109
103
+ pycityagent-2.0.0a56.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
104
+ pycityagent-2.0.0a56.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
105
+ pycityagent-2.0.0a56.dist-info/METADATA,sha256=hkVVU9cbagWMuXsPQ8p6SjB1QjxMs4xILhudf6AMHn0,9110