Skip to content

Commit 8088a0b

Browse files
authored
Merge pull request #60 from Critical-Infrastructure-Systems-Lab/master
Updating dev
2 parents c65aabb + 51a5e00 commit 8088a0b

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

dhalsim/network_events/synced_event.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def db_query(self, query, write=False, parameters=None):
107107
"""
108108
Execute a query on the database
109109
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
110-
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
110+
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.
111111
This is necessary because of the limited concurrency in SQLite.
112112
113113
:param query: The SQL query to execute in the db
@@ -147,7 +147,7 @@ def get_master_clock(self):
147147
"""
148148
Get the value of the master clock of the physical process through the database.
149149
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
150-
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
150+
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.
151151
152152
:return: Iteration in the physical process.
153153
@@ -185,7 +185,7 @@ def get_sync(self, flag):
185185
"""
186186
Get the sync flag of this plc.
187187
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
188-
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
188+
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.
189189
190190
:return: False if physical process wants the plc to do a iteration, True if not.
191191
@@ -200,7 +200,7 @@ def set_sync(self, flag):
200200
Set this plcs sync flag in the sync table. When this is 1, the physical process
201201
knows this plc finished the requested iteration.
202202
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
203-
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
203+
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.
204204
205205
:param flag: True for sync to 1, False for sync to 0
206206
:type flag: bool

dhalsim/parser/config_parser.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77

88
import yaml
9-
from yamlinclude import YamlIncludeConstructor
9+
import yaml_include
1010
from schema import Schema, Or, And, Use, Optional, SchemaError, Regex
1111

1212
from dhalsim.parser.input_parser import InputParser
@@ -626,8 +626,12 @@ def __init__(self, config_path: Path):
626626

627627
self.config_path = config_path.absolute()
628628

629-
YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
630-
base_dir=config_path.absolute().parent)
629+
#YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
630+
# base_dir=config_path.absolute().parent)
631+
632+
yaml.add_constructor("!include",
633+
yaml_include.Constructor(base_dir=config_path.absolute().parent),
634+
yaml.FullLoader)
631635

632636
try:
633637
self.data = self.apply_schema(self.config_path)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
inp_file: ctown_map.inp
22
iterations: 2880
3-
#iterations: 70
43
network_topology_type: complex
54
plcs: !include ctown_plcs.yaml
65

76
log_level: debug
87
simulator: epynet
98
demand: pdd
10-
attacks: !include ctown_unconstrained_blackbox_concealment_mitm.yaml
9+
#attacks: !include ctown_unconstrained_blackbox_concealment_mitm.yaml
1110
#attacks: !include ctown_concealment_mitm_value.yaml
1211
#attacks: !include ctown_payload_replay_conceal.yaml
1312
#ma attacks: !include ctown_network_replay_conceal.yaml

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sudo python3 -m pip install cpppo
3434

3535
# MiniCPS
3636
cd ~
37-
git clone --depth 1 https://github.com/scy-phy/minicps.git || git -C minicps pull
37+
git clone --depth 1 https://github.com/afmurillo/minicps.git || git -C minicps pull
3838
cd minicps
3939
sudo python3 -m pip install .
4040

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@
2020
'antlr4-python3-runtime==4.13.1',
2121
'progressbar2',
2222
'numpy==1.24.3',
23-
'wntr',
23+
'wntr==1.2.0',
2424
'pandas',
2525
'matplotlib',
2626
'schema',
2727
'scapy',
2828
'pathlib',
29-
'testresources',
29+
'testresources==2.0.1',
3030
'pytest-mock',
3131
'netaddr',
3232
'flaky',
3333
'pytest',
34-
'tensorflow',
34+
'exceptiongroup==1.2.2',
35+
'typing-extensions==4.5.0',
36+
'tensorflow==2.13.1',
3537
'scikit-learn',
3638
'keras==2.13.1',
37-
'pytest',
38-
'pytest-mock',
3939
'mock'
4040
],
4141
extras_require={

0 commit comments

Comments
 (0)